squeejee-twitterland 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -68,23 +68,7 @@ begin
68
68
  namespace :rubyforge do
69
69
 
70
70
  desc "Release gem and RDoc documentation to RubyForge"
71
- task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
72
-
73
- namespace :release do
74
- desc "Publish RDoc to RubyForge."
75
- task :docs => [:rdoc] do
76
- config = YAML.load(
77
- File.read(File.expand_path('~/.rubyforge/user-config.yml'))
78
- )
79
-
80
- host = "#{config['username']}@rubyforge.org"
81
- remote_dir = "/var/www/gforge-projects/twitterland/rdoc"
82
- local_dir = 'rdoc'
83
-
84
- Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
85
- end
86
-
87
- end
71
+ task :release => ["rubyforge:release:gem"]
88
72
  end
89
73
  rescue LoadError
90
74
  puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 1
2
+ :patch: 0
3
3
  :major: 0
4
- :minor: 1
4
+ :minor: 2
@@ -0,0 +1,33 @@
1
+ module Twitterland
2
+ class BackTweets
3
+ include HTTParty
4
+ base_uri 'backtweets.com'
5
+ format :json
6
+
7
+ # Return tweet referencing a URL
8
+ # Get your api_key at http://www.backtype.com/developers
9
+ #
10
+ # Twitterland::BackTweets.search('http://squeejee.com', 'OU812')
11
+ def self.search(q, api_key)
12
+ rubyize_response(Mash.new(get("/search.json", :query => {:q => q, :key => api_key})))
13
+ end
14
+
15
+
16
+ # Scrubs the response from Back Tweets to rubyize keys
17
+ def self.rubyize_response(response)
18
+ results = Mash.new
19
+ results.total_results = response['totalresults'].to_i
20
+ results.start_index = response['startindex']
21
+ results.items_per_page = response['itemsperpage']
22
+ results.tweets = response['tweets'].map do |tweet|
23
+ new_tweet = Mash.new
24
+ tweet.each do |key, value|
25
+ new_tweet[key.to_s.gsub('tweet_', '')] = value
26
+ end
27
+ new_tweet
28
+ end
29
+ results
30
+ end
31
+ private_class_method :rubyize_response
32
+ end
33
+ end
@@ -4,6 +4,9 @@ module Twitterland
4
4
  base_uri 'followcost.com'
5
5
  format :json
6
6
 
7
+ # Get follow cost for specified user
8
+ #
9
+ # Twitterland::FollowCost.show('bradleyjoyce')
7
10
  def self.show(username)
8
11
  Mash.new get("/#{username}.json")
9
12
  end
@@ -6,38 +6,60 @@ module Twitterland
6
6
 
7
7
  attr_reader :is_user, :profile, :recommendations, :most_attention_towards
8
8
 
9
+ # get your api key at http://api.mrtweet.com/newapi
9
10
  def initialize(api_key, username)
10
11
  @username = username
11
12
  @api_key = api_key
12
13
  @is_user = self.is_user
13
14
  end
14
15
 
16
+ # Check whether the given user is a MrTweet user (always call API)
17
+ #
18
+ # Twitterland::Mrtweet.new(api_key,'bradleyjoyce').is_user
15
19
  def is_user
16
20
  Mash.new(self.class.get("/is_user/#{@username}/#{@api_key}.json")).is_user
17
21
  end
18
22
 
23
+ # Check whether the given user is a MrTweet user (caches first request)
24
+ #
25
+ # Twitterland::Mrtweet.new(api_key,'bradleyjoyce').is_user?
19
26
  def is_user?
20
- @is_user
27
+ @is_user ||= self.is_user
21
28
  end
22
29
 
30
+ # Returns MrTweet statistics of the given user
31
+ #
32
+ # Twitterland::Mrtweet.new(api_key,'bradleyjoyce').profile
23
33
  def profile
24
34
  if is_user?
25
35
  @profile ||= Mash.new(self.class.get("/profile/#{@username}/#{@api_key}.json")).profile
