dschn-twitter 0.4.1.1 → 0.4.1.2

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/lib/twitter/base.rb CHANGED
@@ -232,10 +232,10 @@ module Twitter
232
232
  response = parse(response.body)
233
233
  raise RateExceeded if (response/:hash/:error).text =~ /Rate limit exceeded/
234
234
  response
235
- elsif response.code == '400'
236
- raise RateExceeded
237
235
  elsif response.code == '503'
238
236
  raise Unavailable, response.message
237
+ elsif response.code == '400'
238
+ raise RateExceeded, response.message
239
239
  elsif response.code == '401'
240
240
  raise CantConnect, 'Authentication failed. Check your username and password'
241
241
  elsif response.code == '403'
@@ -0,0 +1,83 @@
1
+ module Twitter
2
+ class SearchResult < Hash
3
+
4
+ # Creates an easier to work with hash from
5
+ # one with string-based keys
6
+ def self.new_from_hash(hash)
7
+ new.merge!(hash)
8
+ end
9
+
10
+ def created_at
11
+ self['created_at']
12
+ end
13
+
14
+ def created_at=(val)
15
+ self['created_at'] = val
16
+ end
17
+
18
+ def from_user
19
+ self['from_user']
20
+ end
21
+
22
+ def from_user=(val)
23
+ self['from_user'] = val
24
+ end
25
+
26
+ def from_user_id
27
+ self['from_user_id']
28
+ end
29
+
30
+ def from_user_id=(val)
31
+ self['from_user_id'] = val
32
+ end
33
+
34
+ def id
35
+ self['id']
36
+ end
37
+
38
+ def id=(val)
39
+ self['id'] = val
40
+ end
41
+
42
+ def iso_language_code
43
+ self['iso_language_code']
44
+ end
45
+
46
+ def iso_language_code=(val)
47
+ self['iso_language_code'] = val
48
+ end
49
+
50
+ def profile_image_url
51
+ self['profile_image_url']
52
+ end
53
+
54
+ def profile_image_url=(val)
55
+ self['profile_image_url'] = val
56
+ end
57
+
58
+ def text
59
+ self['text']
60
+ end
61
+
62
+ def text=(val)
63
+ self['text'] = val
64
+ end
65
+
66
+ def to_user
67
+ self['to_user']
68
+ end
69
+
70
+ def to_user=(val)
71
+ self['to_user'] = val
72
+ end
73
+
74
+ def to_user_id
75
+ self['to_user_id']
76
+ end
77
+
78
+ def to_user_id=(val)
79
+ self['to_user_id'] = val
80
+ end
81
+
82
+ end
83
+ end
@@ -0,0 +1,82 @@
1
+ module Twitter
2
+ class SearchResultInfo < Hash
3
+
4
+ # Creates an easier to work with hash from
5
+ # one with string-based keys
6
+ def self.new_from_hash(hash)
7
+ i = new
8
+ i.merge!(hash)
9
+ search_results = []
10
+ i.results.each do |r|
11
+ search_results << SearchResult.new_from_hash(r)
12
+ end
13
+ i.results = search_results
14
+ i
15
+ end
16
+
17
+ def completed_in
18
+ self['completed_in']
19
+ end
20
+
21
+ def completed_in=(val)
22
+ self['completed_in'] = val
23
+ end
24
+
25
+ def max_id
26
+ self['max_id']
27
+ end
28
+
29
+ def max_id=(val)
30
+ self['max_id'] = val
31
+ end
32
+
33
+ def next_page
34
+ self['next_page']
35
+ end
36
+
37
+ def next_page=(val)
38
+ self['next_page'] = val
39
+ end
40
+
41
+ def page
42
+ self['page']
43
+ end
44
+
45
+ def page=(val)
46
+ self['page'] = val
47
+ end
48
+
49
+ def refresh_url
50
+ self['refresh_url']
51
+ end
52
+
53
+ def refresh_url=(val)
54
+ self['refresh_url'] = val
55
+ end
56
+
57
+ def results_per_page
58
+ self['results_per_page']
59
+ end
60
+
61
+ def results_per_page=(val)
62
+ self['results_per_page'] = val
63
+ end
64
+
65
+ def since_id
66
+ self['since_id']
67
+ end
68
+
69
+ def since_id=(val)
70
+ self['since_id'] = val
71
+ end
72
+
73
+ def results
74
+ self['results']
75
+ end
76
+
77
+ def results=(val)
78
+ self['results'] = val
79
+ end
80
+
81
+ end
82
+ end
data/twitter.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{twitter}
5
- s.version = "0.4.1.1"
5
+ s.version = "0.4.1.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["John Nunemaker"]
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.email = %q{nunemaker@gmail.com}
13
13
  s.executables = ["twitter"]
14
14
  s.extra_rdoc_files = ["bin/twitter", "lib/twitter/base.rb", "lib/twitter/cli/config.rb", "lib/twitter/cli/helpers.rb", "lib/twitter/cli/migrations/20080722194500_create_accounts.rb", "lib/twitter/cli/migrations/20080722194508_create_tweets.rb", "lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb", "lib/twitter/cli/migrations/20080722214606_create_configurations.rb", "lib/twitter/cli/models/account.rb", "lib/twitter/cli/models/configuration.rb", "lib/twitter/cli/models/tweet.rb", "lib/twitter/cli.rb", "lib/twitter/direct_message.rb", "lib/twitter/easy_class_maker.rb", "lib/twitter/rate_limit_status.rb", "lib/twitter/search.rb", "lib/twitter/status.rb", "lib/twitter/user.rb", "lib/twitter/version.rb", "lib/twitter.rb", "README"]
