moomerman-twitter_oauth 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/twitter_oauth/client.rb +1 -0
- data/lib/twitter_oauth/search.rb +16 -0
- metadata +2 -1
data/lib/twitter_oauth/client.rb
CHANGED
@@ -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.
|
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:
|