jnunemaker-twitter 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History +4 -0
- data/VERSION.yml +1 -1
- data/examples/user.rb +5 -0
- data/lib/twitter.rb +5 -0
- data/test/fixtures/user.json +1 -0
- data/test/twitter_test.rb +7 -0
- metadata +4 -1
data/History
CHANGED
data/VERSION.yml
CHANGED
data/examples/user.rb
ADDED
data/lib/twitter.rb
CHANGED
@@ -29,6 +29,11 @@ module Twitter
|
|
29
29
|
response = HTTParty.get('http://twitter.com/statuses/public_timeline.json', :format => :json)
|
30
30
|
response.map { |tweet| Mash.new(tweet) }
|
31
31
|
end
|
32
|
+
|
33
|
+
def self.user(id)
|
34
|
+
response = HTTParty.get("http://twitter.com/users/show/#{id}.json", :format => :json)
|
35
|
+
Mash.new(response)
|
36
|
+
end
|
32
37
|
end
|
33
38
|
|
34
39
|
directory = File.dirname(__FILE__)
|
@@ -0,0 +1 @@
|
|
1
|
+
{"profile_background_tile":false,"friends_count":159,"description":"Loves his wife, ruby, notre dame football and iu basketball","utc_offset":-18000,"notifications":null,"favourites_count":79,"profile_background_color":"1A1B1F","following":null,"profile_image_url":"http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/61024905\/black250_normal.jpg","statuses_count":4752,"profile_background_image_url":"http:\/\/static.twitter.com\/images\/themes\/theme9\/bg.gif","profile_text_color":"666666","url":"http:\/\/railstips.org\/about","name":"John Nunemaker","time_zone":"Indiana (East)","protected":false,"screen_name":"jnunemaker","status":{"in_reply_to_status_id":null,"in_reply_to_user_id":null,"text":"224! http:\/\/flightcontrolled.com\/ Holy crap. There are some really high flight control scorers out there. *gives up* :D","favorited":false,"in_reply_to_screen_name":null,"created_at":"Tue Apr 14 20:38:49 +0000 2009","truncated":false,"id":1519558635,"source":"<a href=\"http:\/\/twitter.rubyforge.org\">Twitter App<\/a>"},"profile_link_color":"2FC2EF","created_at":"Sun Aug 13 22:56:06 +0000 2006","profile_sidebar_fill_color":"252429","followers_count":1248,"location":"Mishawaka, Indiana","id":4243,"profile_sidebar_border_color":"181A1E"}
|
data/test/twitter_test.rb
CHANGED
@@ -9,4 +9,11 @@ class TwitterTest < Test::Unit::TestCase
|
|
9
9
|
first.text.should == '#torrents Ultimativer Flirt Guide - In 10 Minuten jede Frau erobern: Ultimativer Flirt Guide - In 10 Mi.. http://tinyurl.com/d3okh4'
|
10
10
|
first.user.name.should == 'P2P Torrents'
|
11
11
|
end
|
12
|
+
|
13
|
+
should "have user method for unauthenticated calls to get a user's information" do
|
14
|
+
stub_get('http://twitter.com:80/users/show/jnunemaker.json', 'user.json')
|
15
|
+
user = Twitter.user('jnunemaker')
|
16
|
+
user.name.should == 'John Nunemaker'
|
17
|
+
user.description.should == 'Loves his wife, ruby, notre dame football and iu basketball'
|
18
|
+
end
|
12
19
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jnunemaker-twitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- examples/search.rb
|
115
115
|
- examples/timeline.rb
|
116
116
|
- examples/update.rb
|
117
|
+
- examples/user.rb
|
117
118
|
- lib/twitter.rb
|
118
119
|
- lib/twitter/base.rb
|
119
120
|
- lib/twitter/httpauth.rb
|
@@ -127,6 +128,7 @@ files:
|
|
127
128
|
- test/fixtures/search.json
|
128
129
|
- test/fixtures/search_from_jnunemaker.json
|
129
130
|
- test/fixtures/status.json
|
131
|
+
- test/fixtures/user.json
|
130
132
|
- test/fixtures/user_timeline.json
|
131
133
|
- test/test_helper.rb
|
132
134
|
- test/twitter/base_test.rb
|
@@ -176,3 +178,4 @@ test_files:
|
|
176
178
|
- examples/search.rb
|
177
179
|
- examples/timeline.rb
|
178
180
|
- examples/update.rb
|
181
|
+
- examples/user.rb
|