tweetwine 0.4.1 → 0.4.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/CHANGELOG.rdoc +6 -0
- data/Rakefile +22 -23
- data/lib/tweetwine/cli.rb +167 -165
- data/lib/tweetwine/config.rb +3 -2
- data/lib/tweetwine/exceptions.rb +1 -0
- data/lib/tweetwine/version.rb +1 -1
- data/project.rb +16 -16
- data/test/fixture/{config_example.yaml → config_integration.yaml} +0 -0
- data/test/fixture/oauth.rb +11 -11
- data/test/{test_helper.rb → helper.rb} +16 -7
- data/test/{example/authorization_example.rb → integration/authorization_test.rb} +17 -17
- data/test/integration/global_options_test.rb +67 -0
- data/test/integration/helper.rb +70 -0
- data/test/integration/invalid_config_file_test.rb +28 -0
- data/test/integration/search_statuses_test.rb +81 -0
- data/test/integration/show_followers_test.rb +24 -0
- data/test/integration/show_friends_test.rb +24 -0
- data/test/integration/show_home_test.rb +47 -0
- data/test/integration/show_mentions_test.rb +24 -0
- data/test/integration/show_user_test.rb +48 -0
- data/test/integration/update_status_test.rb +199 -0
- data/test/integration/use_http_proxy_test.rb +71 -0
- data/test/{example/user_help_example.rb → integration/user_help_test.rb} +36 -36
- data/test/unit/character_encoding_test.rb +19 -15
- data/test/unit/cli_test.rb +9 -10
- data/test/unit/config_test.rb +73 -71
- data/test/unit/helper.rb +108 -0
- data/test/unit/http_test.rb +39 -39
- data/test/unit/oauth_test.rb +15 -16
- data/test/unit/obfuscate_test.rb +4 -4
- data/test/unit/option_parser_test.rb +12 -12
- data/test/unit/promise_test.rb +10 -10
- data/test/unit/support_test.rb +44 -45
- data/test/unit/tweet_helper.rb +1 -1
- data/test/unit/tweet_test.rb +42 -42
- data/test/unit/twitter_test.rb +300 -303
- data/test/unit/ui_test.rb +310 -312
- data/test/unit/uri_test.rb +7 -7
- data/test/unit/url_shortener_test.rb +77 -79
- data/tweetwine.gemspec +6 -15
- metadata +55 -145
- data/test/example/example_helper.rb +0 -58
- data/test/example/global_options_example.rb +0 -64
- data/test/example/search_statuses_example.rb +0 -76
- data/test/example/show_followers_example.rb +0 -24
- data/test/example/show_friends_example.rb +0 -24
- data/test/example/show_home_example.rb +0 -44
- data/test/example/show_mentions_example.rb +0 -24
- data/test/example/show_user_example.rb +0 -44
- data/test/example/update_status_example.rb +0 -183
- data/test/example/use_http_proxy_example.rb +0 -68
- data/test/unit/unit_helper.rb +0 -111
data/CHANGELOG.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -3,14 +3,15 @@
|
|
3
3
|
require File.expand_path('project', File.dirname(__FILE__))
|
4
4
|
|
5
5
|
require 'rake/clean'
|
6
|
+
require 'shellwords'
|
6
7
|
|
7
8
|
namespace :gem do
|
8
|
-
CLOBBER.include "#{Project.name}-*.gem"
|
9
|
+
CLOBBER.include "#{Project.spec[:name]}-*.gem"
|
9
10
|
|
10
|
-
current_gem = "#{Project.name}-#{Project.version}.gem"
|
11
|
+
current_gem = "#{Project.spec[:name]}-#{Project.spec[:version]}.gem"
|
11
12
|
|
12
13
|
file current_gem do |f|
|
13
|
-
sh %{gem build #{Project.name}.gemspec}
|
14
|
+
sh %{gem build #{Project.spec[:name]}.gemspec}
|
14
15
|
end
|
15
16
|
|
16
17
|
desc "Package the software as a gem"
|
@@ -23,62 +24,60 @@ namespace :gem do
|
|
23
24
|
|
24
25
|
desc "Uninstall the gem"
|
25
26
|
task :uninstall => :clean do
|
26
|
-
sh %{gem uninstall #{Project.name}}
|
27
|
+
sh %{gem uninstall #{Project.spec[:name]}}
|
27
28
|
end
|
28
29
|
end
|
29
30
|
|
30
31
|
namespace :man do
|
31
|
-
CLOBBER.include "#{Project.dirs
|
32
|
+
CLOBBER.include "#{Project.dirs[:man]}/#{Project.spec[:name]}.?", "#{Project.dirs[:man]}/#{Project.spec[:name]}.?.html"
|
32
33
|
|
33
34
|
desc "Build the manual"
|
34
35
|
task :build do
|
35
|
-
sh %{ronn -br5 --manual='#{Project.name.capitalize} Manual' --organization='#{Project.authors.first}' #{Project.dirs
|
36
|
+
sh %{ronn -br5 --manual='#{Project.spec[:name].capitalize} Manual' --organization='#{Project.spec[:authors].first}' #{Project.dirs[:man]}/*.ronn}
|
36
37
|
end
|
37
38
|
|
38
39
|
desc "Show the manual section 7"
|
39
40
|
task :show => :build do
|
40
|
-
sh %{man #{Project.dirs
|
41
|
+
sh %{man #{Project.dirs[:man]}/#{Project.spec[:name]}.7}
|
41
42
|
end
|
42
43
|
end
|
43
44
|
|
44
|
-
CLOBBER.include Project.dirs
|
45
|
+
CLOBBER.include Project.dirs[:rdoc]
|
45
46
|
|
46
47
|
desc "Generate RDoc"
|
47
48
|
task :rdoc do
|
48
|
-
sh %{rdoc --encoding=UTF-8 --line-numbers --title='#{Project.title}' --output=#{Project.dirs
|
49
|
+
sh %{rdoc --encoding=UTF-8 --line-numbers --title='#{Project.extra[:title]}' --output=#{Project.dirs[:rdoc]} *.rdoc LICENSE.txt lib}
|
49
50
|
end
|
50
51
|
|
51
52
|
namespace :test do
|
52
53
|
def create_test_task(type, options = {})
|
53
54
|
base_dir = options[:base_dir]
|
54
|
-
file_glob = options[:file_glob]
|
55
|
+
file_glob = options[:file_glob] || '**/*_test.rb'
|
55
56
|
test_desc = options[:desc] || "Run #{type} tests"
|
56
|
-
includes = ['lib', Project.dirs
|
57
|
+
includes = ['lib', Project.dirs[:test]].map { |dir| "-I #{dir}" }.join(' ')
|
57
58
|
warn_opt = options[:warn] ? '-w' : ''
|
58
59
|
|
59
60
|
desc test_desc
|
60
61
|
task type do
|
61
|
-
file_name_offset =
|
62
|
+
file_name_offset = Project.dirs[:test].size + 1
|
62
63
|
neg_dotrb_suffix = -'.rb'.size - 1
|
63
|
-
tests =
|
64
|
-
map { |file|
|
65
|
-
|
64
|
+
tests = Dir["#{base_dir}/#{file_glob}"].
|
65
|
+
map { |file| file[file_name_offset..neg_dotrb_suffix] }.
|
66
|
+
shelljoin
|
66
67
|
sh %{bundle exec ruby #{warn_opt} #{includes} -e 'ARGV.each { |f| require f }' #{tests}}
|
67
68
|
end
|
68
69
|
end
|
69
70
|
|
70
71
|
create_test_task :unit,
|
71
|
-
:base_dir => "#{Project.dirs
|
72
|
-
:file_glob => '**/*_test.rb',
|
72
|
+
:base_dir => "#{Project.dirs[:test]}/unit",
|
73
73
|
:warn => true
|
74
|
-
|
75
|
-
|
76
|
-
:
|
77
|
-
:desc => 'Run integration/example tests',
|
74
|
+
|
75
|
+
create_test_task :integration,
|
76
|
+
:base_dir => "#{Project.dirs[:test]}/integration",
|
78
77
|
:warn => false
|
79
78
|
|
80
79
|
desc "Run all tests"
|
81
|
-
task :all => [:unit, :
|
80
|
+
task :all => [:unit, :integration]
|
82
81
|
end
|
83
82
|
|
84
83
|
desc "Find code smells"
|
@@ -88,7 +87,7 @@ end
|
|
88
87
|
|
89
88
|
desc "Show parts of the project tagged as incomplete"
|
90
89
|
task :todo do
|
91
|
-
FileList["**/*.*"].egrep
|
90
|
+
FileList["**/*.*"].egrep(/(TODO|FIXME)/)
|
92
91
|
end
|
93
92
|
|
94
93
|
task :default => :"test:all"
|
data/lib/tweetwine/cli.rb
CHANGED
@@ -108,8 +108,10 @@ module Tweetwine
|
|
108
108
|
private
|
109
109
|
|
110
110
|
def init(args, overriding_default_conf = nil)
|
111
|
-
@config, @http, @oauth, @twitter, @
|
111
|
+
@config, @http, @oauth, @twitter, @url_shortener = nil # reset
|
112
|
+
@ui = UI.new # preload with defaults if config init fails
|
112
113
|
@config = read_config(args, overriding_default_conf)
|
114
|
+
@ui = nil # reset, reload lazily with real config
|
113
115
|
end
|
114
116
|
|
115
117
|
def run(args)
|
@@ -137,113 +139,112 @@ module Tweetwine
|
|
137
139
|
options
|
138
140
|
end
|
139
141
|
end
|
140
|
-
end
|
141
142
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
143
|
+
class Command
|
144
|
+
class << self
|
145
|
+
def inherited(child)
|
146
|
+
# Silence warnings about uninitialized variables if a child does not
|
147
|
+
# set its about, name, or usage.
|
148
|
+
child.instance_eval do
|
149
|
+
@about, @name, @usage = nil
|
150
|
+
end
|
149
151
|
end
|
150
|
-
end
|
151
152
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
153
|
+
def about(description = nil)
|
154
|
+
return @about unless description
|
155
|
+
@about = description.chomp
|
156
|
+
end
|
156
157
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
158
|
+
def register(*names)
|
159
|
+
@name = names.first
|
160
|
+
CLI.register_command(self, names)
|
161
|
+
end
|
161
162
|
|
162
|
-
|
163
|
-
|
164
|
-
|
163
|
+
def name
|
164
|
+
@name
|
165
|
+
end
|
165
166
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
167
|
+
# Usage description for the command, use if overriding #parse.
|
168
|
+
def usage(description = nil)
|
169
|
+
return @usage unless description
|
170
|
+
@usage = description
|
171
|
+
end
|
171
172
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
173
|
+
def show_usage(about_cmd = self)
|
174
|
+
about = about_cmd.about
|
175
|
+
name = about_cmd.name
|
176
|
+
usage = about_cmd.usage
|
177
|
+
result = <<-END
|
177
178
|
#{about}
|
178
179
|
|
179
180
|
Usage: #{CLI::EXEC_NAME} #{name} #{usage}
|
180
|
-
|
181
|
-
|
182
|
-
|
181
|
+
END
|
182
|
+
CLI.ui.info result.strip!
|
183
|
+
end
|
183
184
|
|
184
|
-
|
185
|
-
|
186
|
-
|
185
|
+
def abort_with_usage
|
186
|
+
show_usage
|
187
|
+
exit CommandLineError.status_code
|
188
|
+
end
|
187
189
|
end
|
188
|
-
end
|
189
190
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
191
|
+
def initialize(args)
|
192
|
+
parsing_succeeded = parse(args)
|
193
|
+
self.class.abort_with_usage unless parsing_succeeded
|
194
|
+
end
|
194
195
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
196
|
+
# Default behavior, which succeeds always; override for real argument
|
197
|
+
# parsing if the command needs arguments.
|
198
|
+
def parse(args)
|
199
|
+
true
|
200
|
+
end
|
199
201
|
end
|
200
|
-
end
|
201
202
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
203
|
+
class HelpCommand < Command
|
204
|
+
register "help"
|
205
|
+
about "Show help and exit. Try it with <command> argument."
|
206
|
+
usage <<-END
|
206
207
|
[<command>]
|
207
208
|
|
208
209
|
If <command> is given, show specific help about that command. If no
|
209
210
|
<command> is given, show general help.
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
211
|
+
END
|
212
|
+
|
213
|
+
def parse(args)
|
214
|
+
# Did we arrive here via '-h' option? If so, we cannot have
|
215
|
+
# +proposed_command+ because '-h' does not take an argument. Otherwise,
|
216
|
+
# try to read the argument.
|
217
|
+
proposed_command = args.include?('-h') ? nil : args.shift
|
218
|
+
if proposed_command
|
219
|
+
@command = CLI.find_command proposed_command
|
220
|
+
CLI.ui.error "unknown command: #{proposed_command}\n\n" unless @command
|
221
|
+
@command
|
222
|
+
else
|
223
|
+
@command = nil
|
224
|
+
true
|
225
|
+
end
|
224
226
|
end
|
225
|
-
end
|
226
227
|
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
228
|
+
def run
|
229
|
+
if @command
|
230
|
+
show_command_help
|
231
|
+
else
|
232
|
+
show_general_help
|
233
|
+
end
|
232
234
|
end
|
233
|
-
end
|
234
235
|
|
235
|
-
|
236
|
+
private
|
236
237
|
|
237
|
-
|
238
|
-
|
239
|
-
|
238
|
+
def show_command_help
|
239
|
+
self.class.show_usage @command
|
240
|
+
end
|
240
241
|
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
242
|
+
def show_general_help
|
243
|
+
command_descriptions = CLI.commands[:primaries].
|
244
|
+
entries.
|
245
|
+
sort { |a, b| a.first.to_s <=> b.first.to_s }.
|
246
|
+
map { |cmd, klass| [cmd, klass.about] }
|
247
|
+
CLI.ui.info <<-END
|
247
248
|
#{Tweetwine.summary}
|
248
249
|
|
249
250
|
Usage: #{CLI::EXEC_NAME} [global_options...] [<command>] [command_options...]
|
@@ -255,130 +256,131 @@ Usage: #{CLI::EXEC_NAME} [global_options...] [<command>] [command_options...]
|
|
255
256
|
Commands:
|
256
257
|
|
257
258
|
#{command_descriptions.map { |cmd, desc| " %-14s%s" % [cmd, desc] }.join("\n") }
|
258
|
-
|
259
|
+
END
|
260
|
+
end
|
259
261
|
end
|
260
|
-
end
|
261
262
|
|
262
|
-
|
263
|
-
|
264
|
-
|
263
|
+
class HomeCommand < Command
|
264
|
+
register "home", "h"
|
265
|
+
about "Show authenticated user's home timeline (the default command)."
|
265
266
|
|
266
|
-
|
267
|
-
|
267
|
+
def run
|
268
|
+
CLI.twitter.home
|
269
|
+
end
|
268
270
|
end
|
269
|
-
end
|
270
271
|
|
271
|
-
|
272
|
-
|
273
|
-
|
272
|
+
class FollowersCommand < Command
|
273
|
+
register "followers", "fo"
|
274
|
+
about "Show authenticated user's followers and their latest tweets."
|
274
275
|
|
275
|
-
|
276
|
-
|
276
|
+
def run
|
277
|
+
CLI.twitter.followers
|
278
|
+
end
|
277
279
|
end
|
278
|
-
end
|
279
280
|
|
280
|
-
|
281
|
-
|
282
|
-
|
281
|
+
class FriendsCommand < Command
|
282
|
+
register "friends", "fr"
|
283
|
+
about "Show authenticated user's friends and their latest tweets."
|
283
284
|
|
284
|
-
|
285
|
-
|
285
|
+
def run
|
286
|
+
CLI.twitter.friends
|
287
|
+
end
|
286
288
|
end
|
287
|
-
end
|
288
289
|
|
289
|
-
|
290
|
-
|
291
|
-
|
290
|
+
class MentionsCommand < Command
|
291
|
+
register "mentions", "men", "m"
|
292
|
+
about "Show latest tweets that mention or are replies to the authenticated user."
|
292
293
|
|
293
|
-
|
294
|
-
|
294
|
+
def run
|
295
|
+
CLI.twitter.mentions
|
296
|
+
end
|
295
297
|
end
|
296
|
-
end
|
297
298
|
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
299
|
+
class SearchCommand < Command
|
300
|
+
def self.parser
|
301
|
+
@parser ||= OptionParser.new do |parser, options|
|
302
|
+
parser.on '-a', '--and', 'All words match (default).' do
|
303
|
+
options[:operator] = :and
|
304
|
+
end
|
305
|
+
parser.on '-o', '--or', 'Any word matches.' do
|
306
|
+
options[:operator] = :or
|
307
|
+
end
|
306
308
|
end
|
307
309
|
end
|
308
|
-
end
|
309
310
|
|
310
|
-
|
311
|
-
|
312
|
-
|
311
|
+
register "search", "s"
|
312
|
+
about "Search latest public tweets."
|
313
|
+
usage(Promise.new {<<-END
|
313
314
|
[--all | --or] <word>...
|
314
315
|
|
315
316
|
Command options:
|
316
317
|
|
317
318
|
#{parser.help}
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
319
|
+
END
|
320
|
+
})
|
321
|
+
|
322
|
+
def parse(args)
|
323
|
+
options = self.class.parser.parse(args)
|
324
|
+
@operator = options[:operator]
|
325
|
+
@words = args
|
326
|
+
if @words.empty?
|
327
|
+
CLI.ui.error "No search words.\n\n"
|
328
|
+
false
|
329
|
+
else
|
330
|
+
true
|
331
|
+
end
|
330
332
|
end
|
331
|
-
end
|
332
333
|
|
333
|
-
|
334
|
-
|
334
|
+
def run
|
335
|
+
CLI.twitter.search @words, @operator
|
336
|
+
end
|
335
337
|
end
|
336
|
-
end
|
337
338
|
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
339
|
+
class UpdateCommand < Command
|
340
|
+
register "update", "up"
|
341
|
+
about "Send new tweet."
|
342
|
+
usage <<-END
|
342
343
|
[<status>]
|
343
344
|
|
344
345
|
If <status> is not given, read the contents for the tweet from STDIN.
|
345
|
-
|
346
|
+
END
|
346
347
|
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
348
|
+
def parse(args)
|
349
|
+
@msg = args.join(' ')
|
350
|
+
args.clear
|
351
|
+
true
|
352
|
+
end
|
352
353
|
|
353
|
-
|
354
|
-
|
354
|
+
def run
|
355
|
+
CLI.twitter.update @msg
|
356
|
+
end
|
355
357
|
end
|
356
|
-
end
|
357
358
|
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
359
|
+
class UserCommand < Command
|
360
|
+
register "user", "usr"
|
361
|
+
about "Show user's timeline."
|
362
|
+
usage <<-END
|
362
363
|
[<username>]
|
363
364
|
|
364
365
|
If <username> is not given, show authenticated user's timeline.
|
365
|
-
|
366
|
+
END
|
366
367
|
|
367
|
-
|
368
|
-
|
369
|
-
|
368
|
+
def parse(args)
|
369
|
+
@user = args.empty? ? CLI.config[:username] : args.shift
|
370
|
+
end
|
370
371
|
|
371
|
-
|
372
|
-
|
372
|
+
def run
|
373
|
+
CLI.twitter.user(@user)
|
374
|
+
end
|
373
375
|
end
|
374
|
-
end
|
375
376
|
|
376
|
-
|
377
|
-
|
378
|
-
|
377
|
+
class VersionCommand < Command
|
378
|
+
register "version", "ver", "v"
|
379
|
+
about "Show program version and exit."
|
379
380
|
|
380
|
-
|
381
|
-
|
381
|
+
def run
|
382
|
+
CLI.ui.info "tweetwine #{Tweetwine.version}"
|
383
|
+
end
|
382
384
|
end
|
383
385
|
end
|
384
386
|
end
|
data/lib/tweetwine/config.rb
CHANGED
@@ -58,8 +58,9 @@ module Tweetwine
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def self.parse_config_file(config_file)
|
61
|
-
|
62
|
-
|
61
|
+
config = YAML.load_file config_file
|
62
|
+
raise ConfigError, "invalid config file; it must be a mapping style YAML document: #{config_file}" unless config.is_a? Hash
|
63
|
+
Support.symbolize_hash_keys(config)
|
63
64
|
end
|
64
65
|
end
|
65
66
|
end
|
data/lib/tweetwine/exceptions.rb
CHANGED
data/lib/tweetwine/version.rb
CHANGED
data/project.rb
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
|
-
require 'ostruct'
|
4
|
-
|
5
3
|
name = 'tweetwine'
|
6
4
|
$LOAD_PATH.unshift File.expand_path('lib', File.dirname(__FILE__))
|
7
5
|
require "#{name}/version"
|
8
6
|
|
9
|
-
Project =
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
7
|
+
Project = Struct.new('Project', :spec, :dirs, :extra).new(
|
8
|
+
{
|
9
|
+
:name => name,
|
10
|
+
:version => Tweetwine.version.dup,
|
11
|
+
:summary => Tweetwine.summary,
|
12
|
+
:description => '',
|
13
|
+
:email => 'tkareine@gmail.com',
|
14
|
+
:homepage => 'https://github.com/tkareine/tweetwine',
|
15
|
+
:authors => ['Tuomas Kareinen']
|
16
|
+
},
|
17
|
+
{
|
18
18
|
:man => 'man',
|
19
19
|
:rdoc => 'rdoc',
|
20
20
|
:test => 'test'
|
21
|
-
}
|
22
|
-
}
|
21
|
+
},
|
22
|
+
{}
|
23
|
+
)
|
23
24
|
|
24
|
-
Project.description = <<-END
|
25
|
+
Project.spec[:description] = <<-END
|
25
26
|
A simple but tasty Twitter agent for command line use, designed for quickly
|
26
27
|
showing the latest tweets.
|
27
28
|
END
|
28
|
-
Project.title = "#{Project.name} #{Project.version}"
|
29
29
|
|
30
|
-
Project.
|
30
|
+
Project.extra[:title] = "#{Project.spec[:name]} #{Project.spec[:version]}"
|
File without changes
|
data/test/fixture/oauth.rb
CHANGED
@@ -4,17 +4,17 @@ module Tweetwine::Test
|
|
4
4
|
|
5
5
|
module Fixture
|
6
6
|
module OAuth
|
7
|
-
METHOD
|
8
|
-
REQUEST_TOKEN_KEY
|
9
|
-
REQUEST_TOKEN_SECRET
|
10
|
-
REQUEST_TOKEN_RESPONSE
|
11
|
-
REQUEST_TOKEN_URL
|
12
|
-
ACCESS_TOKEN_KEY
|
13
|
-
ACCESS_TOKEN_SECRET
|
14
|
-
ACCESS_TOKEN_RESPONSE
|
15
|
-
ACCESS_TOKEN_URL
|
16
|
-
AUTHORIZE_URL
|
17
|
-
PIN
|
7
|
+
METHOD = :post
|
8
|
+
REQUEST_TOKEN_KEY = 'ManManManManManManManManManManManManManM'
|
9
|
+
REQUEST_TOKEN_SECRET = '3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3x3'
|
10
|
+
REQUEST_TOKEN_RESPONSE = "oauth_token=#{REQUEST_TOKEN_KEY}&oauth_token_secret=#{REQUEST_TOKEN_SECRET}&oauth_callback_confirmed=true"
|
11
|
+
REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token'
|
12
|
+
ACCESS_TOKEN_KEY = '111111111-XyzXyzXyzXyzXyzXyzXyzXyzXyzXyzXyzXyzXyzX'
|
13
|
+
ACCESS_TOKEN_SECRET = '4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x4x'
|
14
|
+
ACCESS_TOKEN_RESPONSE = "oauth_token=#{ACCESS_TOKEN_KEY}&oauth_token_secret=#{ACCESS_TOKEN_SECRET}&user_id=42&screen_name=fooman"
|
15
|
+
ACCESS_TOKEN_URL = 'https://api.twitter.com/oauth/access_token'
|
16
|
+
AUTHORIZE_URL = "https://api.twitter.com/oauth/authorize?oauth_token=#{REQUEST_TOKEN_KEY}"
|
17
|
+
PIN = '12345678'
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|