moomerman-twitter_oauth 0.1.7 → 0.1.8

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.
@@ -1,6 +1,7 @@
1
1
  require 'twitter_oauth/account'
2
2
  require 'twitter_oauth/statuses'
3
3
  require 'twitter_oauth/direct_messages'
4
+ require 'twitter_oauth/search'
4
5
 
5
6
  module TwitterOAuth
6
7
  class Client
@@ -0,0 +1,16 @@
1
+ require 'open-uri'
2
+ require 'ostruct'
3
+
4
+ module TwitterOAuth
5
+ class Client
6
+
7
+ def search(q, page = 1, per_page = 20)
8
+ response = open("http://search.twitter.com/search.json?q=#{q}&page=#{page}&rpp=#{per_page}")
9
+ search_result = JSON.parse(response.read)
10
+ search_result = OpenStruct.new(search_result)
11
+ search_result.results = search_result.results.collect{|x| OpenStruct.new(x)}
12
+ search_result
13
+ end
14
+
15
+ end
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moomerman-twitter_oauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Taylor
@@ -48,6 +48,7 @@ files:
48
48
  - lib/twitter_oauth/account.rb
49
49
  - lib/twitter_oauth/statuses.rb
50
50
  - lib/twitter_oauth/direct_messages.rb
51
+ - lib/twitter_oauth/search.rb
51
52
  has_rdoc: false
52
53
  homepage: http://github.com/moomerman/twitter_oauth
53
54
  post_install_message: