twitter_oauth 0.4.92 → 0.4.93
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.textile +8 -19
- data/lib/twitter_oauth.rb +1 -1
- data/lib/twitter_oauth/account.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1396da5bb6b97fbd4f044e192184c3ab678b863
|
4
|
+
data.tar.gz: 52e0201073279363ebf2cd89ee7b78d8cd7c5a74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d9455ca2ac54a02b9f4bf109d3aeb1ce07e3a85bce1d90c342dd4f721b6a318e604f0c3efd329615cd86ea2587fc533772e2e3c33fa4132d241fdfacaa9fc8f
|
7
|
+
data.tar.gz: 2132e6b8636b7759f5bdf38f4a95e5f54138929a06fc3910d45a843fa78fd52acf168ff528dea0cb835a6ed51589839b5ae36b776b3506e14be1fdce5e5094de
|
data/README.textile
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
h1. Twitter OAuth REST API client library for Ruby
|
2
2
|
|
3
|
+
h2. Current Status
|
4
|
+
|
5
|
+
Twitter turned off access to the v1 API so this project is currently migrating to v1.1. Unfortunately everything is not backward-compatible.
|
6
|
+
|
7
|
+
The v.0.4.9x series of this gem is work in progress getting the library compatible with Twitter v1.1 - when complete we will push v0.5.0 of this library.
|
8
|
+
|
3
9
|
h2. Install the gem
|
4
10
|
|
5
|
-
|
11
|
+
gem 'twitter_oauth'
|
6
12
|
|
7
13
|
h2. Using the gem
|
8
14
|
|
@@ -12,24 +18,7 @@ See "sinitter":http://github.com/moomerman/sinitter/tree/master for a full websi
|
|
12
18
|
|
13
19
|
h2. Unauthorized request example
|
14
20
|
|
15
|
-
|
16
|
-
Most methods will not work in this mode but some of them do. An example to retrieve the public details
|
17
|
-
about a Twitter user is below.
|
18
|
-
|
19
|
-
<pre><code>client = TwitterOAuth::Client.new
|
20
|
-
|
21
|
-
puts client.show('twitter')
|
22
|
-
=> => {"status"=>{"truncated"=>false, "favorited"=>false, "text"=>"Update on service issues http://tinyurl.com/ca872j", "id"=>1357776683, "in_reply_to_user_id"=>nil, "in_reply_to_status_id"=>nil, "source"=>"<a href=\"http://twitterfeed.com\">twitterfeed</a>", "created_at"=>"Fri Mar 20 01:17:35 +0000 2009"}, "name"=>"Twitter", "profile_sidebar_fill_color"=>"CDFFFF", "profile_sidebar_border_color"=>"8a6447", "profile_background_tile"=>false, "profile_link_color"=>"0000ff", "url"=>"http://twitter.com", "favourites_count"=>0, "id"=>783214, "description"=>"Always wondering what everyone's doing.", "profile_text_color"=>"000000", "protected"=>false, "utc_offset"=>-28800, "screen_name"=>"twitter", "profile_background_color"=>"9ae4e8", "time_zone"=>"Pacific Time (US & Canada)", "followers_count"=>469150, "profile_background_image_url"=>"http://static.twitter.com/images/themes/theme1/bg.gif", "friends_count"=>30, "statuses_count"=>290, "location"=>"San Francisco, CA", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/75075164/twitter_bird_profile_normal.png", "created_at"=>"Tue Feb 20 14:35:54 +0000 2007"}
|
23
|
-
</code></pre>
|
24
|
-
|
25
|
-
You can also access to the search API which is available in either authorized or unauthorized modes.
|
26
|
-
|
27
|
-
<pre><code>search = client.search('twitter')
|
28
|
-
search.results.size => 20
|
29
|
-
search.results.first.from_user => "josephpred"
|
30
|
-
search.results.first.text
|
31
|
-
=> "Useful public service Twitter account for those of you hitting Tahoe or just needing to cross the pass to Reno: @i80chains"
|
32
|
-
</code></pre>
|
21
|
+
Since Twitter API v1.1 all requests are required to be authorized.
|
33
22
|
|
34
23
|
h2. Authorized request example
|
35
24
|
|
data/lib/twitter_oauth.rb
CHANGED
@@ -9,6 +9,10 @@ module TwitterOAuth
|
|
9
9
|
return oauth_response.class == Net::HTTPOK
|
10
10
|
end
|
11
11
|
|
12
|
+
def info
|
13
|
+
get('/account/verify_credentials.json')
|
14
|
+
end
|
15
|
+
|
12
16
|
# Updates profile background image. Takes a File object and optional tile argument.
|
13
17
|
# Returns extended user info object.
|
14
18
|
def update_profile_background_image(image, tile = false)
|