Skip to content

Instantly share code, notes, and snippets.

@JonHilton
Created November 1, 2013 14:16
Show Gist options
  • Save JonHilton/7266070 to your computer and use it in GitHub Desktop.
Save JonHilton/7266070 to your computer and use it in GitHub Desktop.
#!/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
no_update
# remove this to get less output when running
verbose
# here's a list of users to ignore
blacklist "medbotqna"
# here's a list of things to exclude from searches
exclude "hi", "spammer", "junk", "http://"
loop do
puts "search for start tweets #{since_id}"
search "medbotqna SGUL finals" do |tweet|
txt = tweet[:text]
if txt =~/001/
reply "#{tweet_user(tweet)} Mrs Jones is a 68 year old life long smoker who has an operation next week.", tweet
sleep 30
reply "#{tweet_user(tweet)} She reports a two week history of increasing productive cough and is keen for her operation to go ahead next week.", tweet
sleep 30
reply "#{tweet_user(tweet)} On examination HR 100 BP 165/105 SatO2 93 Mild added sounds bilaterally.", tweet
sleep 30
reply "#{tweet_user(tweet)} Which of the following is the most appropriate course of action?", tweet
sleep 30
reply "#{tweet_user(tweet)} A) Post-pone the operation B) Prescribe cefuroxime. C)Prescribe doxycycline", tweet
sleep 30
reply "#{tweet_user(tweet)} D) Tell her that she doesn't need Abx E) Take a history & examination For the answer reply with SGUL finals 002", tweet
elsif txt =~/002/
reply "#{tweet_user(tweet)} The answer is C - prescribe doxycycline. This is an infection of low severity and so narrow spectrum Abx should be used.", tweet
sleep 30
end
end
update_config
sleep 60
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment