“Like” on Twitter Makes Soap Bubbles Blowed
Contents
Make things
The bubble gun will blow soap bubbles each time your tweet gets like on Twitter.
Materials
- obniz Board
- power supply for obniz
- bubble gun
- soapy water
How to make
Hardware connection
Open the battery case and connect the electrode plate to the obniz Board.
obniz | bubble gun |
---|---|
0 | positive |
1 | negative |
(Please be careful not to apply excessive voltage.)
Connect the obniz to power, and then dip bubble gun in soapy water.
Software
The bubble gun will blow soap bubbles each time your newest tweet gets like on Twitter.
Apply for a Twitter developer account and be approved in order to use Twitter API. Then, get “consumer_key“, “consumer_secret“, “access_token_key” and access_token_secret. Save as “secret.json” as below and put the file at the same directory as the program.
{ "consumer_key" :"YOUR_CONSUMER_KEY", "consumer_secret" :"YOUR_CONSUMER_SECRET", "access_token_key" :"YOUR_ACCESS_TOKEN_KEY", "access_token_secret" :"YOUR_ACCESS_TOKEN_SECRET" }
The program gets the Twitter timeline at this part.
await client.get( "statuses/user_timeline", async (error, tweets, response) => { ... } );
You can get the amount of like of your newest tweet if you write let currentLikeCount = tweets[0].favorite_count;
in this function.
Program
This program is written in node.js. Not runnable on the browser.