twitter_connect 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -53,5 +53,18 @@ Or:
53
53
  <%= link_to "Logout from Twitter", twitter_logout_path %>
54
54
  </code></pre>
55
55
 
56
+ 6 get twitter information or post tweet
57
+ <pre><code>
58
+ class TwitterConnect < ApplicationController
59
+ include TwitterOauth
60
+
61
+ def tweet
62
+ oauth = get_oauth
63
+ client = Twitter::Base.new(oauth)
64
+ client.update('test')
65
+ end
66
+ end
67
+ </code></pre>
68
+
56
69
 
57
70
  Copyright (c) 2010 [Richard Huang], released under the MIT license
@@ -53,5 +53,18 @@ Or:
53
53
  <%= link_to "Logout from Twitter", twitter_logout_path %>
54
54
  </code></pre>
55
55
 
56
+ 6 get twitter information or post tweet
57
+ <pre><code>
58
+ class TwitterConnect < ApplicationController
59
+ include TwitterOauth
60
+
61
+ def tweet
62
+ oauth = get_oauth
63
+ client = Twitter::Base.new(oauth)
64
+ client.update('test')
65
+ end
66
+ end
67
+ </code></pre>
68
+
56
69
 
57
70
  Copyright (c) 2010 [Richard Huang], released under the MIT license
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -1,6 +1,9 @@
1
1
  require 'twitter'
2
+ require File.join(File.dirname(__FILE__), '..', '..', 'twitter_oauth')
2
3
 
3
4
  class TwitterConnectsController < ActionController::Base
5
+ include TwitterOauth
6
+
4
7
  def oauth
5
8
  oauth = get_oauth
6
9
  request_token = oauth.set_callback_url twitter_callback_url
@@ -26,9 +29,4 @@ class TwitterConnectsController < ActionController::Base
26
29
 
27
30
  redirect_to TwitterConnect.configuration['logout_url'] || root_url
28
31
  end
29
-
30
- private
31
- def get_oauth
32
- oauth = Twitter::OAuth.new(TwitterConnect.configuration['consumer_token'], TwitterConnect.configuration['consumer_secret'])
33
- end
34
32
  end
@@ -22,6 +22,7 @@ module TwitterConnect
22
22
  end
23
23
  end
24
24
 
25
+ require 'twitter_oauth'
25
26
  require 'app/controllers/twitter_connects_controller'
26
27
  require 'app/helpers/twitter_connects_helper'
27
28
 
@@ -0,0 +1,5 @@
1
+ module TwitterOauth
2
+ def get_oauth
3
+ oauth = Twitter::OAuth.new(TwitterConnect.configuration['consumer_token'], TwitterConnect.configuration['consumer_secret'])
4
+ end
5
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{twitter_connect}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Richard Huang"]
12
- s.date = %q{2010-03-31}
12
+ s.date = %q{2010-07-06}
13
13
  s.description = %q{facebook connect style twitter oauth}
14
14
  s.email = %q{flyerhzm@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
29
29
  "lib/app/views/twitter_connects/callback.html.erb",
30
30
  "lib/public/javascripts/twitter_connect.js",
31
31
  "lib/twitter_connect.rb",
32
+ "lib/twitter_oauth.rb",
32
33
  "rails/init.rb",
33
34
  "tasks/twitter_connect_tasks.rake",
34
35
  "test/test_helper.rb",
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Richard Huang
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-31 00:00:00 +08:00
17
+ date: 2010-07-06 00:00:00 +08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -51,6 +51,7 @@ files:
51
51
  - lib/app/views/twitter_connects/callback.html.erb
52
52
  - lib/public/javascripts/twitter_connect.js
53
53
  - lib/twitter_connect.rb
54
+ - lib/twitter_oauth.rb
54
55
  - rails/init.rb
55
56
  - tasks/twitter_connect_tasks.rake
56
57
  - test/test_helper.rb