twitter_ebooks 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -7
- data/lib/twitter_ebooks/bot.rb +1 -1
- data/lib/twitter_ebooks/version.rb +1 -1
- data/skeleton/bots.rb +6 -6
- data/twitter_ebooks.gemspec +1 -1
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 206d0e6e7f5fb3962d24ce7d78d392006a290517
|
4
|
+
data.tar.gz: e2c0336864192d5cb7fac79cca8f0147cafc4c12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bc2d3f85787b1522612a8016a2b2cb82d61de225127870d01f8ff27e0bf829f9d117534bfe41e887785e6ff358cfe868377f79d12c2dba2621f0d68d2576362
|
7
|
+
data.tar.gz: 2b93d261698dc973aff5fbfc32da5475de4d25873d9f568a08f53e51e633958d44b697ba1125d911ffae612f73ece27406f832a6312b3c6febb653e44bcbc978
|
data/README.md
CHANGED
@@ -54,34 +54,34 @@ class MyBot < Ebooks::Bot
|
|
54
54
|
scheduler.every '24h' do
|
55
55
|
# Tweet something every 24 hours
|
56
56
|
# See https://github.com/jmettraux/rufus-scheduler
|
57
|
-
#
|
58
|
-
#
|
57
|
+
# tweet("hi")
|
58
|
+
# pictweet("hi", "cuteselfie.jpg")
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
62
|
def on_message(dm)
|
63
63
|
# Reply to a DM
|
64
|
-
#
|
64
|
+
# reply(dm, "secret secrets")
|
65
65
|
end
|
66
66
|
|
67
67
|
def on_follow(user)
|
68
68
|
# Follow a user back
|
69
|
-
#
|
69
|
+
# follow(user.screen_name)
|
70
70
|
end
|
71
71
|
|
72
72
|
def on_mention(tweet)
|
73
73
|
# Reply to a mention
|
74
|
-
#
|
74
|
+
# reply(tweet, meta(tweet).reply_prefix + "oh hullo")
|
75
75
|
end
|
76
76
|
|
77
77
|
def on_timeline(tweet)
|
78
78
|
# Reply to a tweet in the bot's timeline
|
79
|
-
#
|
79
|
+
# reply(tweet, meta(tweet).reply_prefix + "nice tweet")
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
83
|
# Make a MyBot and attach it to an account
|
84
|
-
MyBot.new("
|
84
|
+
MyBot.new("abby_ebooks") do |bot|
|
85
85
|
bot.access_token = "" # Token connecting the app to this account
|
86
86
|
bot.access_token_secret = "" # Secret connecting the app to this account
|
87
87
|
end
|
data/lib/twitter_ebooks/bot.rb
CHANGED
@@ -70,7 +70,7 @@ module Ebooks
|
|
70
70
|
# - The tweet mentions list contains our username
|
71
71
|
# - The tweet is not being retweeted by somebody else
|
72
72
|
# - Or soft-retweeted by somebody else
|
73
|
-
@mentions.map(&:downcase).include?(@bot.username.downcase) && !@tweet.retweeted_status? && !@tweet.text.
|
73
|
+
@mentions.map(&:downcase).include?(@bot.username.downcase) && !@tweet.retweeted_status? && !@tweet.text.match(/([`'‘’"“”]|RT|via|by|from)\s*@/i)
|
74
74
|
end
|
75
75
|
|
76
76
|
# @param bot [Ebooks::Bot]
|
data/skeleton/bots.rb
CHANGED
@@ -22,29 +22,29 @@ class MyBot < Ebooks::Bot
|
|
22
22
|
scheduler.every '24h' do
|
23
23
|
# Tweet something every 24 hours
|
24
24
|
# See https://github.com/jmettraux/rufus-scheduler
|
25
|
-
#
|
26
|
-
#
|
25
|
+
# tweet("hi")
|
26
|
+
# pictweet("hi", "cuteselfie.jpg")
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
def on_message(dm)
|
31
31
|
# Reply to a DM
|
32
|
-
#
|
32
|
+
# reply(dm, "secret secrets")
|
33
33
|
end
|
34
34
|
|
35
35
|
def on_follow(user)
|
36
36
|
# Follow a user back
|
37
|
-
#
|
37
|
+
# follow(user.screen_name)
|
38
38
|
end
|
39
39
|
|
40
40
|
def on_mention(tweet)
|
41
41
|
# Reply to a mention
|
42
|
-
#
|
42
|
+
# reply(tweet, meta(tweet).reply_prefix + "oh hullo")
|
43
43
|
end
|
44
44
|
|
45
45
|
def on_timeline(tweet)
|
46
46
|
# Reply to a tweet in the bot's timeline
|
47
|
-
#
|
47
|
+
# reply(tweet, meta(tweet).reply_prefix + "nice tweet")
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
data/twitter_ebooks.gemspec
CHANGED
@@ -23,7 +23,6 @@ Gem::Specification.new do |gem|
|
|
23
23
|
gem.add_development_dependency 'yard'
|
24
24
|
|
25
25
|
gem.add_runtime_dependency 'twitter', '~> 5.0'
|
26
|
-
gem.add_runtime_dependency 'simple_oauth'
|
27
26
|
gem.add_runtime_dependency 'eventmachine', '~> 1.0.3'
|
28
27
|
gem.add_runtime_dependency 'rufus-scheduler'
|
29
28
|
gem.add_runtime_dependency 'gingerice'
|
@@ -32,4 +31,5 @@ Gem::Specification.new do |gem|
|
|
32
31
|
gem.add_runtime_dependency 'fast-stemmer'
|
33
32
|
gem.add_runtime_dependency 'highscore'
|
34
33
|
gem.add_runtime_dependency 'pry'
|
34
|
+
gem.add_runtime_dependency 'oauth'
|
35
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter_ebooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jaiden Mispy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -108,20 +108,6 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '5.0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: simple_oauth
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :runtime
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
112
|
name: eventmachine
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -234,6 +220,20 @@ dependencies:
|
|
234
220
|
- - ">="
|
235
221
|
- !ruby/object:Gem::Version
|
236
222
|
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: oauth
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :runtime
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
237
237
|
description: Markov chains for all your friends~
|
238
238
|
email:
|
239
239
|
- "^_^@mispy.me"
|