Book Image

Learning JavaScript Robotics

By : Kassandra Perch
Book Image

Learning JavaScript Robotics

By: Kassandra Perch

Overview of this book

Table of Contents (16 chapters)
Learning JavaScript Robotics
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Connecting NodeBots to the Web


Bots are really cool on their own—collecting data, outputting that data using colors, text, and even images! We can only do so much when our bots only talk to themselves. However, because of the Node platform that we build our NodeBots on, talking to web services and using Internet data in our projects is really simple. How so? Well, all you have to remember about NodeBots code is the following.

It's just a Node Server!

Implementing data retrieval and third-party APIs in our NodeBots is easy—especially when, thanks to npm, the modules that interface with all our favorite APIs are right at our fingertips.

Anything that you can install on your computer from npm, you can use with your NodeBots. For instance, I have a wearable that pulls colors from tweets—I use Twitter and the color modules from npm to make this happen smoothly!

For our first example, we're going to build a relatively simple bot, hardware-wise. It'll have a button and a temperature sensor. However...