Sha256: b2cec74bf19e3cc3496ef0f58d80ecf063f455a46baf21edef975e617ecc3aaf

Contents?: true

Size: 1.28 KB

Versions: 6

Compression:

Stored size: 1.28 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")
    # bot.pictweet("hi", "cuteselfie.jpg", ":possibly_sensitive => true")
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
twitter_ebooks-2.3.2 skeleton/bots.rb
twitter_ebooks-2.3.1 skeleton/bots.rb
twitter_ebooks-2.3.0 skeleton/bots.rb
twitter_ebooks-2.2.9 skeleton/bots.rb
twitter_ebooks-2.2.8 skeleton/bots.rb
twitter_ebooks-2.2.7 skeleton/bots.rb