Code

Void(main) { while(true) { print “Hello World”; } /* Code Monkey was here*/ }

Game

Video Games! Independent, homebrew, hacked or open source. We love offbeat games.

Geek

It takes one to know one, and we huge geeks. If it doesn’t fit in another category look here.

Hack

From man-in-the-middle attacks to GPU accelerated password cracking, and voiding warranties

IT

Information Technology. Network Administrators. Sysadmins. The “Company Computer Guy”

Home » Episodes, Season 4

Episode 424 — PHP Twitter Tamagotchi and ROFLcon

Submitted by on January 28, 2009 – 11:05 am14 Comments

Hot off the heels of ROFLcon in NYC the crew kicks some in studio technolust. Darren shares with you his custom twitter tamagotchi bot written in PHP with some sweet RSS parsing, VLC controlling, curl loving nested goodness. Plus guest Jim Louderback, gadget lover and Revision3 stage hand, joins us to talk about all things new media.

Download HD Download MP4 Download XviD Download WMV

Watch

Show Notes

When we were first approached to attend ROFLthing in NYC we were asked if we could put together some sort of interactive media installation for the after party. My first thought was a web controlled paintball gun similar to the USB Missile launcher but, well, the lawyers didn’t think it was a good idea.

So I started thinking about the whole ROFLthing concept, it’s a congregation of Internet celebrities and web 2.0 kids. And what better way to showcase the usefulness of a service like twitter with the uselessness of that clever little electronic pet the tamagotchi.

The project is split up into three parts. First a directory full of videos that we値l control from the web using VLC, PHP and Curl. I made my tamagotchi videos using photoshop and vegas.

Second we need to be able to control VLC from the command line so fire up VLC and point it at your directory of videos with the –intf=http, –fullscreen and 睦epeat parameters. Now we can browse to http://127.0.0.1:8080 to hit the local http interface. Check out the /old/ directory to get the old interface. Here we find the parameters to post to the http server using curl. Try changing the item number from the command line with curl 127.0.0.1:8080/old/ -d control=play -d item=5 萌. Adjust accordingly.

Now that we致e got VLC playing a directory of videos fullscreen and we can control it from the command line its time to duct tape together some PHP. In order to easily query Twitter for input I知 using the MagpieRSS class to parse the feed of a search query from search.twitter.com. A case and switch statement within a while loop does all of the magic, checking the input and making a system call to curl.

It may not be beautiful code but it works and for a few hours of hacking I知 somewhat proud of it. Especially considering how rusty my code is. Now I知 sure it could be replaced with 8 lines of perl so I welcome your constructive criticism on the forums where you値l find the full source code.

I知 sure now that you池e loaded with these techniques you can find all sorts of uses for parts of this project.

Thanks for downloading. Remember you can find subscription links and our new iTunes HD feed at hak5.org.

Keep the constructive feedbacks coming, we’ve seen a lot of great stuff lately on the forums so thanks for that.

Don’t forget we’ve got brand new sticker packs as thanks for your donations at www.hak5.org/stickers. We really appreciate your support!

February 6-8 we’ll be in DC for Shmoocon

If you’re in the area we’ll be attending the anual podcasters meetup come out meet the crew and lots of other great podcasters from PaulDotCom, Securabit, Sploitcast, Cyber Speak, Security Justice and more.

Get all the details at podcastersmeetup.com

Special shout out to the hacker hound from Hoboken, Brandi, and her pet Jon for all the generosity in NYC this weekend.

VN:F [1.9.13_1145]
Rating: 7.0/10 (3 votes cast)
Episode 424 -- PHP Twitter Tamagotchi and ROFLcon , 7.0 out of 10 based on 3 ratings

14 Comments »

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.