Archive

Posts Tagged ‘twitter’

Crowdsourcing your iTunes music with PHP, AppleScript and Twitter

February 20th, 2009 FighterHayabusa No comments

The other day I was catching up on the last few episodes of Hak5, one of my favorite internet-TV shows, and in one episode Darren Kitchen was doing some neat tricks with PHP, Twitter and VLC. This got me thinking about what other kinds of fun projects Twitter could be used for.

Twitter is a great service, not very reliable however (fail whale anyone?), and there are already plenty of mash-ups that uses it for various things. My idea was to use Twitter to select what plays in iTunes. People could send me replies with songs in them and if the song was in my iTunes-library it would be played, as simple as that. Not very useful, but a fun experiment if nothing else. So I started coding.

In order to control iTunes I had to delve into AppleScript for the first time. I find it to be an odd language, but whatever, for this project it’s definitely the most appropriate choice for getting quick results. One of my favorite languages is PHP so that’s what I chose for the control structure of the whole thing.

A couple of hours later I had my first prototype and now an additional few hours of tweaks I give you… TwitTunes!

This is how it works:
Person #1 starts TwitTunes on his Mac. TwitTunes sends a tweet – “#TwitTunes starting” – using Person #1s Twitter-account to let the world know that it is running.
Person #2 sends a reply on Twitter containing search words. These search words are then used to search through Person #1s iTunes-library and the first matching song found is played.

Not very fancy and far from perfect, but admit it, crowdsourcing your jukebox via Twitter is a pretty nifty idea and this is my very first proof of concept ;-)

If you wanna try out TwitTunes yourself you can download it here (sloppy source code included of course), and if you have any feedback I’ll be happy to hear it.

Updated my Twitter-widget

September 4th, 2007 FighterHayabusa No comments

If anybody gives a shit I updated my Twitter-widget tonight. It now parses URLs in the text and turns them into links, and I also tweaked the CSS a bit.

You can download it from the same ‘ole place. Enjoy!

Twitterer and widget maker

July 17th, 2007 FighterHayabusa No comments

The past couple of days I’ve been playing around with Twitter and it’s API. It’s pretty simple to use, hardly astrophysics or anything, and with the widget for Blogger looking like ass I decided to hack my own. And so I did.

The fruits of my labour are plainly visible to the right in this blog. It’s nothing fancy, just some basic HTML, CSS and Javascript, but I think it looks pretty good. And if anybody gives a damn the code can be downloaded from here.

In the days ahead I’m gonna pleasure myself (oooh…) by writing a Twitter-applet for the Gnome desktop as well. Now don’t misinterpret the sudden focus on Twitter. I don’t think I’ll ever be an avid twitterer (is that a word? probably not) and I’m not exactly falling head over heels with excitement over the thing. I just wanna play around with some free API:s, and for that purpose this one is as good as any. Also, anything that allows me to interact using the command line gets a “yay!” from me.

curl -u someaccount@somedomain.com:somepassword \
-d status=Posting+to+Twitter+using+curl+is+teh+shit%21 \

http://twitter.com/statuses/update.json