Episode 424 — PHP Twitter Tamagotchi and ROFLcon

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

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’ll 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 –repeat parameters. Now we can browse to 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 -d control=play -d item=5 –G. Adjust accordingly.

Now that we’ve 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’m 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’m somewhat proud of it. Especially considering how rusty my code is. Now I’m sure it could be replaced with 8 lines of perl so I welcome your constructive criticism on the forums where you’ll find the full source code.

I’m sure now that you’re 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.wpengine.com.

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.wpengine.com/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.


  • Tim

    So which did you guys decide on and why? Premiere or Final Cut Pro? I’m partial to Final Cut Pro but mostly because that is what I first learned on and Premiere didn’t look to be as good.

  • Matt Lestock

    We’re going to go with Premiere Pro CS4 because it’s cross platform, and it’s a lot easier to fix our audio sync issues in it because it’s self contained.

    In Final Cut, we had to send to Soundtrack Pro, then save, then see if it was right, it was a real pain in the ass.

    Beyond the fact that we’ve got the exact export profile we need, it’s a really nice piece of software, and is just a little closer to Vegas so it makes it that much easier.


  • Darren


    Most of the show is shot live to tape. Some segments, like my more recent ones with the hacking and the cooking, are shot to AVCHD on SDHC and more heavily edited.

    But we always edit to pop the lower thirds, full screen graphics, bug, open title, credits and end slate in.

  • Dmichel

    Hi guys

    For those of us that don’t use iTunes, would it be possible to have a nice HD RSS feed … using torrents if bandwidth is a problem (Miro handles rss/torrent feeds pretty well) ? Please 🙂

    Denis (from Europe)

  • Fred


    Do you find that AVCHD is evil? I have a camcorder that records in that format, and often times I find myself using the SD setting, just to avoid the conversion. 🙁

  • Matt Lestock

    We used to think that, before we started using an editer that supported AVCHD natively. We just drag the .mts files int our timeline and let it do it’s thing.

    Final Cut, Premiere CS4, and Sony Vegas 8.0c all have native support for AVCHD


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