tweetdump 0.1.2 → 0.1.3
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/VERSION +1 -1
- data/bin/tweetdump +4 -3
- data/lib/tweetdump.rb +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/bin/tweetdump
CHANGED
@@ -20,7 +20,8 @@ module TweetDumpOptions extend OptiFlagSet
|
|
20
20
|
alternate_forms "k"
|
21
21
|
description "Your search query"
|
22
22
|
end
|
23
|
-
optional_flag "
|
23
|
+
optional_flag "logfile" do
|
24
|
+
alternate_forms "log"
|
24
25
|
description "A file to log output to, defaults to /dev/null"
|
25
26
|
end
|
26
27
|
optional_flag "limit" do
|
@@ -34,7 +35,7 @@ t = TweetDump.new
|
|
34
35
|
t.screen_name = ARGV.flags.screen_name
|
35
36
|
t.password = ARGV.flags.password
|
36
37
|
t.keyword = ARGV.flags.keyword
|
37
|
-
t.logfile = ARGV.flags.log || '/dev/null'
|
38
38
|
t.api = ARGV.flags.api
|
39
|
-
t.
|
39
|
+
t.logfile = ARGV.flags.logfile if ARGV.flags.logfile?
|
40
|
+
t.limit = ARGV.flags.limit.to_i if ARGV.flags.limit?
|
40
41
|
t.run!
|
data/lib/tweetdump.rb
CHANGED
@@ -48,7 +48,7 @@ private
|
|
48
48
|
tweet = Hashie::Mash.new(JSON.parse(status))
|
49
49
|
logger.info "Fetched tweet ##{tweet.id} via Streaming API"
|
50
50
|
logger.info "Job Status: #{@count}/#{@limit}"
|
51
|
-
if @count >= @limit
|
51
|
+
if @limit and @count >= @limit
|
52
52
|
logger.info "Limit reached (#{@count} out of #{@limit})"
|
53
53
|
logger.info "Disconnecting from Twitter"
|
54
54
|
return
|
@@ -87,7 +87,7 @@ private
|
|
87
87
|
puts JSON.dump(tweet)
|
88
88
|
logger.info "Fetched tweet ##{tweet.id} via Search API"
|
89
89
|
logger.info "Job Status: #{@count}/#{@limit}"
|
90
|
-
if @count >= @limit
|
90
|
+
if @limit and @count >= @limit
|
91
91
|
logger.info "Limit reached (#{@count} out of #{@limit})"
|
92
92
|
return
|
93
93
|
else
|