Building Twitter Bots in Node -...

27
Building Twitter Bots in Node Philip James @phildini

Transcript of Building Twitter Bots in Node -...

Page 1: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Building Twitter Bots in NodePhilip James@phildini

Page 2: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Who’s this guy?

#nodetweets @phildini

Page 3: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Why should you build twitter bots?

@phildini

do I

#nodetweets

Page 4: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

What does a twitter bot need?

@phildini#nodetweets

• Some bit of code, for posting to twitter • Write access to a twitter account • A way to post responsively, or on a schedule

Page 5: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

What are we going to do?

@phildini#nodetweets

Page 6: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

@phildini#nodetweets

Get a word from the Wordnik API

Mix that word into a tweet

Post that tweet to twitter

Page 7: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Let’s start coding!

@phildini#nodetweets

Page 8: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Let’s start coding!

@phildini#nodetweets

Page 9: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

We need a key!

@phildini#nodetweets

https://www.wordnik.com

Page 10: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

We need a key!

@phildini#nodetweets

http://developer.wordnik.com/

Page 11: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

We need a key!

@phildini#nodetweets

https://www.wordnik.com/users/edit

Page 12: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

We need a key!

@phildini#nodetweets

permissions.js

Page 13: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Let’s start coding!

@phildini#nodetweets

Page 14: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Add some twitter

@phildini#nodetweets

Page 15: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Twitter doesn’t like developers

@phildini#nodetweets

bots

Page 16: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Add some twitter

@phildini#nodetweets

Page 17: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Add some twitter

@phildini#nodetweets

config.js

Page 18: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Add some twitter

@phildini#nodetweets

Page 19: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Add some twitter

@phildini#nodetweets

Page 20: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Make it Run

@phildini#nodetweets

Page 21: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

@phildini#nodetweets

Page 22: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Where do we go from here?

@phildini#nodetweets

Page 23: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Go Forth and Bot!

@phildini#nodetweets

• Some bit of code, for posting to twitter • Write access to a twitter account • A way to post responsively, or on a schedule

Bots need:

Bots are:• Fun • Hopefully straightforward • Art

Page 24: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

The World Needs Your Twitterbot!

@phildini#nodetweets

Page 25: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Credits

@phildini#nodetweets

Erin McKean (@emckean)

Darius Kazemi (@tinysubversions)

Page 26: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

I gave this talk - you can too!

#nodetweets @phildini

Page 27: Building Twitter Bots in Node - events.static.linuxfound.orgevents.static.linuxfound.org/.../events/files/slides/BuildingTwitterBotsInNode.pdfGo Forth and Bot! #nodetweets @phildini

Thanks! Questions?

@phildini#nodetweets