Twitter Xmas tree

I’m sure loads of people are building Arduino based trees this year. I was asked to build one that responds to keywords on twitter (https://www1.bournemouth.ac.uk/news/2014-12-01/tweet-tree - its not so clear from that picture but its a 6m tree!), so I set one up using a Yun.

Tech details are here. I plan to release all the code in the next few weeks, but if you’re attempting to track tweets from a Yun, I’ve attached a shell script which runs on Yun Linux, picks out keywords in tweets, counts then, and places them in the Bridge keystore, so you can write avr side code to act upon the number of tweets. It’s got a .txt extension on it, so I can upload it here, but its really a shell script!

I thought is was worth sharing, as the authentication is pretty hairy. It uses openSSL, which is available through the gun package manager.

Ian

yunXmas.txt (1.77 KB)

Nice!

Thanks for sharing it :slight_smile:

SSL HttpClient use curl, and curl need root CA install. YunOS has no root CA preinstall, install it yourself.

http://forum.arduino.cc/index.php?topic=273342.msg1930879#msg1930879

Plan B:

instead of ash script, use python to make code much easy readability and easy maintainability.

http://forum.arduino.cc/index.php?topic=239380.msg1719783#msg1719783

Curl has an option to override CA. In this case if someone wants to set up fake certificates and run a man-in-the-middle on a Xmas tree, then they're welcome to it. You don't need to install the CA's to run the script.

And using python never improved the readability or maintainability of anything!

dctsystems: Curl has an option to override CA. In this case if someone wants to set up fake certificates and run a man-in-the-middle on a Xmas tree, then they're welcome to it. You don't need to install the CA's to run the script. ...

fake certificates, why use SSL first place?

dctsystems: ... And using python never improved the readability or maintainability of anything!

4-5 lines python v.s. whole pages long hacking ash script code?

why use SSL first place?

Because Twitter requires it. The API can be used to access private information where you might want the returned data to be encrypted, but in this case the information we're accessing is both public, and trivial. The API itself includes encryption, which prevents access to, or reuse of any credentials. The only risk is that some one sets up fake server, intercepts your request, and sends you back bad data - that's a lot of work to go to for a xmas tree.

4-5 lines python v.s. whole pages long hacking ash script code?

Except its not 4 or 5 lines of python, its a bunch of packages, which in turn include very similar code to this. You can save this code as a file, and pretend its ONE line of code (/root/xmas). The code to do this in Python without using a bunch of non-standard packages would be about the same

The point is that this version has only one, simple external dependancy, which is a standard Yun package. On Most Unix platforms this runs "out of the box" without any additional installs.