Sunday, August 29, 2010

coding at Auckmageddon

Thanks to Vector and Orcon, A5 has a 1gbps internet connection which really craps on all the other LANs that have ever happened in NZ. We tried to come up with ways we could max it out and someone suggested trailers.apple.com. I was asked to come up with a script to parse the feeds for a list of 1080p trailer URLs we could feed into wget. This is what I came up with:


from urllib2 import urlopen
from BeautifulSoup import BeautifulSoup
from json import loads


urllist = []
for t in loads(urlopen("http://trailers.apple.com/trailers/home/feeds/just_added.json").read()):
    urllist.append(t['trailers'][0]['url'])


for u in map(lambda x: "http://trailers.apple.com/" + x, urllist):
    try:
        h = urlopen(u+"includes/playlists/web.inc").read()
        soup = BeautifulSoup(h)
        avail = soup.findAll("li", {"class":"trailer last"})[0].findAll("li", {"class":"hd"})
        print avail[-1].findChild("a").attrs[0][1]
    except:
        pass

It turns out that not all the trailers have corresponding HTTP urls to the .mov files - some are handled through ITMS for unknown reasons.

Anyway, we still havent managed to crack much more than 200mbit, and Soundie seems a little dissapointed.

Tuesday, August 24, 2010

confused 0.2 released

I have finally released confused for Linux. This version is a PAM module. It's a complete ground up rewrite of the old amnesia based code, and it's pretty straight forward.

The only potential problems I can see are with the way it packs the post auth scripts; if you put a huge script in it potentially could overwrite or truncate other entries in the database.

Oh, while you're at it: check out pam_solitaire as well.

----- BEGIN BLOG -----

Thoughtcrime does not entail death. Thoughtcrime IS death. I have committed even before setting pen to paper the essential crime that contains all others unto itself.