26
36
  end
27
37
  end
28
38
 
39
+ # Returns the latest recommendations the given user received on MrTweet
40
+ #
41
+ # Twitterland::Mrtweet.new(api_key,'bradleyjoyce').recommendations
29
42
  def recommendations
30
43
  if is_user?
31
44
  @recommendations ||= Mash.new(self.class.get("/recommendations/#{@username}/#{@api_key}.json")).recommendations
32
45
  end
33
46
  end
34
47
 
48
+
49
+ # Most attention towards
50
+ #
51
+ # Twitterland::Mrtweet.new(api_key,'bradleyjoyce').most_attention_towards
35
52
  def most_attention_towards
36
53
  if is_user?
37
54
  @most_attention_towards ||= Mash.new(self.class.get("/most_attention_towards/#{@username}/#{@api_key}.json")).most_attention_towards
38
55
  end
39
56
  end
40
57
 
58
+ # Recommend a user
59
+ #
60
+ # reason = "Wynn is an awesome entrepreneur, rubyist, designer and friend! Follow him for his useful and entertaining tweets!"
61
+ # friend_name = "pengwynn"
62
+ # Twitterland::Mrtweet.new(api_key,'bradleyjoyce').recommend(reason,friend_name)
41
63
  def recommend(reason, friend_name)
42
64
  if is_user?
43
65
  Mash.new(self.class.post("/recommend/#{@username}/#{@api_key}.json", :body => { :reason => reason, :friend_name => friend_name})).status == "success"
@@ -4,15 +4,25 @@ module Twitterland
4
4
  base_uri 'http://tweetblocker.com/api'
5
5
  format :json
6
6
 
7
+ # Get grade for user
8
+ #
9
+ # Twitterland::TweetBlocker.user('bradleyjoyce')
7
10
  def self.user(username)
8
11
  @result ||= Mash.new(self.get("/username/#{username}.json")).user
9
12
  end
10
13
 
14
+ # Report user as spammer
15
+ #
16
+ # Twitterland::TweetBlocker.spam('leetspeeker39203959230390235')
11
17
  def self.report_spam(username)
12
18
  status = Mash.new(self.get("/spam/#{username}.json"))
13
19
  status['error'].blank? ? status : status['error']
14
20
  end
15
21
 
22
+
23
+ # Check API rate limiting
24
+ #
25
+ # Twitterland::TweetBlocker.rate_limit
16
26
  def self.rate_limit
17
27
  @rate_limit = Mash.new(self.get("/user/rate_limit_status.json"))
18
28
  end
@@ -9,14 +9,21 @@ module Twitterland
9
9
  @password = password
10
10
  end
11
11
 
12
+ # Get Twinfluence analysis of a user
13
+ #
14
+ # Twitterland::Twinfluence.new(username,password)
12
15
  def user(id, cacheonly=true)
13
16
  Mash.new Twinfluence.post("/api_user.php", :body => {:id => id, :user => @username, :pwd => @password, :cacheonly => cacheonly})
14
17
  end
15
18
 
19
+ # Search Twinfluence users
20
+ #
16
21
  # possible options:
17
22
  # des: description
18
23
  # loc: location
19
24
  # sort, limit, minfollows
25
+ #
26
+ # Twitterland::Twinfluence.search(username,password)
20
27
  def search(id, options={})
21
28
  Mash.new Twinfluence.post("/api_search.php", :body => {:user => @username, :pwd => @password}.merge(options))
22
29
  end
@@ -5,6 +5,27 @@ module Twitterland
5
5
  base_uri 'http://twittercounter.com/api'
6
6
  format :json
7
7
 
