Twitter

Gaming

Xbox Live

Playstation Network

Ask Me!

Navigation
Thursday
18Mar2010

Python module for TwitPic album backups

This is a little something I threw together last night due to my frustration at not being able to find a decent utility for backing up my TwitPic album. It's not the most efficient code out there, and in most places it's downright hacky, but it serves its intended purpose, and maybe it'll help some other people who want to develop Python apps that can use TwitPic photos, or people who just want to back up their pictures.

I might as well warn you ahead of time that due to the nature of this program, if the TwitPic staff ever decides to redesign the site, there's a very good chance this program will be broken as a result. Since the official TwitPic API didn't offer any solutions that I could see for downloading pictures or entire albums, I wrote this script to parse the HTML in the pages and harvest the necessary information. If they change this, it will no longer work. Other than that, enjoy the script, and be sure to read the readme file below, or inside the ZIP package.

Download

 

TwitPic Photo Dumper by Ryan Souders (@HonkeyKong)

http://www.honkeykong.org/

This initial release doesn't really do much, so if you're looking for a full-featured photo utility, look elsewhere. In its current state, this is mainly good for two things: backing up your TwitPic photo album, or to be used as a module in your own applications.

For the former, all you need is a Python interpreter and basic knowledge of how to use the command line in your Operating System. It should work the same under Windows, Linux, and Mac OS X, but I have only tested it under Windows and Linux. If you have a Mac, let me know how it works out for you.

In Mac OS X and most Linux distributions, Python should already be installed on your computer. Windows does not come with it though, and as such, I recommend downloading and installing ActivePython from the following URL: http://www.activestate.com/activepython/

Once you're sure you have a Python interpreter installed, you can run the script and backup your photos by opening a command line or terminal, navigating to the location where you placed the script, and executing the following command:

twitpic.py twitter_ID number_of_pages

Obviously, "twitter_ID" should be replaced with your Twitter handle, and "number_of_pages" should be replaced with the number of photo pages you want to download. Each TwitPic page holds 20 photos. Once the script has finished running, you should have a new folder with your user ID, filled with your photos, and text files containing the descriptions for each photo. It could be handled better, but this isn't intended to be a professional tool, just a means for me to back up my photos that I thought I should share, so others can do the same without wasting hours saving them individually.

Now that I have the non-developer stuff out of the way, here's what you need to know if you're a developer and for some reason want to use my crappy code to add TwitPic functionality into your own app:

twitpic.fetchList(userID, numPages)

This function will iterate through a user's photo album, up to the maximum page number specified in the numPages argument, and return all photo IDs in a list format.

twitPic.picInfo(picID)

This function retrieves the description for the photo located at the URL http://twitpic.com/picID

twitPic.fetchTitles(userID, numPages)

This function iterates through userID's photo album, up to numPages, and retrieves the description for every photo in the album, writing each one individually to a text file with that photo's ID.

twitPic.downloadPic(picID)

This function downloads the full-sized version of the photo located at http://twitpic.com/picID

twitPic.leechPics(userID, numPages)

This is the function that will download every picture and title, up to the number of pages specified in numPages. It should go without saying that this function should only be used to back up your own photographs, as using it to leech the albums of other users or to  harvest large amounts of photo albums can be considered a dick move toward the TwitPic staff. Bandwidth isn't cheap, so there's no sense in using more of their bandwidth than you really need to.

I think that's all that needs to be said here. If you think I forgot something, you have a suggestion, or a question about this, feel free to e-mail me at honkeykong at honkeykong dot org, or send me a  message on Twitter at http://twitter.com/HonkeyKong

Saturday
19Dec2009

The Plural of Dr Pepper.

Listen!

I've always wondered about this too.

Friday
04Dec2009

Weekend B-Movie Pick: ThanksKilling

Instead of wasting time explaining my recent hiatus from doing B-Movie reviews due to my work schedule, personal issues, etc., let's jump right into this.

I found this little gem on Netflix a couple of nights ago, while bored and flipping through the "Recently Added" movie section looking for something to watch. My only complaint is that I didn't find this before Thanksgiving, as those of you who follow my Twitter know that I was looking for a good Thanksgiving horror movie, and was unable to think of one.

Luckily, ThanksKilling helps to fill that niche for Thanksgiving slasher flicks that's painfully empty. Right from the start of this movie, you get an immediate feel for the silly, gory, delightfully vulgar mood the creators were aiming for as we watch a topless pilgrim running through the woods, with the camera constantly switching from her scared face to her bouncing boobs. She trips and falls, and we're treated to the first appearance of the killer turkey who will be stalking his victims throughout the movie, as he yells, "NICE TITS, BITCH!", and proceeds to hack her up with an axe. Why is a turkey from 500 years ago speaking with a Jersey accent? How is he able to pick up and swing an axe? Who knows? Who cares? It's funny. That's the only important thing about movies like this.

The movie starts of like just about every other B-slasher flick, introducing us to our cannon fodder college students: the nerd, the slut, the quarterback, the fat redneck, and the "good girl". While on their way to their respective homes for Thanksgiving vacation, their car breaks down, and they decide to camp out in the woods, as stupid horror movie stereotypes are known to do. As in every other predictable B-horror film, the nerd character starts telling stories of an old legend around the campfire, and gets brushed off before one of the characters goes off on their own to discover that the legend is true. From here on out, we're treated to more foul-mouthed turkey kills and goofy humor. It's predictable, but at the same time, it's a lot of fun to watch, because the movie doesn't take itself too seriously. There's plenty of self-referential humor, sight gags, and cheesy gore effects to enjoy here.

 

 For those of you who are reading my B-movie reviews for the first time, every movie I review is available for instant streaming on Netflix, and this one is no exception. You can watch it on your PC, Mac, Xbox 360, PS3, TiVo, or Netflix-enabled Blu-ray player or TV. Just visit the "Watch Now" link below to add it to your instant queue, or play it immediately from your PC or Mac.

Watch "ThanksKilling" Now!

Monday
09Nov2009

This was a triumph.

If you're reading this, then congratulations! The DNS for HonkeyKong.Org has successfully propagated, and you're now seeing my new and improved website, hosted by SquareSpace. After trying out their service, I decided that I prefer this over WordPress, as it lets me consume less time messing with design and other aspects, and more time actually creating content. If you're looking for a good webhost with great design tools, I'd strongly recommend checking it out.

Now that I have this kind of freedom to quickly tweak and design pages, I'm considering expanding this site to more than just a personal rant space and place to post movie and game reviews. One of the things I took the time to do was create a page for streaming live video. It's not enabled at the moment, because I only plan on having it active when I have something I want to stream. However, the only thing I can think of that's even remotely entertaining for me to stream is myself playing video games and failing horribly, so watch my Twitter feed for the times when I actually feel like doing that.

That's really all I have to say for now, though I'm hoping now that my site is less of a pain in the ass to deal with, I'll have more things to post from here on out. Of course, I said that before when I moved hosts, and it didn't really happen, so don't hold your breath.

Saturday
19Sep2009

Happy Talk Like A Pirate Day!



Recommended listening for Talk Like A Pirate Day: Alestorm - Captain Morgan’s Revenge


One of my favorite metal bands of the last few years, Alestorm is a band from Perth, Scotland, specializing in Pirate Metal.


If you like what you’re hearing, you can pick up the full album as a DRM-free MP3 download at AmazonMP3 and have it immediately for Talk Like A Pirate Day.