Skip to content

Instantly share code, notes, and snippets.

@gkop
Created October 3, 2012 02:51
Show Gist options
  • Save gkop/3824669 to your computer and use it in GitHub Desktop.
Save gkop/3824669 to your computer and use it in GitHub Desktop.
Etherbot script
require 'etherpad-lite'
require 'piggy_latin'
require 'pry'
require 'pry-nav'
ether = EtherpadLite.connect('http://pad.coshx.com', 'KHoaXT0XuEH2lkXkeAmYry4W3k1emR15')
pad = ether.pad('noisebridge')
i = 0
pig = PigLatin::Translator.new(:dash => false)
while true
text = pad.text
puts i
i += 1
# i suggest simply looking for keywords
# for example -- look for the keyword ALLCAPS, then find the string
# that follows ALLCAPS and make it caps and remove
# the keyword ALLCAPS
# even simpler example -
if result = text.match(/ALLCAPS (.+)\n/)
word = result[1]
new_text = text
# sets the text to new text
pad.text = new_text
end
sleep 2.0
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment