twitter_hashtag 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/twitter_hashtag/formatter.rb +4 -2
- data/lib/twitter_hashtag/tweet.rb +6 -4
- data/lib/twitter_hashtag/version.rb +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
@@ -7,13 +7,15 @@ module TwitterHashtag
|
|
7
7
|
@results = response['results']
|
8
8
|
end
|
9
9
|
|
10
|
+
attr_reader :results
|
11
|
+
|
10
12
|
def format
|
11
|
-
if
|
13
|
+
if results.empty?
|
12
14
|
puts 'None found.'
|
13
15
|
exit 1
|
14
16
|
else
|
15
17
|
puts 'Results:'
|
16
|
-
TwitterHashtag::Tweet.output(
|
18
|
+
TwitterHashtag::Tweet.output(results)
|
17
19
|
end
|
18
20
|
end
|
19
21
|
|
@@ -11,7 +11,9 @@ module TwitterHashtag
|
|
11
11
|
|
12
12
|
def initialize(tweet_hash)
|
13
13
|
@tweet_hash = tweet_hash
|
14
|
-
end
|
14
|
+
end
|
15
|
+
|
16
|
+
attr_reader :tweet_hash
|
15
17
|
|
16
18
|
def output
|
17
19
|
puts [SEPARATOR, user, text, link].join("\n")
|
@@ -20,15 +22,15 @@ module TwitterHashtag
|
|
20
22
|
private
|
21
23
|
|
22
24
|
def user
|
23
|
-
|
25
|
+
tweet_hash['from_user']
|
24
26
|
end
|
25
27
|
|
26
28
|
def text
|
27
|
-
|
29
|
+
tweet_hash['text']
|
28
30
|
end
|
29
31
|
|
30
32
|
def id
|
31
|
-
|
33
|
+
tweet_hash['id_str']
|
32
34
|
end
|
33
35
|
|
34
36
|
def link
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter_hashtag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Justin Ko
|