A bookmarklet to extract photos from facebook album

Few days back I wanted to download all photos of a facebook album. Unfortunately that album was a personal public album can’t easily use facebook’s graph api to extract image links. In web when all else fails you still can do some magic with javascript. 🙂

I used the following bookmarklet to extract image links of thumbnails. It opens a separate window where it prints all the links, next use wget or any other downloading software to download images.

javascript:x=document.getElementsByClassName('uiMediaThumbImg');w=window.open('','','width=1024,height=768');for(i=0;i<x.length;i++){w.document.write(x.item(i).getAttribute('style').replace(');','').replace('background-image: url(', '').replace('p206x206/',''));w.document.write("<br/>");}w.focus();

wget command to download images

wget --no-check-certificate -i files.txt

Be aware: Quite a few assumptions are made!

Bookmarklet Link Extractor

For a while I was wondering how could I write a button like google bookmark. Few days ago I came to know this technology’s name is bookmarklet. The word bookmarklet came from bookmark + applet, is just a bookmark having a javascript function in its URL. Javascript function in URL is possible, as modern browser supports javascript: prefix like http:, ftp:, or https:. It offers a lot of advanced feature in browsing. Wikipedia have good details, take a look, BOOKMARKLET on Wikipedia.

Then i gave a try to write one. this typical bookmarklet firstly ask for few predefined options then extract all the link of matching types. And options are optimized for google filetype : *** search result.

To use copy following lines and then create a bookmark with this text in url. Continue reading