jnunemaker-twitter 0.3.1 → 0.3.4
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.txt +14 -0
- data/Manifest.txt +6 -1
- data/README.txt +7 -0
- data/Rakefile +1 -8
- data/config/hoe.rb +4 -2
- data/examples/identica_timeline.rb +7 -0
- data/examples/search.rb +17 -0
- data/lib/twitter.rb +1 -0
- data/lib/twitter/base.rb +28 -19
- data/lib/twitter/cli.rb +31 -12
- data/lib/twitter/cli/helpers.rb +28 -2
- data/lib/twitter/cli/models/account.rb +12 -0
- data/lib/twitter/search.rb +94 -0
- data/lib/twitter/version.rb +1 -1
- data/spec/fixtures/search_results.json +1 -0
- data/spec/search_spec.rb +89 -0
- data/spec/spec_helper.rb +7 -3
- data/tasks/deployment.rake +7 -0
- data/tasks/website.rake +1 -1
- data/twitter.gemspec +37 -8
- data/website/images/terminal_output.png +0 -0
- data/website/index.html +22 -3
- metadata +55 -5
- data/TODO.txt +0 -3
data/History.txt
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
0.3.4 - August 3, 2008
|
2
|
+
* Added search support
|
3
|
+
|
4
|
+
0.3.3 - August 3, 2008
|
5
|
+
* Now has option for host when initializing to support identi.ca (Dustin Sallings)
|
6
|
+
* Twitter changed a bunch of methods to POST only so I updated those to now work
|
7
|
+
|
8
|
+
0.3.2 - July 26, 2008
|
9
|
+
* added the CLI gems as dependencies for now until I separate out the CLI from the API wrapper
|
10
|
+
* cleaner CLI errors for no active account or no accounts at all
|
11
|
+
* remove sets a new active account if there are none
|
12
|
+
* added username and password optional arguments to add
|
13
|
+
* added import attempt on install and on anything that uses #current_account helper
|
14
|
+
|
1
15
|
0.3.1 - July 23, 2008
|
2
16
|
* added open to CLI twitter open jnunemaker would open default browser to http://twitter.com/jnunemaker
|
3
17
|
* added -f to timeline and replies which ignores the since_id and shows all results
|
data/Manifest.txt
CHANGED
@@ -3,7 +3,6 @@ License.txt
|
|
3
3
|
Manifest.txt
|
4
4
|
README.txt
|
5
5
|
Rakefile
|
6
|
-
TODO.txt
|
7
6
|
bin/twitter
|
8
7
|
config/hoe.rb
|
9
8
|
config/requirements.rb
|
@@ -12,8 +11,10 @@ examples/direct_messages.rb
|
|
12
11
|
examples/favorites.rb
|
13
12
|
examples/friends_followers.rb
|
14
13
|
examples/friendships.rb
|
14
|
+
examples/identica_timeline.rb
|
15
15
|
examples/location.rb
|
16
16
|
examples/replies.rb
|
17
|
+
examples/search.rb
|
17
18
|
examples/sent_messages.rb
|
18
19
|
examples/timeline.rb
|
19
20
|
examples/twitter.rb
|
@@ -33,6 +34,7 @@ lib/twitter/cli/models/tweet.rb
|
|
33
34
|
lib/twitter/direct_message.rb
|
34
35
|
lib/twitter/easy_class_maker.rb
|
35
36
|
lib/twitter/rate_limit_status.rb
|
37
|
+
lib/twitter/search.rb
|
36
38
|
lib/twitter/status.rb
|
37
39
|
lib/twitter/user.rb
|
38
40
|
lib/twitter/version.rb
|
@@ -50,9 +52,11 @@ spec/fixtures/friends_lite.xml
|
|
50
52
|
spec/fixtures/friends_timeline.xml
|
51
53
|
spec/fixtures/public_timeline.xml
|
52
54
|
spec/fixtures/rate_limit_status.xml
|
55
|
+
spec/fixtures/search_results.json
|
53
56
|
spec/fixtures/status.xml
|
54
57
|
spec/fixtures/user.xml
|
55
58
|
spec/fixtures/user_timeline.xml
|
59
|
+
spec/search_spec.rb
|
56
60
|
spec/spec.opts
|
57
61
|
spec/spec_helper.rb
|
58
62
|
spec/status_spec.rb
|
@@ -62,4 +66,5 @@ tasks/environment.rake
|
|
62
66
|
tasks/website.rake
|
63
67
|
twitter.gemspec
|
64
68
|
website/css/common.css
|
69
|
+
website/images/terminal_output.png
|
65
70
|
website/index.html
|
data/README.txt
CHANGED
@@ -36,6 +36,13 @@ sudo gem install twitter will work just fine. For command line use, you'll need
|
|
36
36
|
puts u.name, u.status.text
|
37
37
|
puts
|
38
38
|
end
|
39
|
+
|
40
|
+
== Search Examples
|
41
|
+
|
42
|
+
Twitter::Search.new('httparty').each { |r| puts r.inspect }
|
43
|
+
Twitter::Search.new('httparty').from('jnunemaker').each { |r| puts r.inspect }
|
44
|
+
Twitter::Search.new.from('jnunemaker').to('oaknd1').each { |r| puts r.inspect }
|
45
|
+
|
39
46
|
|
40
47
|
== Command Line Use
|
41
48
|
|
data/Rakefile
CHANGED
@@ -1,11 +1,4 @@
|
|
1
1
|
require 'config/requirements'
|
2
2
|
require 'config/hoe' # setup Hoe + all gem configuration
|
3
3
|
|
4
|
-
Dir['tasks/**/*.rake'].each { |rake| load rake }
|
5
|
-
|
6
|
-
task :build_gemspec_filelist do
|
7
|
-
files = File.read(File.join(File.dirname(__FILE__), 'Manifest.txt')).split("\n")
|
8
|
-
puts
|
9
|
-
puts files.inspect
|
10
|
-
puts
|
11
|
-
end
|
4
|
+
Dir['tasks/**/*.rake'].each { |rake| load rake }
|
data/config/hoe.rb
CHANGED
@@ -61,8 +61,10 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
|
61
61
|
# == Optional
|
62
62
|
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
63
63
|
#p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
|
64
|
-
p.extra_deps
|
65
|
-
|
64
|
+
p.extra_deps = [['hpricot', '>= 0.6'], ['activesupport', '>= 2.1'],
|
65
|
+
['main', '>= 2.8.2'], ['highline', '>= 1.4.0'],
|
66
|
+
['activerecord', '>= 2.1'], ['sqlite3-ruby', '>= 1.2.2'],
|
67
|
+
['httparty', '>= 0.1.0']]
|
66
68
|
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
67
69
|
|
68
70
|
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter')
|
3
|
+
config = YAML::load(open(ENV['HOME'] + '/.twitter'))
|
4
|
+
|
5
|
+
identica = Twitter::Base.new(config['email'], config['password'], :api_host => 'identi.ca/api')
|
6
|
+
|
7
|
+
identica.timeline(:public).each { |s| puts s.text, s.user.name, '' }
|
data/examples/search.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'lib', 'twitter')
|
3
|
+
|
4
|
+
Twitter::Search.new('httparty').each { |r| puts r.inspect,'' }
|
5
|
+
|
6
|
+
# search = Twitter::Search.new
|
7
|
+
# search.from('jnunemaker').to('oaknd1').each { |r| puts r.inspect, '' }
|
8
|
+
# pp search.result
|
9
|
+
# search.clear
|
10
|
+
|
11
|
+
# search.from('jnunemaker').to('oaknd1').since(814529437).containing('milk').each { |r| puts r.inspect, '' }
|
12
|
+
# search.clear
|
13
|
+
#
|
14
|
+
# search.geocode('40.757929', '-73.985506', '50mi').containing('holland').each { |r| puts r.inspect, '' }
|
15
|
+
# search.clear
|
16
|
+
|
17
|
+
# pp search.from('jnunemaker').fetch()
|
data/lib/twitter.rb
CHANGED
data/lib/twitter/base.rb
CHANGED
@@ -5,12 +5,15 @@
|
|
5
5
|
# http://groups.google.com/group/twitter-development-talk/web/api-documentation
|
6
6
|
module Twitter
|
7
7
|
class Base
|
8
|
-
# Twitter's url, duh!
|
9
|
-
@@api_url = 'twitter.com'
|
10
|
-
|
11
8
|
# Initializes the configuration for making requests to twitter
|
12
|
-
|
9
|
+
# Twitter example:
|
10
|
+
# Twitter.new('email/username', 'password')
|
11
|
+
#
|
12
|
+
# Identi.ca example:
|
13
|
+
# Twitter.new('email/username', 'password', :api_host => 'identi.ca/api')
|
14
|
+
def initialize(email, password, options={})
|
13
15
|
@config, @config[:email], @config[:password] = {}, email, password
|
16
|
+
@api_host = options.delete(:api_host) || 'twitter.com'
|
14
17
|
end
|
15
18
|
|
16
19
|
# Returns an array of statuses for a timeline; Defaults to your friends timeline.
|
@@ -88,7 +91,7 @@ module Twitter
|
|
88
91
|
|
89
92
|
# Sends a direct message <code>text</code> to <code>user</code>
|
90
93
|
def d(user, text)
|
91
|
-
url = URI.parse("http://#{
|
94
|
+
url = URI.parse("http://#{@api_host}/direct_messages/new.xml")
|
92
95
|
req = Net::HTTP::Post.new(url.path)
|
93
96
|
req.basic_auth(@config[:email], @config[:password])
|
94
97
|
req.set_form_data({'text' => text, 'user' => user})
|
@@ -98,12 +101,12 @@ module Twitter
|
|
98
101
|
|
99
102
|
# Befriends id_or_screenname for the auth user
|
100
103
|
def create_friendship(id_or_screenname)
|
101
|
-
users(request("friendships/create/#{id_or_screenname}.xml", :auth => true)).first
|
104
|
+
users(request("friendships/create/#{id_or_screenname}.xml", :auth => true, :method => :post)).first
|
102
105
|
end
|
103
106
|
|
104
107
|
# Defriends id_or_screenname for the auth user
|
105
108
|
def destroy_friendship(id_or_screenname)
|
106
|
-
users(request("friendships/destroy/#{id_or_screenname}.xml", :auth => true)).first
|
109
|
+
users(request("friendships/destroy/#{id_or_screenname}.xml", :auth => true, :method => :post)).first
|
107
110
|
end
|
108
111
|
|
109
112
|
# Returns true if friendship exists, false if it doesn't.
|
@@ -114,22 +117,22 @@ module Twitter
|
|
114
117
|
|
115
118
|
# Updates your location and returns Twitter::User object
|
116
119
|
def update_location(location)
|
117
|
-
users(request(build_path('account/update_location.xml', {'location' => location}), :auth => true)).first
|
120
|
+
users(request(build_path('account/update_location.xml', {'location' => location}), :auth => true, :method => :post)).first
|
118
121
|
end
|
119
122
|
|
120
123
|
# Updates your deliver device and returns Twitter::User object
|
121
124
|
def update_delivery_device(device)
|
122
|
-
users(request(build_path('account/update_delivery_device.xml', {'device' => device}), :auth => true)).first
|
125
|
+
users(request(build_path('account/update_delivery_device.xml', {'device' => device}), :auth => true, :method => :post)).first
|
123
126
|
end
|
124
127
|
|
125
128
|
# Turns notifications by id_or_screenname on for auth user.
|
126
129
|
def follow(id_or_screenname)
|
127
|
-
users(request("notifications/follow/#{id_or_screenname}.xml", :auth => true)).first
|
130
|
+
users(request("notifications/follow/#{id_or_screenname}.xml", :auth => true, :method => :post)).first
|
128
131
|
end
|
129
132
|
|
130
133
|
# Turns notifications by id_or_screenname off for auth user.
|
131
134
|
def leave(id_or_screenname)
|
132
|
-
users(request("notifications/leave/#{id_or_screenname}.xml", :auth => true)).first
|
135
|
+
users(request("notifications/leave/#{id_or_screenname}.xml", :auth => true, :method => :post)).first
|
133
136
|
end
|
134
137
|
|
135
138
|
# Returns the most recent favorite statuses for the autenticating user
|
@@ -139,29 +142,29 @@ module Twitter
|
|
139
142
|
|
140
143
|
# Favorites the status specified by id for the auth user
|
141
144
|
def create_favorite(id)
|
142
|
-
statuses(request("favorites/create/#{id}.xml", :auth => true)).first
|
145
|
+
statuses(request("favorites/create/#{id}.xml", :auth => true, :method => :post)).first
|
143
146
|
end
|
144
147
|
|
145
148
|
# Un-favorites the status specified by id for the auth user
|
146
149
|
def destroy_favorite(id)
|
147
|
-
statuses(request("favorites/destroy/#{id}.xml", :auth => true)).first
|
150
|
+
statuses(request("favorites/destroy/#{id}.xml", :auth => true, :method => :post)).first
|
148
151
|
end
|
149
152
|
|
150
153
|
# Blocks the user specified by id for the auth user
|
151
154
|
def block(id)
|
152
|
-
users(request("blocks/create/#{id}.xml", :auth => true)).first
|
155
|
+
users(request("blocks/create/#{id}.xml", :auth => true, :method => :post)).first
|
153
156
|
end
|
154
157
|
|
155
158
|
# Unblocks the user specified by id for the auth user
|
156
159
|
def unblock(id)
|
157
|
-
users(request("blocks/destroy/#{id}.xml", :auth => true)).first
|
160
|
+
users(request("blocks/destroy/#{id}.xml", :auth => true, :method => :post)).first
|
158
161
|
end
|
159
162
|
|
160
163
|
# Posts a new update to twitter for auth user.
|
161
164
|
def post(status, options={})
|
162
165
|
form_data = {'status' => status}
|
163
166
|
form_data.merge({'source' => options[:source]}) if options[:source]
|
164
|
-
url = URI.parse("http://#{
|
167
|
+
url = URI.parse("http://#{@api_host}/statuses/update.xml")
|
165
168
|
req = Net::HTTP::Post.new(url.path)
|
166
169
|
req.basic_auth(@config[:email], @config[:password])
|
167
170
|
req.set_form_data(form_data)
|
@@ -200,15 +203,21 @@ module Twitter
|
|
200
203
|
|
201
204
|
# Makes a request to twitter.
|
202
205
|
def request(path, options={})
|
203
|
-
options.reverse_merge!({
|
206
|
+
options.reverse_merge!({
|
207
|
+
:headers => { "User-Agent" => @config[:email] },
|
208
|
+
:method => :get
|
209
|
+
})
|
204
210
|
unless options[:since].blank?
|
205
211
|
since = options[:since].kind_of?(Date) ? options[:since].strftime('%a, %d-%b-%y %T GMT') : options[:since].to_s
|
206
212
|
options[:headers]["If-Modified-Since"] = since
|
207
213
|
end
|
208
214
|
|
215
|
+
uri = URI.parse("http://#{@api_host}")
|
216
|
+
|
209
217
|
begin
|
210
|
-
response = Net::HTTP.start(
|
211
|
-
|
218
|
+
response = Net::HTTP.start(uri.host, 80) do |http|
|
219
|
+
klass = Net::HTTP.const_get options[:method].to_s.downcase.capitalize
|
220
|
+
req = klass.new("#{uri.path}/#{path}", options[:headers])
|
212
221
|
req.basic_auth(@config[:email], @config[:password]) if options[:auth]
|
213
222
|
http.request(req)
|
214
223
|
end
|
data/lib/twitter/cli.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
gem 'main', '>= 2.8.2'
|
3
3
|
gem 'highline', '>= 1.4.0'
|
4
|
-
gem 'activerecord', '>= 2.1
|
4
|
+
gem 'activerecord', '>= 2.1'
|
5
5
|
gem 'sqlite3-ruby', '>= 1.2.2'
|
6
6
|
require 'main'
|
7
7
|
require 'highline/import'
|
@@ -26,6 +26,7 @@ Main {
|
|
26
26
|
description 'Creates the sqlite3 database and runs the migrations.'
|
27
27
|
def run
|
28
28
|
migrate
|
29
|
+
attempt_import
|
29
30
|
say 'Twitter installed.'
|
30
31
|
end
|
31
32
|
end
|
@@ -33,30 +34,48 @@ Main {
|
|
33
34
|
mode 'uninstall' do
|
34
35
|
description 'Removes the sqlite3 database. There is no undo for this.'
|
35
36
|
def run
|
36
|
-
FileUtils.rm(Twitter::CLI::Config[:database])
|
37
|
+
FileUtils.rm(Twitter::CLI::Config[:database]) if File.exists?(Twitter::CLI::Config[:database])
|
37
38
|
say 'Twitter gem uninstalled.'
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|
41
42
|
mode 'add' do
|
42
43
|
description 'Adds a new twitter account to the database. Prompts for username and password.'
|
44
|
+
argument('username', 'u') {
|
45
|
+
optional
|
46
|
+
description 'optional username'
|
47
|
+
}
|
48
|
+
argument('password', 'p') {
|
49
|
+
optional
|
50
|
+
description 'optional password'
|
51
|
+
}
|
52
|
+
|
43
53
|
def run
|
44
54
|
account = Hash.new
|
45
55
|
say "Add New Account:"
|
46
|
-
|
47
|
-
|
48
|
-
|
56
|
+
|
57
|
+
# allows optional username arg
|
58
|
+
if params['username'].given?
|
59
|
+
account[:username] = params['username'].value
|
60
|
+
else
|
61
|
+
account[:username] = ask('Username: ') do |q|
|
62
|
+
q.validate = /\S+/
|
63
|
+
end
|
49
64
|
end
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
65
|
+
|
66
|
+
# allows optional password arg
|
67
|
+
if params['password'].given?
|
68
|
+
account[:password] = params['password'].value
|
69
|
+
else
|
70
|
+
account[:password] = ask("Password (won't be displayed): ") do |q|
|
71
|
+
q.echo = false
|
72
|
+
q.validate = /\S+/
|
73
|
+
end
|
54
74
|
end
|
55
75
|
|
56
76
|
do_work do
|
57
77
|
base(account[:username], account[:password]).verify_credentials
|
58
|
-
|
59
|
-
Account.create(account)
|
78
|
+
Account.add(account)
|
60
79
|
say 'Account added.'
|
61
80
|
end
|
62
81
|
end
|
@@ -86,11 +105,11 @@ Main {
|
|
86
105
|
account = account_id ? Account.find(account_id) : account
|
87
106
|
account_name = account.username
|
88
107
|
account.destroy
|
108
|
+
Account.set_current(Account.first) if Account.new_active_needed?
|
89
109
|
say "#{account_name} has been removed.\n"
|
90
110
|
rescue ActiveRecord::RecordNotFound
|
91
111
|
say "ERROR: Account could not be found. Try again. \n"
|
92
112
|
end
|
93
|
-
|
94
113
|
end
|
95
114
|
end
|
96
115
|
end
|
data/lib/twitter/cli/helpers.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
module Twitter
|
2
2
|
module CLI
|
3
3
|
module Helpers
|
4
|
+
class NoActiveAccount < StandardError; end
|
5
|
+
class NoAccounts < StandardError; end
|
6
|
+
|
4
7
|
def output_tweets(collection, options={})
|
5
8
|
options.reverse_merge!({
|
6
9
|
:cache => false,
|
@@ -31,10 +34,27 @@ module Twitter
|
|
31
34
|
end
|
32
35
|
|
33
36
|
def current_account
|
34
|
-
@current_account ||= Account.active
|
35
|
-
|
37
|
+
@current_account ||= Account.active
|
38
|
+
raise Account.count == 0 ? NoAccounts : NoActiveAccount if @current_account.blank?
|
36
39
|
@current_account
|
37
40
|
end
|
41
|
+
|
42
|
+
def attempt_import(&block)
|
43
|
+
tweet_file = File.join(ENV['HOME'], '.twitter')
|
44
|
+
if File.exists?(tweet_file)
|
45
|
+
say '.twitter file found, attempting import...'
|
46
|
+
config = YAML::load(File.read(tweet_file))
|
47
|
+
if !config['email'].blank? && !config['password'].blank?
|
48
|
+
Account.add(:username => config['email'], :password => config['password'])
|
49
|
+
say 'Account imported'
|
50
|
+
block.call if block_given?
|
51
|
+
true
|
52
|
+
else
|
53
|
+
say "Either your username or password were blank in your .twitter file so I could not import. Use 'twitter add' to add an account."
|
54
|
+
false
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
38
58
|
|
39
59
|
def do_work(&block)
|
40
60
|
connect
|
@@ -46,6 +66,12 @@ module Twitter
|
|
46
66
|
say("Twitter is unavailable right now. Try again later.")
|
47
67
|
rescue Twitter::CantConnect => msg
|
48
68
|
say("Can't connect to twitter because: #{msg}")
|
69
|
+
rescue Twitter::CLI::Helpers::NoActiveAccount
|
70
|
+
say("You have not set an active account. Use 'twitter change' to set one now.")
|
71
|
+
rescue Twitter::CLI::Helpers::NoAccounts
|
72
|
+
unless attempt_import { block.call }
|
73
|
+
say("You have not created any accounts. Use 'twitter add' to create one now.")
|
74
|
+
end
|
49
75
|
end
|
50
76
|
end
|
51
77
|
|
@@ -3,6 +3,14 @@ class Account < ActiveRecord::Base
|
|
3
3
|
|
4
4
|
has_many :tweets, :dependent => :destroy
|
5
5
|
|
6
|
+
def self.add(hash)
|
7
|
+
username = hash.delete(:username)
|
8
|
+
account = find_or_initialize_by_username(username)
|
9
|
+
account.attributes = hash
|
10
|
+
account.save
|
11
|
+
set_current(account) if new_active_needed?
|
12
|
+
end
|
13
|
+
|
6
14
|
def self.active
|
7
15
|
current.first
|
8
16
|
end
|
@@ -14,6 +22,10 @@ class Account < ActiveRecord::Base
|
|
14
22
|
account
|
15
23
|
end
|
16
24
|
|
25
|
+
def self.new_active_needed?
|
26
|
+
self.current.count == 0 && self.count > 0
|
27
|
+
end
|
28
|
+
|
17
29
|
def to_s
|
18
30
|
"#{current? ? '*' : ' '} #{username}"
|
19
31
|
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
gem 'httparty'
|
2
|
+
require 'httparty'
|
3
|
+
|
4
|
+
module Twitter
|
5
|
+
class Search
|
6
|
+
include HTTParty
|
7
|
+
include Enumerable
|
8
|
+
base_uri 'search.twitter.com'
|
9
|
+
|
10
|
+
attr_reader :result, :query
|
11
|
+
|
12
|
+
def initialize(q=nil)
|
13
|
+
clear
|
14
|
+
containing(q) unless q.blank?
|
15
|
+
end
|
16
|
+
|
17
|
+
def from(user)
|
18
|
+
@query[:q] << "from:#{user}"
|
19
|
+
self
|
20
|
+
end
|
21
|
+
|
22
|
+
def to(user)
|
23
|
+
@query[:q] << "to:#{user}"
|
24
|
+
self
|
25
|
+
end
|
26
|
+
|
27
|
+
def referencing(user)
|
28
|
+
@query[:q] << "@#{user}"
|
29
|
+
self
|
30
|
+
end
|
31
|
+
alias :references :referencing
|
32
|
+
alias :ref :referencing
|
33
|
+
|
34
|
+
def containing(word)
|
35
|
+
@query[:q] << "#{word}"
|
36
|
+
self
|
37
|
+
end
|
38
|
+
alias :contains :containing
|
39
|
+
|
40
|
+
# adds filtering based on hash tag ie: #twitter
|
41
|
+
def hashed(tag)
|
42
|
+
@query[:q] << "##{tag}"
|
43
|
+
self
|
44
|
+
end
|
45
|
+
|
46
|
+
# lang must be ISO 639-1 code ie: en, fr, de, ja, etc.
|
47
|
+
#
|
48
|
+
# when I tried en it limited my results a lot and took
|
49
|
+
# out several tweets that were english so i'd avoid
|
50
|
+
# this unless you really want it
|
51
|
+
def lang(lang)
|
52
|
+
@query[:lang] = lang
|
53
|
+
self
|
54
|
+
end
|
55
|
+
|
56
|
+
# Limits the number of results per page
|
57
|
+
def per_page(num)
|
58
|
+
@query[:rpp] = num
|
59
|
+
self
|
60
|
+
end
|
61
|
+
|
62
|
+
# Only searches tweets since a given id.
|
63
|
+
# Recommended to use this when possible.
|
64
|
+
def since(since_id)
|
65
|
+
@query[:since_id] = since_id
|
66
|
+
self
|
67
|
+
end
|
68
|
+
|
69
|
+
# Search tweets by longitude, latitude and a given range.
|
70
|
+
# Ranges like 25km and 50mi work.
|
71
|
+
def geocode(long, lat, range)
|
72
|
+
@query[:geocode] = [long, lat, range].join(',')
|
73
|
+
self
|
74
|
+
end
|
75
|
+
|
76
|
+
# Clears all the query filters to make a new search
|
77
|
+
def clear
|
78
|
+
@query = {}
|
79
|
+
@query[:q] = []
|
80
|
+
self
|
81
|
+
end
|
82
|
+
|
83
|
+
# If you want to get results do something other than iterate over them.
|
84
|
+
def fetch
|
85
|
+
@query[:q] = @query[:q].join(' ')
|
86
|
+
self.class.get('/search.json', {:query => @query})
|
87
|
+
end
|
88
|
+
|
89
|
+
def each
|
90
|
+
@result = fetch()
|
91
|
+
@result['results'].each { |r| yield r }
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
data/lib/twitter/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"max_id"=>876733347, "since_id"=>0, "results"=>[{"text"=>"post using httparty.", "from_user"=>"yuweijun", "to_user_id"=>nil, "id"=>876203197, "iso_language_code"=>"en", "from_user_id"=>1170048, "created_at"=>"Sun, 03 Aug 2008 06:40:42 +0000", "profile_image_url"=>"http://static.twitter.com/images/default_profile_normal.png"}, {"text"=>"HTTParty: Quick Web Service Consumption From Any Ruby Class: HTTParty is a new Ruby library by Joh.. http://tinyurl.com/5cb8e8", "from_user"=>"delicious_prog", "to_user_id"=>nil, "id"=>875881978, "iso_language_code"=>"en", "from_user_id"=>468104, "created_at"=>"Sat, 02 Aug 2008 20:47:02 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/54388004/delicious.42px_normal.gif"}, {"text"=>"[4Rails] HTTParty: Quick Web Service Consumption From Any Ruby Class: HTTParty: Quick Web Serv.. http://tinyurl.com/5uemxj", "from_user"=>"bumperbody", "to_user_id"=>nil, "id"=>875828918, "iso_language_code"=>"en", "from_user_id"=>476491, "created_at"=>"Sat, 02 Aug 2008 19:16:19 +0000", "profile_image_url"=>"http://static.twitter.com/images/default_profile_normal.png"}, {"text"=>"[ruby] HTTParty: Quick Web Service Consumption From Any Ruby Class", "from_user"=>"rubymentary", "to_user_id"=>nil, "id"=>875761343, "iso_language_code"=>"en", "from_user_id"=>474717, "created_at"=>"Sat, 02 Aug 2008 17:26:19 +0000", "profile_image_url"=>"http://static.twitter.com/images/default_profile_normal.png"}, {"text"=>"[ruby: RubyInside] HTTParty: Quick Web Service Consumption From Any Ruby Class http://tinyurl.com/5gryre", "from_user"=>"devfunnel", "to_user_id"=>nil, "id"=>875732752, "iso_language_code"=>"en", "from_user_id"=>465190, "created_at"=>"Sat, 02 Aug 2008 16:44:21 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/53748400/dev-funnel-logo-shiny-50x50_normal.png"}, {"text"=>"using the excellent OpenLibrary API, via HTTParty - i do like it that people have thought i'd want to do this in advance!", "from_user"=>"degsy", "to_user_id"=>nil, "id"=>875690354, "iso_language_code"=>"en", "from_user_id"=>164367, "created_at"=>"Sat, 02 Aug 2008 15:43:58 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/56185617/degsy_normal.jpg"}, {"text"=>"httparty gem rocks", "from_user"=>"shenie", "to_user_id"=>nil, "id"=>874139770, "iso_language_code"=>"en", "from_user_id"=>271831, "created_at"=>"Thu, 31 Jul 2008 22:58:19 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/42362902/Photo_28_normal.jpg"}, {"text"=>"httparty yup. that is what i was missing", "from_user"=>"bryanl", "to_user_id"=>nil, "id"=>873839285, "iso_language_code"=>"en", "from_user_id"=>5167, "created_at"=>"Thu, 31 Jul 2008 17:15:51 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/57603306/Photo_26_normal.jpg"}, {"text"=>"@timhaines thanks for the link to HTTParty, Xero api consumer for contacts (at least the get part) now only takes 18 lines of code.", "from_user"=>"buildmaster", "to_user"=>"timhaines", "to_user_id"=>159881, "id"=>873222820, "iso_language_code"=>"en", "from_user_id"=>26548, "created_at"=>"Thu, 31 Jul 2008 02:29:02 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/51894576/gold_o_normal.jpg"}, {"text"=>"refactoring code from yesterdays example to use HTTParty", "from_user"=>"buildmaster", "to_user_id"=>nil, "id"=>873020059, "iso_language_code"=>"en", "from_user_id"=>26548, "created_at"=>"Wed, 30 Jul 2008 21:55:19 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/51894576/gold_o_normal.jpg"}, {"text"=>"delicious: It's an HTTParty and Everyone Is Invited! // RailsTips.org by John Nunemaker http://tinyurl.com/6774gz", "from_user"=>"top_web", "to_user_id"=>nil, "id"=>872810034, "iso_language_code"=>"en", "from_user_id"=>780201, "created_at"=>"Wed, 30 Jul 2008 17:48:25 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/55853305/web_normal.jpg"}, {"text"=>"d: It's an HTTParty and Everyone Is Invited! // RailsTips.org by John Nunemaker http://tinyurl.com/6774gz", "from_user"=>"top_dedist", "to_user_id"=>nil, "id"=>872809988, "iso_language_code"=>"en", "from_user_id"=>760334, "created_at"=>"Wed, 30 Jul 2008 17:48:20 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/55845227/dedist_normal.jpg"}, {"text"=>"[4Rails] It's an HTTParty and Everyone Is Invited! // RailsTips.org by John Nunemaker: It's an.. http://tinyurl.com/57wjn4", "from_user"=>"bumperbody", "to_user_id"=>nil, "id"=>872549387, "iso_language_code"=>"en", "from_user_id"=>476491, "created_at"=>"Wed, 30 Jul 2008 13:16:57 +0000", "profile_image_url"=>"http://static.twitter.com/images/default_profile_normal.png"}, {"text"=>"New blog post: Sinatra, Passenger, HTTParty: Small, Fast, Now http://ruby.tie-rack.org/?p=70", "from_user"=>"tierack", "to_user_id"=>nil, "id"=>872275405, "iso_language_code"=>"no", "from_user_id"=>98800, "created_at"=>"Wed, 30 Jul 2008 04:55:40 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/52166714/mvb200_normal.jpg"}, {"text"=>"Tonight we're gonna HTTParty like it's 1999! - Time to boogie on down and consume some webservices! http://httparty.rubyforge.org/", "from_user"=>"hunternield", "to_user_id"=>nil, "id"=>872086627, "iso_language_code"=>"en", "from_user_id"=>47386, "created_at"=>"Wed, 30 Jul 2008 00:12:47 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/52133648/Photo_59_normal.jpg"}], "results_per_page"=>15, "next_page"=>"?page=2&max_id=876733347&q=httparty+", "query"=>"httparty ", "page"=>1}
|
data/spec/search_spec.rb
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/spec_helper.rb'
|
2
|
+
|
3
|
+
describe Twitter::Search do
|
4
|
+
before do
|
5
|
+
@search = Twitter::Search.new
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should be able to initialize with a search term" do
|
9
|
+
Twitter::Search.new('httparty').query[:q].should include('httparty')
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should be able to specify from" do
|
13
|
+
@search.from('jnunemaker').query[:q].should include('from:jnunemaker')
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should be able to specify to" do
|
17
|
+
@search.to('jnunemaker').query[:q].should include('to:jnunemaker')
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should be able to specify referencing" do
|
21
|
+
@search.referencing('jnunemaker').query[:q].should include('@jnunemaker')
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should alias references to referencing" do
|
25
|
+
@search.references('jnunemaker').query[:q].should include('@jnunemaker')
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should alias ref to referencing" do
|
29
|
+
@search.ref('jnunemaker').query[:q].should include('@jnunemaker')
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should be able to specify containing" do
|
33
|
+
@search.containing('milk').query[:q].should include('milk')
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should alias contains to containing" do
|
37
|
+
@search.contains('milk').query[:q].should include('milk')
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should be able to specify hashed" do
|
41
|
+
@search.hashed('twitter').query[:q].should include('#twitter')
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should be able to specify the language" do
|
45
|
+
@search.lang('en').query[:lang].should == 'en'
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should be able to specify the number of results per page" do
|
49
|
+
@search.per_page(25).query[:rpp].should == 25
|
50
|
+
end
|
51
|
+
|
52
|
+
it "should be able to specify only returning results greater than an id" do
|
53
|
+
@search.since(1234).query[:since_id].should == 1234
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should be able to specify geo coordinates" do
|
57
|
+
@search.geocode('40.757929', '-73.985506', '25mi').query[:geocode].should == '40.757929,-73.985506,25mi'
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should be able to clear the filters set" do
|
61
|
+
@search.from('jnunemaker').to('oaknd1')
|
62
|
+
@search.clear.query.should == {:q => []}
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should be able to chain methods together" do
|
66
|
+
@search.from('jnunemaker').to('oaknd1').referencing('orderedlist').containing('milk').hashed('twitter').lang('en').per_page(20).since(1234).geocode('40.757929', '-73.985506', '25mi')
|
67
|
+
@search.query[:q].should == ['from:jnunemaker', 'to:oaknd1', '@orderedlist', 'milk', '#twitter']
|
68
|
+
@search.query[:lang].should == 'en'
|
69
|
+
@search.query[:rpp].should == 20
|
70
|
+
@search.query[:since_id].should == 1234
|
71
|
+
@search.query[:geocode].should == '40.757929,-73.985506,25mi'
|
72
|
+
end
|
73
|
+
|
74
|
+
describe "fetching" do
|
75
|
+
before do
|
76
|
+
@response = open(File.dirname(__FILE__) + '/fixtures/friends_timeline.xml').read
|
77
|
+
@search.class.stub!(:get).and_return(@response)
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should return results" do
|
81
|
+
@search.class.should_receive(:get).and_return(@response)
|
82
|
+
@search.from('jnunemaker').fetch().should == @response
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should be able to iterate over results" do
|
87
|
+
@search.respond_to?(:each).should == true
|
88
|
+
end
|
89
|
+
end
|
data/spec/spec_helper.rb
CHANGED
data/tasks/deployment.rake
CHANGED
@@ -31,4 +31,11 @@ namespace :manifest do
|
|
31
31
|
task :refresh do
|
32
32
|
`rake check_manifest | patch -p0 > Manifest.txt`
|
33
33
|
end
|
34
|
+
end
|
35
|
+
|
36
|
+
namespace :files do
|
37
|
+
task :copy do
|
38
|
+
files = File.read(File.join(File.dirname(__FILE__), '..', 'Manifest.txt')).split("\n")
|
39
|
+
%x[echo '#{files.inspect}' | pbcopy]
|
40
|
+
end
|
34
41
|
end
|
data/tasks/website.rake
CHANGED
data/twitter.gemspec
CHANGED
@@ -1,23 +1,52 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{twitter}
|
3
|
-
s.version = "0.3.
|
4
|
-
|
3
|
+
s.version = "0.3.4"
|
4
|
+
|
5
5
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
6
6
|
s.authors = ["John Nunemaker"]
|
7
|
-
s.date = %q{2008-
|
7
|
+
s.date = %q{2008-08-03}
|
8
8
|
s.default_executable = %q{twitter}
|
9
9
|
s.description = %q{a command line interface for twitter, also a library which wraps the twitter api}
|
10
10
|
s.email = %q{nunemaker@gmail.com}
|
11
11
|
s.executables = ["twitter"]
|
12
12
|
s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "README.txt"]
|
13
|
-
s.files = ["History.txt", "License.txt", "Manifest.txt", "README.txt", "Rakefile", "
|
13
|
+
s.files = ["History.txt", "License.txt", "Manifest.txt", "README.txt", "Rakefile", "bin/twitter", "config/hoe.rb", "config/requirements.rb", "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/replies.rb", "examples/search.rb", "examples/sent_messages.rb", "examples/timeline.rb", "examples/twitter.rb", "examples/verify_credentials.rb", "lib/twitter.rb", "lib/twitter/base.rb", "lib/twitter/cli.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/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", "script/destroy", "script/generate", "script/txt2html", "setup.rb", "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", "tasks/deployment.rake", "tasks/environment.rake", "tasks/website.rake", "twitter.gemspec", "website/css/common.css", "website/images/terminal_output.png", "website/index.html"]
|
14
14
|
s.has_rdoc = true
|
15
15
|
s.homepage = %q{http://twitter.rubyforge.org}
|
16
16
|
s.rdoc_options = ["--main", "README.txt"]
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
s.rubyforge_project = %q{twitter}
|
19
|
-
s.rubygems_version = %q{1.
|
19
|
+
s.rubygems_version = %q{1.2.0}
|
20
20
|
s.summary = %q{a command line interface for twitter, also a library which wraps the twitter api}
|
21
|
-
|
22
|
-
s.
|
23
|
-
|
21
|
+
|
22
|
+
if s.respond_to? :specification_version then
|
23
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
24
|
+
s.specification_version = 2
|
25
|
+
|
26
|
+
if current_version >= 3 then
|
27
|
+
s.add_runtime_dependency(%q<hpricot>, [">= 0.6"])
|
28
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 2.1"])
|
29
|
+
s.add_runtime_dependency(%q<main>, [">= 2.8.2"])
|
30
|
+
s.add_runtime_dependency(%q<highline>, [">= 1.4.0"])
|
31
|
+
s.add_runtime_dependency(%q<activerecord>, [">= 2.1"])
|
32
|
+
s.add_runtime_dependency(%q<sqlite3-ruby>, [">= 1.2.2"])
|
33
|
+
s.add_runtime_dependency(%q<httparty>, [">= 0.1.0"])
|
34
|
+
else
|
35
|
+
s.add_dependency(%q<hpricot>, [">= 0.6"])
|
36
|
+
s.add_dependency(%q<activesupport>, [">= 2.1"])
|
37
|
+
s.add_dependency(%q<main>, [">= 2.8.2"])
|
38
|
+
s.add_dependency(%q<highline>, [">= 1.4.0"])
|
39
|
+
s.add_dependency(%q<activerecord>, [">= 2.1"])
|
40
|
+
s.add_dependency(%q<sqlite3-ruby>, [">= 1.2.2"])
|
41
|
+
s.add_dependency(%q<httparty>, [">= 0.1.0"])
|
42
|
+
end
|
43
|
+
else
|
44
|
+
s.add_dependency(%q<hpricot>, [">= 0.6"])
|
45
|
+
s.add_dependency(%q<activesupport>, [">= 2.1"])
|
46
|
+
s.add_dependency(%q<main>, [">= 2.8.2"])
|
47
|
+
s.add_dependency(%q<highline>, [">= 1.4.0"])
|
48
|
+
s.add_dependency(%q<activerecord>, [">= 2.1"])
|
49
|
+
s.add_dependency(%q<sqlite3-ruby>, [">= 1.2.2"])
|
50
|
+
s.add_dependency(%q<httparty>, [">= 0.1.0"])
|
51
|
+
end
|
52
|
+
end
|
Binary file
|
data/website/index.html
CHANGED
@@ -10,11 +10,12 @@
|
|
10
10
|
<div id="wrapper">
|
11
11
|
<div id="header">
|
12
12
|
<h1>Twitter</h1>
|
13
|
-
<p>command line
|
13
|
+
<p>command line tweets and an api wrapper</p>
|
14
14
|
|
15
15
|
<ul id="nav">
|
16
16
|
<li><a href="rdoc/">Docs</a></li>
|
17
17
|
<li><a href="http://github.com/jnunemaker/twitter">Github</a></li>
|
18
|
+
<li><a href="http://jnunemaker.lighthouseapp.com/projects/14843-twitter-gem/overview">Lighthouse</a></li>
|
18
19
|
<li><a href="http://rubyforge.org/projects/twitter/">Rubyforge</a></li>
|
19
20
|
</ul>
|
20
21
|
</div>
|
@@ -67,7 +68,25 @@ twit.followers.each do |u|
|
|
67
68
|
end
|
68
69
|
</code></pre>
|
69
70
|
|
70
|
-
<h2>
|
71
|
+
<h2>Search API Examples</h2>
|
72
|
+
|
73
|
+
<pre><code>#searches all tweets for httparty
|
74
|
+
Twitter::Search.new('httparty').each { |r| puts r.inspect }
|
75
|
+
|
76
|
+
# searches all of jnunemaker's tweets for httparty
|
77
|
+
Twitter::Search.new('httparty').from('jnunemaker').each { |r| puts r.inspect }
|
78
|
+
|
79
|
+
# searches all tweets from jnunemaker to oaknd1
|
80
|
+
Twitter::Search.new.from('jnunemaker').to('oaknd1').each { |r| puts r.inspect }
|
81
|
+
|
82
|
+
# you can also use fetch to actually just get the parsed response
|
83
|
+
Twitter::Search.new.from('jnunemaker').to('oaknd1').fetch()
|
84
|
+
</code></pre>
|
85
|
+
|
86
|
+
<h2>Command Line</h2>
|
87
|
+
|
88
|
+
<p><img src="images/terminal_output.png" alt="Terminal Output" style="width:560px;" /></p>
|
89
|
+
|
71
90
|
<p>The first thing you'll want to do is install the database so your account(s) can be stored.</p>
|
72
91
|
|
73
92
|
<pre><code>$ twitter install</code></pre>
|
@@ -105,7 +124,7 @@ Account List
|
|
105
124
|
|
106
125
|
|
107
126
|
<h2>Support</h2>
|
108
|
-
<p>
|
127
|
+
<p>Conversations welcome in the <a href="http://groups.google.com/group/ruby-twitter-gem">google group</a> and bugs/features over at <a href="http://jnunemaker.lighthouseapp.com/projects/14843-twitter-gem/overview">lighthouse</a></p>
|
109
128
|
|
110
129
|
<h2>Uses</h2>
|
111
130
|
<ul>
|
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.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-08-03 00:00:00 -07:00
|
13
13
|
default_executable: twitter
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: "0"
|
22
|
+
version: "0.6"
|
23
23
|
version:
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
25
|
name: activesupport
|
@@ -28,7 +28,52 @@ dependencies:
|
|
28
28
|
requirements:
|
29
29
|
- - ">="
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
version: "
|
31
|
+
version: "2.1"
|
32
|
+
version:
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: main
|
35
|
+
version_requirement:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.8.2
|
41
|
+
version:
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: highline
|
44
|
+
version_requirement:
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 1.4.0
|
50
|
+
version:
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: activerecord
|
53
|
+
version_requirement:
|
54
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: "2.1"
|
59
|
+
version:
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: sqlite3-ruby
|
62
|
+
version_requirement:
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 1.2.2
|
68
|
+
version:
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: httparty
|
71
|
+
version_requirement:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 0.1.0
|
32
77
|
version:
|
33
78
|
description: a command line interface for twitter, also a library which wraps the twitter api
|
34
79
|
email: nunemaker@gmail.com
|
@@ -47,7 +92,6 @@ files:
|
|
47
92
|
- Manifest.txt
|
48
93
|
- README.txt
|
49
94
|
- Rakefile
|
50
|
-
- TODO.txt
|
51
95
|
- bin/twitter
|
52
96
|
- config/hoe.rb
|
53
97
|
- config/requirements.rb
|
@@ -56,8 +100,10 @@ files:
|
|
56
100
|
- examples/favorites.rb
|
57
101
|
- examples/friends_followers.rb
|
58
102
|
- examples/friendships.rb
|
103
|
+
- examples/identica_timeline.rb
|
59
104
|
- examples/location.rb
|
60
105
|
- examples/replies.rb
|
106
|
+
- examples/search.rb
|
61
107
|
- examples/sent_messages.rb
|
62
108
|
- examples/timeline.rb
|
63
109
|
- examples/twitter.rb
|
@@ -77,6 +123,7 @@ files:
|
|
77
123
|
- lib/twitter/direct_message.rb
|
78
124
|
- lib/twitter/easy_class_maker.rb
|
79
125
|
- lib/twitter/rate_limit_status.rb
|
126
|
+
- lib/twitter/search.rb
|
80
127
|
- lib/twitter/status.rb
|
81
128
|
- lib/twitter/user.rb
|
82
129
|
- lib/twitter/version.rb
|
@@ -94,9 +141,11 @@ files:
|
|
94
141
|
- spec/fixtures/friends_timeline.xml
|
95
142
|
- spec/fixtures/public_timeline.xml
|
96
143
|
- spec/fixtures/rate_limit_status.xml
|
144
|
+
- spec/fixtures/search_results.json
|
97
145
|
- spec/fixtures/status.xml
|
98
146
|
- spec/fixtures/user.xml
|
99
147
|
- spec/fixtures/user_timeline.xml
|
148
|
+
- spec/search_spec.rb
|
100
149
|
- spec/spec.opts
|
101
150
|
- spec/spec_helper.rb
|
102
151
|
- spec/status_spec.rb
|
@@ -106,6 +155,7 @@ files:
|
|
106
155
|
- tasks/website.rake
|
107
156
|
- twitter.gemspec
|
108
157
|
- website/css/common.css
|
158
|
+
- website/images/terminal_output.png
|
109
159
|
- website/index.html
|
110
160
|
has_rdoc: true
|
111
161
|
homepage: http://twitter.rubyforge.org
|
data/TODO.txt
DELETED
@@ -1,3 +0,0 @@
|
|
1
|
-
* format the tweets in a more readable fashion (limit words per line so more scannable)
|
2
|
-
* add timeout so it doesn't hang forever like it does now if twitter is down
|
3
|
-
* add progress indicator for timeline and replies as posting has for more visual indication that work is happening
|