This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
stroughtonsmith's profile picture

Twitter Search v1.0

Started by stroughtonsmith, 10 August 2012 - 12:39 PM
stroughtonsmith #1
Posted 10 August 2012 - 02:39 PM
Hey there, new to the forum; just wanted to post a program I put together to display my Twitter @replies in ComputerCraft. I showed this off on Twitter a few days ago, but this is an improved version.

I didn't want to deal with trying to get oauth/xauth working inside CC (ugh), so I'm using the Twitter search API to pull in all public mentions of my @username; it doesn't log you in to your account on twitter, so you can't post, etc.

Now because Twitter uses JSON, I added a JSON library to my ComputerCraft ROM; it's the big file I named 'json' here. Keep it called json and place it in <serverdir>/mods/ComputerCraft/lua/rom/apis/ (you could also modify it to load the json library from your local CraftOS drive, I'll leave that as an exercise to the reader).

All you have to do is swap out my @username for yours (or any search term) and you should be good to go! Hope you like it ;)/>/>

Code:
https://gist.github.com/3314193

README:
Skip steps 1 and 3 if you grab 'json' from the github gist I've attached here; it's already modified for 3.

– 0: Make sure to enable HTTP as per http://computercraft...title=HTTP_(API)
– 1: Grab file from https://github.com/luaforge/json
– 2: Place in <serverdir>/mods/ComputerCraft/lua/rom/apis/ as 'json'
– 3: Take out the requires at the top, and the module line
– 4: Reboot your ComputerCraft computer

Cloudy #2
Posted 10 August 2012 - 05:07 PM
Brilliant! Will have to try this out. Nice work!
Noodle #3
Posted 10 August 2012 - 05:55 PM
Woah!
This is amazing!!!!
cant_delete_account #4
Posted 10 August 2012 - 07:02 PM
I'm almost done with a Twitter poster in CC. Once it's finished you could add it in this. Then it could be a full CC Twitter client once you add delete tweets and stuff.
Also, this is awesome!
maarten1012 #5
Posted 10 September 2012 - 04:09 PM
can you make it that it shows your tweets also, not just mentions?