8
+ # Get Twitter follower stats for a user
9
+ #
10
+ # Twitterland::TwitterCounter.show('bradleyjoyce')
11
+ #
12
+ # returns:
13
+ # tomorrow_2w
14
+ # followers_2w_ago
15
+ # followers_yesterday
16
+ # followers_current
17
+ # friends_current
18
+ # next_month
19
+ # growth_since_2w
20
+ # started_followers
21
+ # rank
22
+ # user_id
23
+ # growth_since
24
+ # follow_days
25
+ # tomorrow
26
+ # next_month_2w
27
+ # average_growth
28
+ # average_growth_2w
8
29
  def self.show(username, results=365)
9
30
  stats = get("/", :query => {:username => username, :output => 'json', :results => results})
10
31
  totals = stats.delete('followersperdate')
@@ -4,6 +4,10 @@ module Twitterland
4
4
  base_uri 'api.twittergrader.com/api'
5
5
  format :json
6
6
 
7
+ # Get Twitter Grade for user
8
+ # request your api key at [http://twitter.grader.com/accessrequestform
9
+ #
10
+ # Twitterland::TwitterGrader.grade('bradleyjoyce', 'OU812')
7
11
  def self.grade(username, api_key)
8
12
  data = get("/grade/#{username}.json", :query => {:APIKey => api_key})
9
13
  data['ErrorMessage'].blank? ? data['Data']['Grade'].to_f : data['ErrorMessage']
data/lib/twitterland.rb CHANGED
@@ -35,4 +35,5 @@ require File.join(directory, 'twitterland', 'twitter_counter')
35
35
  require File.join(directory, 'twitterland', 'twinfluence')
36
36
  require File.join(directory, 'twitterland', 'mrtweet')
37
37
  require File.join(directory, 'twitterland', 'twitter_grader')
