It's time to pull this all together and wrap it up. Now, that you have your Twitter developer app ready from Part 4, you just need to make your Twitter app "Read and Write" enabled and then copy over the secret app information to the TurkeyTwitter.java source code (fill in variables near the top of the file) which I included a pointer to the entire compilable source file. See: file
To make your Twitter app "Read and Write enabled:
1. Go to your Twitter app account by signing
Download the TurkeyTweeter.java app from: https://java.net/projects/orbit/downloads/download/TurkeyTweeter.java
After you entered your Twitter app secret information, adjust the source code timePeriod for how often you want your TurkeyTweeter to send update message (default is every 120 seconds), then compile the Java source file with javac and test this way:
You should see a test "Hello World!" tweet get posted to your Turkey Tweeter account from Part 4. Here is my Turkey Tweeter account that I'll be using which you can follow along as my turkey tweets: https://twitter.com/iottweet
Here's the code from the TurkeyTweeter.java app that sends the Tweet:
// Check if mod every period to send tweet of current temp
*** IMPORTANT ***
Using your heat reflective tape from Part 1, make sure to tape all sides of the black plastic handle of the Vernier Go!Temp temperature probe and keep wrapping up the length of the black USB cable. Make sure none of black plastic or black cable is exposed especially on the handle. The only part that will be in the oven will be the Go!Temp probe itself in the turkey and part of its USB cable that runs out the oven door, so make sure all the black plastic and black cable is properly taped up with heat reflective tape to ensure it will not melt or catch on fire. The metal probe tip should remain exposed and will be mostly inserted into the turkey.
IMPORTANT: The Raspberry Pi must remain outside the oven on a cool counter top or table nearby your oven door. The Go!Temp probe metal portion of the probe must be inserted into the meatiest part of the turkey thigh without hitting any bone. Use a sharp knife to start a pilot hole for the Go!Temp probe if needed. Make sure the Go!Temp metal probe is securely in place in the thigh meat (not touching bone), then run the taped up USB cable that has been wrapped with heat reflective tape out the oven door to the outside counter top or table where the RPi is plugged into a power outlet and is properly networked to the Internet.
You are now ready to start your app.
Start the app with the following command:
java -cp . TurkeyTweeter
That's it! You are now using the TurkeyTweeter to tweet your delicious Thanksgiving turkey as it roasts.
Hope you had fun ready this IoT Thanksgiving Special as much as I had fun blogging about it! And, Happy Thanksgiving!
See the full series on the steps to this cool demo:
Internet of Things (IoT) Thanksgiving Special: Turkey Tweeter (Part 1)
Internet of Things (IoT) Thanksgiving Special: Turkey Tweeter (Part 2)
Internet of Things (IoT) Thanksgiving Special: Turkey Tweeter (Part 3)
Internet of Things (IoT) Thanksgiving Special: Turkey Tweeter (Part 4)
Internet of Things (IoT) Thanksgiving Special: Turkey Tweeter (Part 5)