15
- s.files = ["bin/twitter", "examples/blocks.rb", "examples/direct_messages.rb", "examples/favorites.rb", "examples/friends_followers.rb", "examples/friendships.rb", "examples/identica_timeline.rb", "examples/location.rb", "examples/posting.rb", "examples/replies.rb", "examples/search.rb", "examples/sent_messages.rb", "examples/timeline.rb", "examples/twitter.rb", "examples/verify_credentials.rb", "History", "lib/twitter/base.rb", "lib/twitter/cli/config.rb", "lib/twitter/cli/helpers.rb", "lib/twitter/cli/migrations/20080722194500_create_accounts.rb", "lib/twitter/cli/migrations/20080722194508_create_tweets.rb", "lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb", "lib/twitter/cli/migrations/20080722214606_create_configurations.rb", "lib/twitter/cli/models/account.rb", "lib/twitter/cli/models/configuration.rb", "lib/twitter/cli/models/tweet.rb", "lib/twitter/cli.rb", "lib/twitter/direct_message.rb", "lib/twitter/easy_class_maker.rb", "lib/twitter/rate_limit_status.rb", "lib/twitter/search.rb", "lib/twitter/status.rb", "lib/twitter/user.rb", "lib/twitter/version.rb", "lib/twitter.rb", "License", "Manifest", "Rakefile", "README", "spec/base_spec.rb", "spec/cli/helper_spec.rb", "spec/direct_message_spec.rb", "spec/fixtures/followers.xml", "spec/fixtures/friends.xml", "spec/fixtures/friends_for.xml", "spec/fixtures/friends_lite.xml", "spec/fixtures/friends_timeline.xml", "spec/fixtures/public_timeline.xml", "spec/fixtures/rate_limit_status.xml", "spec/fixtures/search_results.json", "spec/fixtures/status.xml", "spec/fixtures/user.xml", "spec/fixtures/user_timeline.xml", "spec/search_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "spec/status_spec.rb", "spec/user_spec.rb", "twitter.gemspec", "website/css/common.css", "website/images/terminal_output.png", "website/index.html"]
15
+ s.files = ["bin/twitter", "examples/blocks.rb", "examples/direct_messages.rb", "examples/favorites.rb", "examples/friends_followers.rb", "examples/friendships.rb", "examples/identica_timeline.rb", "examples/location.rb", "examples/posting.rb", "examples/replies.rb", "examples/search.rb", "examples/sent_messages.rb", "examples/timeline.rb", "examples/twitter.rb", "examples/verify_credentials.rb", "History", "lib/twitter/base.rb", "lib/twitter/cli/config.rb", "lib/twitter/cli/helpers.rb", "lib/twitter/cli/migrations/20080722194500_create_accounts.rb", "lib/twitter/cli/migrations/20080722194508_create_tweets.rb", "lib/twitter/cli/migrations/20080722214605_add_account_id_to_tweets.rb", "lib/twitter/cli/migrations/20080722214606_create_configurations.rb", "lib/twitter/cli/models/account.rb", "lib/twitter/cli/models/configuration.rb", "lib/twitter/cli/models/tweet.rb", "lib/twitter/cli.rb", "lib/twitter/direct_message.rb", "lib/twitter/easy_class_maker.rb", "lib/twitter/rate_limit_status.rb", "lib/twitter/search.rb", "lib/twitter/search_result.rb", "lib/twitter/search_result_info.rb", "lib/twitter/status.rb", "lib/twitter/user.rb", "lib/twitter/version.rb", "lib/twitter.rb", "License", "Manifest", "Rakefile", "README", "spec/base_spec.rb", "spec/cli/helper_spec.rb", "spec/direct_message_spec.rb", "spec/fixtures/followers.xml", "spec/fixtures/friends.xml", "spec/fixtures/friends_for.xml", "spec/fixtures/friends_lite.xml", "spec/fixtures/friends_timeline.xml", "spec/fixtures/public_timeline.xml", "spec/fixtures/rate_limit_status.xml", "spec/fixtures/search_results.json", "spec/fixtures/status.xml", "spec/fixtures/user.xml", "spec/fixtures/user_timeline.xml", "spec/search_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "spec/status_spec.rb", "spec/user_spec.rb", "twitter.gemspec", "website/css/common.css", "website/images/terminal_output.png", "website/index.html"]
16
16
  s.has_rdoc = true
17
17
  s.homepage = %q{http://twitter.rubyforge.org}
18
18
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Twitter", "--main", "README"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dschn-twitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1.1
4
+ version: 0.4.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
@@ -108,6 +108,8 @@ files:
108
108
  - lib/twitter/easy_class_maker.rb
109
109
  - lib/twitter/rate_limit_status.rb
110
110
  - lib/twitter/search.rb
111
+ - lib/twitter/search_result.rb
112
+ - lib/twitter/search_result_info.rb
111
113
  - lib/twitter/status.rb
112
114
  - lib/twitter/user.rb
113
115
  - lib/twitter/version.rb