Github time!

This commit is contained in:
Mispy 2013-11-08 06:02:05 +11:00
commit e87dc5862b
27 changed files with 20178 additions and 0 deletions

1
skeleton/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
corpus/*

1
skeleton/Procfile Normal file
View file

@ -0,0 +1 @@
worker: ruby run.rb start

41
skeleton/bots.rb Normal file
View file

@ -0,0 +1,41 @@
#!/usr/bin/env ruby
require 'twitter_ebooks'
# This is an example bot definition with event handlers commented out
# You can define as many of these as you like; they will run simultaneously
Ebooks::Bot.new("{{BOT_NAME}}") do |bot|
# Consumer details come from registering an app at https://dev.twitter.com/
# OAuth details can be fetched with https://github.com/marcel/twurl
bot.consumer_key = "" # Your app consumer key
bot.consumer_secret = "" # Your app consumer secret
bot.oauth_token = "" # Token connecting the app to this account
bot.oauth_token_secret = "" # Secret connecting the app to this account
bot.on_message do |dm|
# Reply to a DM
# bot.reply(dm, "secret secrets")
end
bot.on_follow do |user|
# Follow a user back
# bot.follow(user[:screen_name])
end
bot.on_mention do |tweet, meta|
# Reply to a mention
# bot.reply(tweet, meta[:reply_prefix] + "oh hullo")
end
bot.on_timeline do |tweet, meta|
# Reply to a tweet in the bot's timeline
# bot.reply(tweet, meta[:reply_prefix] + "nice tweet")
end
bot.scheduler.every '24h' do
# Tweet something every 24 hours
# See https://github.com/jmettraux/rufus-scheduler
# bot.tweet("hi")
end
end

9
skeleton/run.rb Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env ruby
require_relative 'bots'
EM.run do
Ebooks::Bot.all.each do |bot|
bot.start
end
end