How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much...

41
How to Make a Twitter Bot in 1 Hour or Less Élika Ortega Cultures, Societies and Global Studies NULab [email protected] @elikaortega

Transcript of How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much...

Page 1: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

HowtoMakeaTwitterBotin1HourorLess

Élika OrtegaCultures,SocietiesandGlobalStudies

[email protected]

@elikaortega

Page 2: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

WhatisaTwitterBot?

• AutomatedTwitteraccount,• Spam,• Propaganda,• SoftwareapplicationthatpostscontenttoTwitter,automaticallyeitheronascheduleorrespondingtospecificconditions,• GenreofElectronicLiterature

Page 3: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Potential

"everyfigureofspeech...andpracticallyeverylinguisticstructure...everyworkofliterature,everywriter’sbodyofwork,everyliterarymovement,nationalliterature...everydatastream...Socialinteractions,conversations,callsandresponses,platform-defined interactions(retweets,favorites,andsoon)areallreadytobecodifiedintoalgorithmsandexploredviabot."

(LeonardoFlores"I❤Bots")

Page 4: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Botsareprocedural

Abot’scontentisautomaticallygeneratedwithouthumanintervention,usingasetofpredeterminedrulesandprocedures.

AllisonParrish“Bots:ADefinitionandSomeHistoricalThreads.”

Page 5: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Botsareuncreative(unoriginal)

Writingthatconcernsitselfwithcategorizing,remixing,andre-enactingpre-existingtextualartifacts.Uncreativewritingisproducednotthrough“inspiration,”butbyapproachinganexistingtextandre-readingit,drawingoutsomethingnewandunexpectedintheprocess.

AllisonParrish“Bots:ADefinitionandSomeHistoricalThreads.”

Page 6: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Botsaredatadriven

Botstodayoperateonmuchmoredataandusemuchmoresophisticatedstatisticaltechniquesthanwereavailableto20th-centurywritersthatusedproceduraltechniques.

Contemporarybotmakers regularlymakeuseoflargecorpora,andinparticularthecorpusofTwitteritself.

AllisonParrish“Bots:ADefinitionandSomeHistoricalThreads.”

Page 7: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Botsaregraffiti

Thecharacteristicofbotsthatdistinguishesthemmostreadilyfromotherkindsofpoetryandartisthattheyareinterventionsinapublicspace.

AllisonParrish“Bots:ADefinitionandSomeHistoricalThreads.”

Page 8: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

TullyHansen's"TaxonomyofTwitterBots"

Page 9: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

WhyTwitterbots?

• Trolls• Tooshorttosayanythingmeaningful• Deformationoflanguage• Currentpoliticalclimate

Page 10: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Authorialresponsibility

Page 11: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

@HaikuD2byJohnBurger

Page 12: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

@pentametron byRanjitBhatnagar

Page 13: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

@TwoHeadlines yDariusKazemi

Page 14: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

@infinitedesserts by@getdizzzy

Page 15: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

@tiny_star_fields bykatierose

Page 16: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

@StudiesBot byMarkSample

Page 17: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

@ClearCongress byZachWhalen

Page 18: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

@everyword byA.Parrish

Page 19: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

@NRA_Tally byMarkSample

Page 20: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

@DroptheIbot byPatrickHogan andJorgeRivas

Page 21: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Dotheymakesense?

• Partofthepointofbotsistomakesense(notjustlinguisticsense)outofwhattheygenerate• Remediatedynamicsofcut-up andexperimentalart• Resistancemightcomefromimpersonating– Twitterbotsunlikemostotherartworksco-existwithusinapublicspace

Page 22: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Let’smakeabot!Inlessthanonehour…

Page 23: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Abot“lives”onaserverbut“works”onTwitter

Page 24: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Ourtools:

• Tracery-- http://www.brightspiral.com/tracery• Texteditor• Corporahttps://github.com/dariusk/corpora/tree/master/data• CheapBotsDoneQuick– http://cheapbotsdonequick.com• Twitteraccountdedicatedtobot

Page 25: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Firstwebuildthebot

Thewemakeittweet

Page 26: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

1.Traceryhttp://www.brightspiral.com/tracery/

• InterfacethatcreatesandstructurestheJSONfile• Traceryhasembeddedthegenerativeenginethatrecombinesthevalues includedineach“symbol”

Page 27: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

1.Traceryhttp://www.brightspiral.com/tracery/

• “origin”isreservedforthebot’sstructure• #___#indicatesrandomizedcontentfromsymbols• Therestisconstant,includingspaces

Page 28: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

JSONfile(JavaScriptObjectNotation)

• human-readabletext• dataobjectsconsistingofattribute–valuepairs• highlystructured(commas,quotationmarks,brackets)

Page 29: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

JSONfile(JavaScriptObjectNotation)

• human-readabletext• dataobjectsconsistingofattribute–valuepairs• highlystructured(commas,quotationmarks,brackets)

Page 30: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Thesamecontent

Page 31: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Differentcombinations

Page 32: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Experimentaddingwordsandbuildingmorecomplexsentences

Traceryisnotaworkspace,onceyouhaveaworkingidea,copythe.json outputandcontinueinyourtexteditor

Usethecorporaavailablehttps://github.com/dariusk/corpora/tree/master/data

Page 33: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Matchpizzatoppingsandkindsofbeers

A #topping#pizzagoesgreatwith#beer#.

Page 34: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Afewusefulmodifiers

Puttheseattheendofsymbolswithadotseparatingthem:

• 's'forplural,• 'ed'forpasttense,• 'capitalize'and'capitalizeAll',• '.a'toadda/aninfront

'animal.s.capitalize'willmakeananimalpluralandcapitalizeit‘pizzatoppings.a’willputa/aninfrontofit

Page 35: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Moreadvancedoptionscanbefoundhere:http://www.crystalcodepalace.com/traceryTut.html

Page 36: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

2.Aworkingidea(proofofconcept)onTracery• OnTracerytogglethetabtoseetheJSONoutput• Copyandpasteittoyourtexteditor(it’llbeeasiertospoterrorsthereandaddmorevalues/data)• Thisisthe“body”ofyourbotandit’sreadytomovetotheserver

Page 37: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

3.DedicatedTwitteraccount

• You’llneedanemail.Irecommendusingonespecificforyourbotlikemynewbot@gmail.com

• You’llneedtosignuptoTwitterwiththataccount,pickahandleandanameforyourbot.

• Verificationmightbeneededtoo

Page 38: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

4.LogintoCheapBotsDoneQuick

• Onceloggedintoyournewbotaccountgotocheapbotsdonequick.com andclickonsigninwithTwitter

Page 39: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

5.“Move”yourbotthere

• Onceloggedin,copypasteyourJSONoutputinthewindow

• Ifsomethingisn’tworking,you’llgetanerrormessageatthebottomindicatingtheline#(thisiseasiertofixonyourtexteditor)

• Ifeverythingisworkingyouonlyneedtosetthefrequencyforyourbottotweet,andclickonTWEET.Don’tforgettosavethechanges.

Page 40: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

Responses

• NewfeaturesinCheapBotsDoneQuickallowyoutosetupresponseswhensomeonetweetsatyourbot

• Itusesthesamegrammar

Page 41: How to Make a Twitter Bot in 1 Hour or Less€¦ · Bots are data driven Bots today operate on much more data and use much more sophisticated statistical techniques than were available

HappyTweeting!