twitter_ebooks_poll 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,22 @@
1
+ $debug = false
2
+
3
+ def log(*args)
4
+ STDERR.print args.map(&:to_s).join(' ') + "\n"
5
+ STDERR.flush
6
+ end
7
+
8
+ module Ebooks
9
+ GEM_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..'))
10
+ DATA_PATH = File.join(GEM_PATH, 'data')
11
+ SKELETON_PATH = File.join(GEM_PATH, 'skeleton')
12
+ TEST_PATH = File.join(GEM_PATH, 'test')
13
+ TEST_CORPUS_PATH = File.join(TEST_PATH, 'corpus/0xabad1dea.tweets')
14
+ INTERIM = :interim
15
+ end
16
+
17
+ require 'twitter_ebooks/nlp'
18
+ require 'twitter_ebooks/archive'
19
+ require 'twitter_ebooks/sync'
20
+ require 'twitter_ebooks/suffix'
21
+ require 'twitter_ebooks/model'
22
+ require 'twitter_ebooks/bot'
data/skeleton/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'http://rubygems.org'
2
+ ruby '{{RUBY_VERSION}}'
3
+
4
+ gem 'twitter_ebooks'
data/skeleton/Procfile ADDED
@@ -0,0 +1 @@
1
+ worker: bundle exec ebooks start
data/skeleton/bots.rb ADDED
@@ -0,0 +1,65 @@
1
+ require 'twitter_ebooks'
2
+
3
+ # This is an example bot definition with event handlers commented out
4
+ # You can define and instantiate as many bots as you like
5
+
6
+ class MyBot < Ebooks::Bot
7
+ # Configuration here applies to all MyBots
8
+ def configure
9
+ # Consumer details come from registering an app at https://dev.twitter.com/
10
+ # Once you have consumer details, use "ebooks auth" for new access tokens
11
+ self.consumer_key = '' # Your app consumer key
12
+ self.consumer_secret = '' # Your app consumer secret
13
+
14
+ # Users to block instead of interacting with
15
+ self.blacklist = ['tnietzschequote']
16
+
17
+ # Range in seconds to randomize delay when bot.delay is called
18
+ self.delay_range = 1..6
19
+ end
20
+
21
+ def on_startup
22
+ scheduler.every '24h' do
23
+ # Tweet something every 24 hours
24
+ # See https://github.com/jmettraux/rufus-scheduler
25
+ # tweet("hi")
26
+ # pictweet("hi", "cuteselfie.jpg")
27
+ end
28
+ end
29
+
30
+ def on_message(dm)
31
+ # Reply to a DM
32
+ # reply(dm, "secret secrets")
33
+ end
34
+
35
+ def on_follow(user)
36
+ # Follow a user back
37
+ # follow(user.screen_name)
38
+ end
39
+
40
+ def on_mention(tweet)
41
+ # Reply to a mention
42
+ # reply(tweet, "oh hullo")
43
+ end
44
+
45
+ def on_timeline(tweet)
46
+ # Reply to a tweet in the bot's timeline
47
+ # reply(tweet, "nice tweet")
48
+ end
49
+
50
+ def on_favorite(user, tweet)
51
+ # Follow user who just favorited bot's tweet
52
+ # follow(user.screen_name)
53
+ end
54
+
55
+ def on_retweet(tweet)
56
+ # Follow user who just retweeted bot's tweet
57
+ # follow(tweet.user.screen_name)
58
+ end
59
+ end
60
+
61
+ # Make a MyBot and attach it to an account
62
+ MyBot.new("{{BOT_NAME}}") do |bot|
63
+ bot.access_token = "" # Token connecting the app to this account
64
+ bot.access_token_secret = "" # Secret connecting the app to this account
65
+ end
File without changes
@@ -0,0 +1 @@
1
+ corpus/
File without changes
File without changes