38
- require File.join(directory, 'twitterland', 'tweet_blocker')
38
+ require File.join(directory, 'twitterland', 'tweet_blocker')
39
+ require File.join(directory, 'twitterland', 'back_tweets')
@@ -0,0 +1,205 @@
1
+ {
2
+ "totalresults": "35",
3
+ "startindex": 1,
4
+ "itemsperpage": 25,
5
+ "tweets": [{
6
+ "tweet_id": "2838949376",
7
+ "tweet_from_user_id": 1120,
8
+ "tweet_from_user": "robertbrook",
9
+ "tweet_profile_image_url": "http:\/\/static.twitter.com\/images\/default_profile_normal.png",
10
+ "tweet_created_at": "2009-07-25 16:11:47",
11
+ "tweet_text": "<a href=\"http:\/\/squeejee.com\/\">http:\/\/squeejee.com\/<\/a>"
12
+ },
13
+ {
14
+ "tweet_id": "2827206265",
15
+ "tweet_from_user_id": 13881209,
16
+ "tweet_from_user": "WhatAfterTwitr",
17
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/188801780\/WAT-logo_normal.png",
18
+ "tweet_created_at": "2009-07-24 22:27:16",
19
+ "tweet_text": "Why not let @squeejeeinc build your next Twitter mashup on @mongodb? <a href=\"http:\/\/squeejee.com\">http:\/\/squeejee.com<\/a>: Why not let @squeejeei.. <a href=\"http:\/\/twitter.com\/pengwynn\/statuses\/2827030010\">http:\/\/bit.ly\/TTjxA<\/a>"
20
+ },
21
+ {
22
+ "tweet_id": "2827204137",
23
+ "tweet_from_user_id": 13881209,
24
+ "tweet_from_user": "WhatAfterTwitr",
25
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/188801780\/WAT-logo_normal.png",
26
+ "tweet_created_at": "2009-07-24 22:27:07",
27
+ "tweet_text": "Let us build your next Twitter mashup on @mongodb <a href=\"http:\/\/squeejee.com\">http:\/\/squeejee.com<\/a>: Let us build your next Twitter mashup on .. <a href=\"http:\/\/twitter.com\/SqueejeeInc\/statuses\/2827004175\">http:\/\/bit.ly\/xr76K<\/a>"
28
+ },
29
+ {
30
+ "tweet_id": "2827030010",
31
+ "tweet_from_user_id": 194573,
32
+ "tweet_from_user": "pengwynn",
33
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/303465699\/wynn_face_postered_normal.png",
34
+ "tweet_created_at": "2009-07-24 22:15:48",
35
+ "tweet_text": "Why not let @squeejeeinc build your next Twitter mashup on @mongodb? <a href=\"http:\/\/squeejee.com\">http:\/\/squeejee.com<\/a>"
36
+ },
37
+ {
38
+ "tweet_id": "2827004175",
39
+ "tweet_from_user_id": 8375677,
40
+ "tweet_from_user": "SqueejeeInc",
41
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/69807891\/tool_normal.png",
42
+ "tweet_created_at": "2009-07-24 22:14:10",
43
+ "tweet_text": "Let us build your next Twitter mashup on @mongodb <a href=\"http:\/\/squeejee.com\">http:\/\/squeejee.com<\/a>"
44
+ },
45
+ {
46
+ "tweet_id": "2776628095",
47
+ "tweet_from_user_id": 8375677,
48
+ "tweet_from_user": "SqueejeeInc",
49
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/69807891\/tool_normal.png",
50
+ "tweet_created_at": "2009-07-22 12:01:23",
51
+ "tweet_text": "@audreysargent We troubleshoot rails apps as part of our Mop-up service. <a href=\"http:\/\/squeejee.com\">http:\/\/squeejee.com<\/a>"
52
+ },
53
+ {
54
+ "tweet_id": "2316396308",
55
+ "tweet_from_user_id": 112539,
56
+ "tweet_from_user": "bradleyjoyce",
57
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/179927752\/bradley_normal.png",
58
+ "tweet_created_at": "2009-06-24 21:13:39",
59
+ "tweet_text": "cool! have him contact us at <a href=\"http:\/\/squeejee.com\">http:\/\/squeejee.com<\/a> if he'd like some design-fu for that website :-) re: <a href=\"http:\/\/friendfeed.com\/scobleizer\/75efd5d1\/subject-hanging-out-with-you2gov-alan\">http:\/\/ff.im\/4olRH<\/a>"
60
+ },
61
+ {
62
+ "tweet_id": "2097464608",
63
+ "tweet_from_user_id": 20911902,
64
+ "tweet_from_user": "techhomie",
65
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/251959485\/Picture_024_normal.jpg",
66
+ "tweet_created_at": "2009-06-10 01:32:19",
67
+ "tweet_text": "@biloxijsin hey, i got an email for the twitter directory, can't set it up yet but they say they will get back to me. <a href=\"http:\/\/squeejee.com\/\">http:\/\/squeejee.com\/<\/a>"
68
+ },
69
+ {
70
+ "tweet_id": "1965797658",
71
+ "tweet_from_user_id": 1381804,
72
+ "tweet_from_user": "dslunceford",
73
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/59425829\/toon_steve2_normal.jpg",
74
+ "tweet_created_at": "2009-05-29 23:33:41",
75
+ "tweet_text": "RT @Curvezilla: Award winning software developmet house Squeejee is now taking new clients. <a href=\"Http:\/\/Squeejee.com\/contact\">Http:\/\/Squeejee.com\/contact<\/a>"
76
+ },
77
+ {
78
+ "tweet_id": "1965658625",
79
+ "tweet_from_user_id": 383935,
80
+ "tweet_from_user": "Curvezilla",
81
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/100257719\/sxsw_normal.jpg",
82
+ "tweet_created_at": "2009-05-29 23:18:40",
83
+ "tweet_text": "Award winning software developmet house Squeejee is now taking new clients. <a href=\"Http:\/\/Squeejee.com\/contact\">Http:\/\/Squeejee.com\/contact<\/a>"
84
+ },
85
+ {
86
+ "tweet_id": "1744960734",
87
+ "tweet_from_user_id": 112539,
88
+ "tweet_from_user": "bradleyjoyce",
89
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/152919038\/Photo_1_normal.jpg",
90
+ "tweet_created_at": "2009-05-09 08:14:29",
91
+ "tweet_text": "is your company trying to figure out what to do about twitter\/facebook etc? <a href=\"http:\/\/squeejee.com\/services\/new-media\">http:\/\/bit.ly\/1Nj85<\/a>"
92
+ },
93
+ {
94
+ "tweet_id": "1737996462",
95
+ "tweet_from_user_id": 194573,
96
+ "tweet_from_user": "pengwynn",
97
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/65928620\/wynn_face_postered_normal.png",
98
+ "tweet_created_at": "2009-05-08 14:39:23",
99
+ "tweet_text": "Contrarian view from @stevenbristol on hourly billing: <a href=\"http:\/\/b.lesseverything.com\/2009\/5\/7\/be-wary-of-time-and-materials\/comments\/8107#comment-8107\">http:\/\/tr.im\/kPQZ<\/a>. Our post is required reading for new clients: <a href=\"http:\/\/squeejee.com\/blog\/2008\/08\/26\/why-we-bill-by-the-hour.html\">http:\/\/tr.im\/kPRF<\/a>"
100
+ },
101
+ {
102
+ "tweet_id": "1729672046",
103
+ "tweet_from_user_id": 177638,
104
+ "tweet_from_user": "mully",
105
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/51627709\/jim_avatar-2_normal.jpg",
106
+ "tweet_created_at": "2009-05-07 18:38:41",
107
+ "tweet_text": "@SqueejeeInc Build an App, Start a Movement #railsconf Slides are up, video to come <a href=\"http:\/\/squeejee.com\/blog\/2009\/05\/07\/build-an-app-start-a-movement-railsconf-2009\/\">http:\/\/tr.im\/kL6K<\/a> (via @pengwynn) (via @bradleyjoyce)"
108
+ },
109
+ {
110
+ "tweet_id": "1729662334",
111
+ "tweet_from_user_id": 160201,
112
+ "tweet_from_user": "railsconf",
113
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/62792340\/rails_a52025_normal.jpg",
114
+ "tweet_created_at": "2009-05-07 18:37:32",
115
+ "tweet_text": "RT @pengwynn: #railsconf Slides are up, hoping to have video soon <a href=\"http:\/\/squeejee.com\/blog\/2009\/05\/07\/build-an-app-start-a-movement-railsconf-2009\/\">http:\/\/tr.im\/kL6K<\/a>"
116
+ },
117
+ {
118
+ "tweet_id": "1729658718",
119
+ "tweet_from_user_id": 112539,
120
+ "tweet_from_user": "bradleyjoyce",
121
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/152919038\/Photo_1_normal.jpg",
122
+ "tweet_created_at": "2009-05-07 18:37:06",
123
+ "tweet_text": "@SqueejeeInc Build an App, Start a Movement #railsconf Slides are up, hoping to have video soon <a href=\"http:\/\/squeejee.com\/blog\/2009\/05\/07\/build-an-app-start-a-movement-railsconf-2009\/\">http:\/\/tr.im\/kL6K<\/a> (via @pengwynn)"
124
+ },
125
+ {
126
+ "tweet_id": "1729638234",
127
+ "tweet_from_user_id": 9534860,
128
+ "tweet_from_user": "nicholasdr",
129
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/192002034\/mar-09-swine_normal.png",
130
+ "tweet_created_at": "2009-05-07 18:34:39",
131
+ "tweet_text": "RT @pengwynn: #railsconf Slides are up, hoping to have video soon <a href=\"http:\/\/squeejee.com\/blog\/2009\/05\/07\/build-an-app-start-a-movement-railsconf-2009\/\">http:\/\/tr.im\/kL6K<\/a>"
132
+ },
133
+ {
134
+ "tweet_id": "1710246527",
135
+ "tweet_from_user_id": 12419,
136
+ "tweet_from_user": "Silona",
137
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/53171743\/noreyko-owns-this_normal.jpg",
138
+ "tweet_created_at": "2009-05-05 21:32:18",
139
+ "tweet_text": "@pengwynn i am grooving on your website... <a href=\"http:\/\/squeejee.com\/\">http:\/\/squeejee.com\/<\/a> i actually scrolled down!"
140
+ },
141
+ {
142
+ "tweet_id": "1707352546",
143
+ "tweet_from_user_id": 906723,
144
+ "tweet_from_user": "mtmcfarl",
145
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/71498962\/Photo_1_normal.jpg",
146
+ "tweet_created_at": "2009-05-05 16:14:07",
147
+ "tweet_text": "stealth client request..funny read - <a href=\"http:\/\/squeejee.com\/blog\/2008\/07\/11\/stealth-client-request.html\/\">http:\/\/bit.ly\/18YAFi<\/a>"
148
+ },
149
+ {
150
+ "tweet_id": "1647076402",
151
+ "tweet_from_user_id": 3053588,
152
+ "tweet_from_user": "tweetminster",
153
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/67594771\/tweetminsterAvatar_normal.jpg",
154
+ "tweet_created_at": "2009-04-29 07:26:26",
155
+ "tweet_text": "RT @tweetcongress Pardon the dust, we're back! New features outlined on the blog: <a href=\"http:\/\/squeejee.com\/blog\/2009\/04\/28\/tweet-congress-2-0\/\">http:\/\/tr.im\/jXvB<\/a>"
156
+ },
157
+ {
158
+ "tweet_id": "1647070061",
159
+ "tweet_from_user_id": 2909476,
160
+ "tweet_from_user": "AlbertoNardelli",
161
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/69016597\/foto_normal.jpg",
162
+ "tweet_created_at": "2009-04-29 07:24:55",
163
+ "tweet_text": "RT @tweetcongress Pardon the dust, we're back! New features outlined on the blog: <a href=\"http:\/\/squeejee.com\/blog\/2009\/04\/28\/tweet-congress-2-0\/\">http:\/\/tr.im\/jXvB<\/a>"
164
+ },
165
+ {
166
+ "tweet_id": "1644132925",
167
+ "tweet_from_user_id": 1709312,
168
+ "tweet_from_user": "sduskis",
169
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/64318662\/sduskis_normal.jpg",
170
+ "tweet_created_at": "2009-04-29 00:27:34",
171
+ "tweet_text": "<a href=\"http:\/\/tweetcongress.org\/\">http:\/\/tweetcongress.org\/<\/a> - Twitter aggregator that's great for Congress, the public and sponsors (<a href=\"http:\/\/squeejee.com\/\">http:\/\/squeejee.com\/<\/a>) #yam"
172
+ },
173
+ {
174
+ "tweet_id": "1642986802",
175
+ "tweet_from_user_id": 803771,
176
+ "tweet_from_user": "jdirt",
177
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/55995110\/solidity_normal.JPG",
178
+ "tweet_created_at": "2009-04-28 21:39:56",
179
+ "tweet_text": "Pardon the dust, we're back! New features outlined on the blog: <a href=\"http:\/\/squeejee.com\/blog\/2009\/04\/28\/tweet-congress-2-0\/\">http:\/\/tr.im\/jXvB<\/a> (via @tweetcongress)"
180
+ },
181
+ {
182
+ "tweet_id": "1642947056",
183
+ "tweet_from_user_id": 112539,
184
+ "tweet_from_user": "bradleyjoyce",
185
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/152919038\/Photo_1_normal.jpg",
186
+ "tweet_created_at": "2009-04-28 21:35:13",
187
+ "tweet_text": "RT @tweetcongress: Pardon the dust, we're back! New features outlined on the blog: <a href=\"http:\/\/squeejee.com\/blog\/2009\/04\/28\/tweet-congress-2-0\/\">http:\/\/tr.im\/jXvB<\/a>"
188
+ },
189
+ {
190
+ "tweet_id": "1642944013",
191
+ "tweet_from_user_id": 2105907,
192
+ "tweet_from_user": "pecksniffiana",
193
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/62585406\/s694912856_537266_1107_normal.jpg",
194
+ "tweet_created_at": "2009-04-28 21:34:51",
195
+ "tweet_text": "RT @tweetcongress Pardon the dust, we're back! New features outlined on the blog: <a href=\"http:\/\/squeejee.com\/blog\/2009\/04\/28\/tweet-congress-2-0\/\">http:\/\/tr.im\/jXvB<\/a>"
196
+ },
197
+ {
198
+ "tweet_id": "1642929098",
199
+ "tweet_from_user_id": 383935,
200
+ "tweet_from_user": "Curvezilla",
201
+ "tweet_profile_image_url": "http:\/\/s3.amazonaws.com\/twitter_production\/profile_images\/100257719\/sxsw_normal.jpg",
202
+ "tweet_created_at": "2009-04-28 21:33:10",
203
+ "tweet_text": "Pardon the dust, we're back! New features outlined on the blog: <a href=\"http:\/\/squeejee.com\/blog\/2009\/04\/28\/tweet-congress-2-0\/\">http:\/\/tr.im\/jXvB<\/a> (via @tweetcongress)"
204
+ }]
205
+ }
@@ -0,0 +1,20 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class BackTweetsTest < Test::Unit::TestCase
4
+ include Twitterland
5
+
6
+ context "Hitting the BackTweets API" do
7
+ should "return tweets referencing a URL" do
8
+ stub_get 'http://backtweets.com/search.json?q=http%3A%2F%2Fsqueejee.com&key=OU812', 'backtweets.json'
9
+ results = Twitterland::BackTweets.search('http://squeejee.com', 'OU812')
10
+ results.items_per_page.should == 25
11
+ results.start_index.should == 1
12
+ results.total_results.should == 35
13
+ last_tweet = results.tweets.last
14
+ last_tweet.id = 1642929098
15
+ last_tweet.from_user_id = 383935
16
+ last_tweet.from_user = 'Curvezilla'
17
+
18
+ end
19
+ end
20
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: squeejee-twitterland
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wynn Netherland
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-08-11 00:00:00 -07:00
13
+ date: 2009-08-12 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -98,12 +98,14 @@ files:
98
98
  - Rakefile
