Created
October 3, 2012 02:51
-
-
Save gkop/3824669 to your computer and use it in GitHub Desktop.
Etherbot script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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