horse 0.0.1 → 0.0.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.
- checksums.yaml +4 -4
- data/lib/horse/funny_tweet.rb +9 -8
- data/lib/horse/pending_tweets.rb +5 -3
- data/lib/horse/previously_made_tweets.rb +6 -4
- data/lib/horse/tweeter.rb +5 -4
- data/lib/horse/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f23c032e4af82f20b4c720dbd0fae9ec264c618
|
4
|
+
data.tar.gz: 28f0e092c18a15dd63f1e46764a4e256e1dc0521
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d173ac864489d3cce3db50320b30879aee23fcd686f7929adf6e0eeb77676005d692733d060bbfc1d9c350a1321624a604d8895a8b7fa74bb3053c77dc0f2f50
|
7
|
+
data.tar.gz: e5913793f559afcc10264f110376a0aede09ea7e5185adc4a06fbdd3aa1b70ef07a25bd091a1321a4aff4b58f54bfca3913e5527cc717344c3474eef94d81b65
|
data/lib/horse/funny_tweet.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
module Horse
|
2
|
-
|
3
|
-
|
1
|
+
module Horse
|
2
|
+
module FunnyTweet
|
3
|
+
def self.next
|
4
|
+
results = Horse::PendingTweets.all
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
6
|
+
previously_made_tweets = Horse::PreviouslyMadeTweets.all
|
7
|
+
if previously_made_tweets.count > 0
|
8
|
+
results = results.reject { |x| previously_made_tweets.include? x }
|
9
|
+
end
|
10
|
+
results.sample
|
8
11
|
end
|
9
|
-
results.sample
|
10
12
|
end
|
11
13
|
end
|
12
|
-
|
data/lib/horse/pending_tweets.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
module Horse
|
2
|
-
|
3
|
-
|
4
|
-
.
|
1
|
+
module Horse
|
2
|
+
module PreviouslyMadeTweets
|
3
|
+
def self.all
|
4
|
+
Twitter.client.user_timeline(Horse.twitter_username)
|
5
|
+
.map { |x| x.text }
|
6
|
+
end
|
5
7
|
end
|
6
8
|
end
|
data/lib/horse/tweeter.rb
CHANGED
data/lib/horse/version.rb
CHANGED