99
99
  - VERSION.yml
100
100
  - lib/twitterland.rb
101
+ - lib/twitterland/back_tweets.rb
101
102
  - lib/twitterland/follow_cost.rb
102
103
  - lib/twitterland/mrtweet.rb
103
104
  - lib/twitterland/tweet_blocker.rb
104
105
  - lib/twitterland/twinfluence.rb
105
106
  - lib/twitterland/twitter_counter.rb
106
107
  - lib/twitterland/twitter_grader.rb
108
+ - test/fixtures/backtweets.json
107
109
  - test/fixtures/follow_cost.json
108
110
  - test/fixtures/mrtweet_is_user.json
109
111
  - test/fixtures/mrtweet_most_attention_towards.json
@@ -116,6 +118,7 @@ files:
116
118
  - test/fixtures/twitter_counter.json
117
119
  - test/fixtures/twitter_grader.json
118
120
  - test/test_helper.rb
121
+ - test/twitterland/back_tweets_test.rb
119
122
  - test/twitterland/follow_cost_test.rb
120
123
  - test/twitterland/mrtweet_test.rb
121
124
  - test/twitterland/tweet_blocker_test.rb
@@ -150,6 +153,7 @@ specification_version: 3
150
153
  summary: wrappers for various twitter apis
151
154
  test_files:
152
155
  - test/test_helper.rb
156
+ - test/twitterland/back_tweets_test.rb
153
157
  - test/twitterland/follow_cost_test.rb
154
158
  - test/twitterland/mrtweet_test.rb
155
159
  - test/twitterland/tweet_blocker_test.rb