====== Site-specific console hacks: Easynews.com ======
===== Extract download links =====
It works better with files put in a zipmanager slot and the slot displayed as a list; first save the page to disk (e.g. to ''zipmanager.html'') and then: \\
egrep -o 'https?://downloads.[^"]*' zipmanager.html > urls
===== Generate an MD5SUM file from a list of urls =====
EasyNews' web interface urls include the md5sum hash so the integrity of the download can be checked easily. \\
I'm assuming you have the list of URLs in a file named urls as generated above.
This one is a bit trickier (and it has stuff that certainly can be done in a nicer way) so it's better put in a file, save this to e.g. ''~/bin/enewsmd5'' and make it executable (''$ chmod +x ~/bin/enewsmd5'')
#!/bin/bash
export IFS=$'\10' # Required for the echo $(cat)
# 1st sed : place MD5 and filename in the correct order
# 2nd sed : transform url encodings in character escapes
grep 'downloads.' /dev/stdin | \
sed -r 's#^https?.*?news/./././([a-z0-9A-Z]{32}).*/(.*)#\1 *\2#g' | \
sed -r 's/%([0-9a-fA-F]{2})/\\x\1/g' | \
echo -e $(cat /dev/stdin)
Generate your md5 file with:
~/bin/enewsmd5 < urls > MD5SUM
And check the files' integrity with:
md5sum -c MD5SUM
Note that you could also chain it all together, up from the zipmanager.html file:
egrep -o 'https?://downloads.[^"]*' zipmanager.html | ~/bin/enewsmd5 | md5sum -c -
----
Last update: 29.09.2007