Sha256: 1f64f163ac1aeb63a0bcda6a73136b4fe0fc73ce2cc835050780125878eb41d5

Contents?: true

Size: 1.21 KB

Versions: 23

Compression:

Stored size: 1.21 KB

Contents

#!/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

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
twitter_ebooks-2.2.6 skeleton/bots.rb
twitter_ebooks-2.2.5 skeleton/bots.rb
twitter_ebooks-2.2.4 skeleton/bots.rb
twitter_ebooks-2.2.3 skeleton/bots.rb
twitter_ebooks-2.2.2 skeleton/bots.rb
twitter_ebooks-2.2.1 skeleton/bots.rb
twitter_ebooks-2.2.0 skeleton/bots.rb
twitter_ebooks-2.1.9 skeleton/bots.rb
twitter_ebooks-2.1.8 skeleton/bots.rb
twitter_ebooks-2.1.7 skeleton/bots.rb
twitter_ebooks-2.1.6 skeleton/bots.rb
twitter_ebooks-2.1.5 skeleton/bots.rb
twitter_ebooks-2.1.4 skeleton/bots.rb
twitter_ebooks-2.1.3 skeleton/bots.rb
twitter_ebooks-2.1.2 skeleton/bots.rb
twitter_ebooks-2.1.1 skeleton/bots.rb
twitter_ebooks-2.1.0 skeleton/bots.rb
twitter_ebooks-2.0.9 skeleton/bots.rb
twitter_ebooks-2.0.8 skeleton/bots.rb
twitter_ebooks-2.0.7 skeleton/bots.rb