Flickr Banners
If you are one of the three persons who actually see this blog on its site instead of reading it through some sort of aggregator, you may have noticed I have a banner.
This is what it looks like:
Nice, ah?
It's not very original (look for "spell with flickr" to see where I stole the idea), but I wrote a script to do it. So here it is, feel free to steal it too, it's your turn.
You will need this, ImageMagick, and a Flickr API key.
To use it simply call it like this:
python banner.py something
And you will have a something.jpg with something in it.
#!/usr/bin/env python import flickr,sys,random from urllib import urlopen import os g=flickr.Group(id="27034531@N00") urls = [] for l in sys.argv[1]: if l=="a": l="aa" if l=="i": l="ii" photos = g.getPhotos(tags=[l], per_page=50) urls.append(photos[random.randrange(50)].getURL( size='Square', urlType='source')) for i in range(0,len(urls)): f=open(str(i)+'.jpg','w') data=urlopen(urls[i]).read() f.write(data) f.close() os.system ("montage -tile %dx1 -geometry +0+0 %s %s"%( len(urls),' '.join([ '%d.jpg'%x for x in range(0, len(urls)) ]), sys.argv[1]+'.jpg'))