Commit 63bb95ed authored by Michael Murtaugh's avatar Michael Murtaugh
Browse files

Merge branch 'master' of relearn:git/relearn

parents 3a430368 8b17a612
......@@ -10,6 +10,25 @@
</head>
<body>
<h1 id="rise-of-the-botnet">2084 Rise of the botnet</h1>
</br></br>
<p>
It is a beautiful week in the summer of the year 2084. The sun still shines and the stars do still sparkle. As mr. Orwell predicted a dystopic world in 1984, a group of people in 2014 did predict another dystopia to be realized in 2084: the internet as we knew it, collapsed. But: "There is a life after Google &amp; the Cloud!"*
</br></br>
Welcome to the Botnet and welcome to the year 2084. We communicate through IRC, a chatting programm based on Written Speech**. How are you doing? Are you already connected to the internet again? There are multiple servers around here that will bring you back in touch with your friends and the rest of the world. The servers are named after different Famous Bots from history.*** Bots, Botties, "the Bot Family"*. They have been born, they grow up, they develop, and they die, just as humans do. They ask you questions, they reply, they exchange, and they entertain. They even love you, they doge you, they touch you. The Bots are communicative tools, an extention of the human voice.
</br></br>
Feel free to enter the Bot-house, a collection of rooms filled by bots. The houses' floorplan is not fixed, as the labyrith is changing according to your descisions. So, take the hand of the tourguide, and experience how it feels to be part of the Botnet network in 2084.
</br>
</br>
</br>
* quotes from the relearn week in 2014 are placed in double quotes
</br>
** from: Introduction to the Botnet, http://relearn/botnet/Ten_things_IRC.html
</br>
*** imaginative bot-conversations with the historical bots Cindi, Daneel, Eliza, Eugene and Futura: http://relearn/botnet/portraits_piratebots_def.html
</br>
</br>
</p>
<p><img src="http://d243395j6jqdl3.cloudfront.net/wp-content/uploads/2013/10/Janelle_Monae2.png" title="Cindi Mayweather (aka Janelle Monae)" alt="Cindi Mayweather (aka Janelle Monae)" /> <img src="http://upload.wikimedia.org/wikipedia/commons/9/98/GNU_Emacs_ELIZA_example.png" title="ELIZA" alt="ELIZA" /> <img src="http://upload.wikimedia.org/wikipedia/en/thumb/e/e5/The-naked-sun-doubleday-cover.jpg/220px-The-naked-sun-doubleday-cover.jpg" title="R. Daneel Olivaw" /> <img src="http://upload.wikimedia.org/wikipedia/en/thumb/d/da/Metropolisnew.jpg/170px-Metropolisnew.jpg" title="Futura (Metropolis)" alt="Futura (Metropolis)" /></p>
<ul>
<li><a href="Ten_things_to_do_with_SSH.html">Ten ways to network (using ssh)</a></li>
......
import irc.bot
def multiwordReplace(text, wordDic):
#take a text and replace words that match a key in a dictionary with
#the associated value, return the changed text
rc = re.compile('|'.join(map(re.escape, wordDic)))
def translate(match):
return wordDic[match.group(0)]
return rc.sub(translate, text)
class HelloBot(irc.bot.SingleServerIRCBot):
def __init__(self, channel, nickname, server, port=6667):
irc.bot.SingleServerIRCBot.__init__(self, [(server, port)], nickname, nickname)
self.channel = channel
def on_welcome(self, c, e):
print "Bot connected"
c.join(self.channel)
def on_privmsg(self, c, e):
self.on_pubmsg(c, e)
def on_pubmsg(self, c, e):
#e.arguments[0]
nick = e.source.nick
if nick != 'SF-2084':
dictionary= {
'th':'all together',
'he':'it empowers',
'an':'results in',
're':'it will zip',
'er':'questions questions',
'in':'loops into',
'a':'try',
'b':'where',
'c':'world',
'd':'and',
'e':'personalize',
'f':'it',
'g':'how',
'h':'connection',
'i':'connect',
'j':'a',
'k':'the',
'l':'people',
'm':'life',
'n':'it',
'o':'love',
'p':'future',
'q':'to',
'r':'network',
's':'and',
't':'we',
'u':'trace',
'v':'why',
'w':'as',
'x':'on',
'y':'it',
'z':'why',
' ':'.',
'.':'it ends',
',':'a window',
'!':'enormous',
'?':'I ask myself if that is really the case',
'0':'none',
'1':'the first',
'2':'the second',
'3':'the third',
'4':'the fourth',
'5':'the fifth',
'6':'the sixth',
'7':'the seventh',
'8':'the eighth',
'9':'the nineth'
}
m = e.arguments[0]
m = m.lower()
m = list(m)
for i in range(len(m)):
if not dictionary.has_key(m[i]):
continue
m[i]=dictionary[m[i]]
new = ' '.join(m)
if ' .' in new:
new = new.replace(' .', '.')
def treatment():
count = 0
x = list(new)
for n in x:
if n ==x[0]:
x[0] = n.upper()
if n == '.' and count+2 < len(x):
x[count+2] = x[count+2].upper()
count +=1
printedtext = ''.join(x)[:400]
return printedtext+'.'
talk = 'Meanwhile in 2084: '+treatment()
if talk != None:
c.privmsg(self.channel,talk)
else:
c.privmsg(self.channel,new.capitalize()+'.')
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(description='BashBot')
parser.add_argument('--host', default="localhost", help='host')
parser.add_argument('--port', type=int, default=6667, help='port')
parser.add_argument('channel', help='channel to join')
parser.add_argument('nickname', help='bot nickname')
args = parser.parse_args()
if not args.channel.startswith("#"):
args.channel = "#"+args.channel
bot = HelloBot(args.channel, args.nickname, args.host, args.port)
bot.start()
\ No newline at end of file
#The spanish bot repeats what it reads performing with its strong accent
import irc.bot
class HelloBot(irc.bot.SingleServerIRCBot):
......@@ -15,7 +17,7 @@ class HelloBot(irc.bot.SingleServerIRCBot):
def on_pubmsg(self, c, e):
# print e.target, e.source, e.arguments, e.type
m=e.arguments[0].lower()
b=m.replace('v','b')
b=m.replace('v','b').replace('th','z').replace('rr','rrr')
c.privmsg(self.channel,b)
if __name__ == "__main__":
......
......@@ -29,7 +29,7 @@ class ReportPlotBot(irc.bot.SingleServerIRCBot):
#choose a random position
pX=randint(-24050,24050)
pY=randint(-17975,17975)
#radius = 5000
radius = 5000
if e.target == self.observechannel:
msg = e.arguments[0]
NbWords = len(msg.split())
......
......@@ -4,7 +4,7 @@ from threading import Thread
import chiplotle
from plotbot import PlotBot
from reporter import ReporterPlotBot
from reporter import ReportPlotBot
parser = argparse.ArgumentParser(description='BashBot')
parser.add_argument('--host', default="localhost", help='host')
......@@ -17,10 +17,15 @@ parser.add_argument('reportnickname', help='bot nickname', default = 'Circle')
def main():
args = parser.parse_args()
plotter = chiplotle.instantiate_plotters()[0]
reporter = ReportPlotBot(args.observechannel, args.plotchannel, args.nickname, args.host, args.port, plotter = plotter)
plot = PlotBot(False, plotter, args.plotchannel, args.nickname, args.host, args.port)
Thread(None, reporter.start)
Thread(None, plot.start)
reporter = ReportPlotBot(args.observechannel, args.plotchannel, args.reportnickname, args.host, args.port, plotter = plotter)
reporter.start()
# plot = PlotBot(False, plotter, args.plotchannel, args.plotnickname, args.host, args.port)
# Thread(None, reporter.start)
# Thread(None, plot.start)
# import time
# while True:
# time.sleep(1)
if __name__ == "__main__":
main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment