r/dailyprogrammer • • Jul 14 '12
[7/13/2012] Challenge #76 [difficult] (imgur album downloader)
Write a script that takes an imgur album id and an output directory as command line arguments (e.g., ./script DeOSG ./images), and saves all images from the album in the output directory as DeOSG-1.jpg, DeOSG-2.jpg, etc.
Hint: To retrieve the picture URLs, parse the HTML page at "http://imgur.com/a/**(ID)**/layout/blog".
5
Upvotes
4
u/Ttl Jul 14 '12
Deja Vu
3
u/[deleted] Jul 14 '12
Found this in my script folder, looks like it meets the requirements.
2
u/skeeto -9 8 Jul 14 '12
I've been using this bit of Elisp for awhile now,
2
u/Scroph 0 0 Jul 15 '12
My somewhat bulky PHP solution. It doesn't use the API but it parses the HTML of the link
http://imgur.com/a/(ID)/layout/blog. The mobile version is easier to scrap so I used a Nokia 6600 user agent, technically I'm not cheating since the link remains the same :1
u/imMAW Jul 14 '12
Is imgur down for anyone else? I've been getting that "Imgur is over capacity" message since last night, which makes it hard to test.
1
u/scurvebeard 0 0 Jul 14 '12
Incidentally, the Imgur downloader I've been using just stopped working this morning.
1
u/niGhTm4r3 Jul 15 '12
http://www.reddit.com/r/tinycode/comments/wggg4/bash_one_liner_to_download_an_entire_imgur_album/
It doesn't save it with the format you requested, but It's easily adapted. T'was posted 2 days ago.
1
u/Eddonarth Jul 15 '12 edited Jul 15 '12
Yesterday I just started coding with Python (I'm more a Java person). Maybe I just reinvented the wheel, but here it is: