Later pads:
Proposal: http://pad.constantvzw.org/p/Frankenstein_revisited_proposal
Detailed description of workshop, planning & chatbots: http://pad.constantvzw.org/p/Frankenstein_revisited_proposal_detailed
Botlist http://pad.constantvzw.org/public_pad/Frankenstein_revisited_botlist
Public Domain sources & annotations : http://pad.constantvzw.org/p/Frankenstein_PD
Pad for meeting on 25-26 June: http://pad.constantvzw.org/public_pad/Frankenstein_revisited_160625
Pad for meeting on 26-27 May: http://pad.constantvzw.org/public_pad/Frankenstein_revisited_160526
Pad for meeting on 2-3 April: http://pad.constantvzw.org/public_pad/Frankenstein_revisited_160402
Pad for Meeting on 4-5 March: http://pad.constantvzw.org/public_pad/Frankenstein_revisited_160304
For all public pads on Constant: http://etherdump.constantvzw.org
Summary of the Novel By Chapter: http://pad.constantvzw.org/public_pad/frankenstein_summary
Tasks & planning http://pad.constantvzw.org/public_pad/publication_overview
Hovelbot Vitrine : http://pad.constantvzw.org/public_pad/hovelbot_vitrine
HTML Page Frankenstein: http://pad.constantvzw.org/public_pad/html
******************************
Algolit meeting Python & bots
Saturday 30-1-15
with: Catherine, Anja, Anne, Yao, Piero, An, James...
This workshop was first prepared in collaboration with Michael Murtaugh http://automatist.org/ and Anne Laforet http://sakasama.net for the Relearn Summerschool http://relearn.be at Constant Variable in Brussels, August, 2014.
It inspired us later to create The Death of the Authors, 1943 - a chatbotopera for Constant http://publicdomainday.constantvzw.org/#1943
The material was reworked in collaboration with Michael again for the Summerschool of Hackers & Designers in Amsterdam: http://summer.hackersanddesigners.nl/
This sessions re-uses some of the scripts developed by the participants of bot Summerschools. Thanks for that!
Agenda
10-11.15: Introduction Frankenstein / Piero & An
11.30-13:00 Introduction to botnet/IRC & presentation of some existing bots
13-14: Lunch
14-17: Developing bots
17-18: Sharing the work
Piero presentation
http://thiswork.net/frankenstein/
philosophical brainstorm, interest in Frankenstein's brain
what if technology uses itself to find itself
inspect through algorithms
-> 3 Frankensteins: novel, monster, scientist
what is the brain of these 3?
software/language as a symbolic tool -> coding language
*giving names to variables is very 'fleshy', human thing to do
* what if every word in the novel is a function? every word returns a function -> make list of functions?
* what with white spaces? find brain of the novel in missing parts of the novel, not in the words? transformed letters in 0 / whitespaces in 1
-> transformed in ascii/bitart
top of the page: jodi 95 atomic bomb http://wwwwwwwww.jodi.org
Research on fractals in novel:
http://www.eurekalert.org/pub_releases/2016-01/thni-twg012116.php
based on length of sentences -> a practical approach; what does this mean?
create a page on Algolit wiki : http://algolit.constantvzw.org/index.php/Main_Page
What about the subtitle:
'A Modern Prometheus'
Dr is giving gift to modern humanity 19th century
people have difficulties with 'monster', monster has difficulties with its creator
https://en.wikipedia.org/wiki/Frankenstein's_monster
people working for bots
Simple terminal examples: http://wiki.hackersanddesigners.nl/mediawiki/index.php/Terminal
https://pypi.python.org/pypi/irc
## A history of IRC
http://daniel.haxx.se/irchistory.html
## IRC specifications
http://www.irchelp.org/irchelp/rfc/rfc.html
## Preparing
- Install virtual environment - follow step by step
http://docs.python-guide.org/en/latest/dev/virtualenvs/
- sudo apt-get install python-pip
- pip install irc
- http://www.nltk.org/install.html if necessary
## Introduction to botnet
- Pidgin, colloquy, konversation, xchat, etc
we're on irc.freenode.net #algolit
- launch terminal, go into your project folder (not in your venv-folder!):
$ cd Documents/....
- launch virtual environment:
$ source venv/bin/activate
-> you should see something like this:
(venv)ana@anagram:
- do some simple bot tests:
You find set of scripts & texts here: http://algolit.net/scripts/botnet_frankenstein.zip
Open a terminal
$ ls -> lists the folders in environment where you are
## listen to the channel & print messages in terminal
python ircpipebot.py --server irc.freenode.net --channel '#algolit' --nickname your_botname
-> to stop a bot: type in terminal:
Ctrl C
## listen to channel & log chat
python ircpipebot.py --server irc.freenode.net --channel '#algolit' --nickname monk > monk_writes.txt
-> see what goes on in the file, type:
tail -f monk_writes.txt
## adapt the script so that it transforms the messages
The monk goes mad!!!
python ircpipebot.py --server irc.freenode.net --channel '#algolit' --nickname monk | python pass.py > monk_rewrites.txt
--> this overwrites the same file each time you launch the bot
---> if you want to append text to the file:
python ircpipebot.py --server irc.freenode.net --channel '#algolit' --nickname monk | python pass.py >> monk_rewrites.txt
-> split message into date/nick/text
parts = i.split (" ", 2)
print parts
or
date, nick, msg = i.split(" ", 2)
print date
## reads message, rewrites in uppercase and reads the message out using espeak
python ircpipebot.py --server irc.freenode.net --channel '#algolit' --nickname monk | python upper.py > monk_writes_and_reads.txt
-> if you use Mac:
in upper.py: replace 'espeak' with 'say'
## make the bot act!
cat bot | python -u ircpipebot.py --server irc.freenode.net --channel '#algolit' --nickname josephbuys | python -u pass.py > bot
## make the bot react!
cat bot | python -u ircpipebot.py --server irc.freenode.net --channel '#algolit' --nickname fembot | python -u fembot.py > bot
## join connecting parts in bot.sh so that you don't have to retype everything
first create your script in terminal using python
f.ex. python pass.py
then add your script to bashfile bot_example.sh and launch script:
$ bash bot.sh
--> you can also join different python behviours: see bot_example.sh in folder 0_ircpipebot_exercise_with_fifo
## would be the same as joining everything in 1 script (see scripts in folders 1/2/3)
python 1_bot_to_tob.py irc.freenode.net '#algolit' beatrix
## work with text
cat bot | python -u ircpipebot.py --server irc.freenode.net --channel '#algolit' --nickname frankenstein | python -u filter_with_text.py > bot
## install pip on MacOS
there is also for MacOS:
sudo easy_install pip
IDEAS
* Anja:
steps towards frank-nick-mesh bot
> recognize the nickname of the last message
> taking the first 2 letters of the nick
> adding them to the end of the original nickname
> changing the original bots nickname
* Anne :
two ideas : one collaborative, one antisocial
- collaborative : combining different python scripts (by different persons) : each make a script/limb (or different scripts from history, like f.ex. Eliza), and we see if it makes some output aka sense
- antisocial : "killing" (with commands like kick, ban or kill) users who chats with a 'target" (the creator/dr frankenstein) (it could be a bot that's chatty but i think it's better if it's a human) : it could have private message of menace and kicking (perhaps even banning/killing)
About the Year Without Summer : https://en.wikipedia.org/wiki/Year_Without_a_Summer
Workshop in Mad Scientist?
invite people to react on bots - explore public emotional reaction / conversation with bots & humans on Frankenstein
play with different roles of Frankenstein (novel, monster, scientific researcher)
read/write?
new version of the novel at the end?
say that at beginning that there will be a publication / log the chat / print by plotter / printed on paper in the end - do a reading session
Friday 4th March 13h - Saturday 5th 18h
Saturday 2nd April 13h - Sunday 3rd April 18h
Friday 13th May 13h - Saturday 14th May 18h
Friday 10th June 13h - Saturday 11th June 18h
Friday 16th September 13h - Saturday 17th Sept 18h
Budget
* Minimum
Travel 6 people / 2 Amsterdam-3 Brussels-Zurich | 1 France-Zurich
Per diem 70€/day per person - 1260€
Lodging in the villa!
Production: printing costs 950€ (min 100 copies)
* Maximum
Fee workshop 3 days 150€/day = 2700€
Fee workshop 3 days 250€/day = 4500€
An: check date with Roland
Title: Frankenstein revisited|revived?
Proposal: http://pad.constantvzw.org/p/Frankenstein_revisited_proposal
## Some useful commands
____ Launching bots
- Launch a script in terminal
python fembot.py
- Launch script as a bot in IRC-channel
cat bot | python -u ircpipebot.py --server irc.freenode.net --channel '#algolit' --nickname name_bot | python -u your_script.py > bot
--> could be any online service, like: --server irc.freenode.net
- Log activities of chatroom in file
python -u ircpipebot.py --server irc.freenode.net --channel '#algolit' --nickname name_bot > log.txt
- Look at content of file in terminal
tail -f log.txt
____ Advanced bot activity
- Send activities chatbot to another program ( this is called a PIPE)
cat log.txt | python upper.py
join the chat : python ircpipebot.py --server irc.freenode.net --channel '#algolit' --nickname jaraco | python -u filter.py
- Pipe the processed activities back to chat channel
// save this as chatbot.sh
mkfifo bot
cat bot | \
python -u ircpipebot.py --server irc.freenode.net --channel "#botnet" --nickname jaraco | \
python -u filter.py | \
python -u split.py > bot
rm bot
// save this as filter.py
import sys
import os
# infinite loop that keeps reading & responding
while True:
zin = sys.stdin.readline()
if not zin:
break
# do something to xform zin to out
out = zin.strip("\n")
out = out.split(" ", 2)
if out[1] == "spam:":
out = out[-1]
print(out)
// save this as split.py
import sys
import os
# infinite loop that keeps reading & responding
while True:
zin = sys.stdin.readline()
if not zin:
break
out = zin.upper()
sys.stdout.write(out)
os.system("espeak \""+ out.strip() + "\"")