Skip to content

Instantly share code, notes, and snippets.

@JonHilton
Created November 2, 2013 11:45
Show Gist options
  • Select an option

  • Save JonHilton/7278061 to your computer and use it in GitHub Desktop.

Select an option

Save JonHilton/7278061 to your computer and use it in GitHub Desktop.
Example for SKSH
#!/usr/bin/env ruby
require 'rubygems'
require 'chatterbot/dsl'
#
# this is the script for the twitter bot MedbotQnA
# generated on 2013-10-30 15:11:13 +0000
#
consumer_key '*************'
consumer_secret '*****************'
secret '**************'
token '**************'
# remove this to send out tweets
# remove this to update the db
# remove this to get less output when running
verbose
# here's a list of users to ignore
blacklist ""
# here's a list of things to exclude from searches
exclude "hi", "spammer", "junk", "http://"
loop do
puts "search for start tweets #{since_id}"
# searching for people tweeting and sends a reply
search "I need a cigarette" do |tweet|
reply "@#{tweet_user(tweet)} What would it take for you to give up? Here's some help http://smokefree.nhs.uk/resources/", tweet
# sleep command stops us overloading Twitter and hitting daily user limit
sleep 30
end
# have to update config so we don't tweet people already tweeted
update_config
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment