====== 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: \\ <code>egrep -o 'https?://downloads.[^"]*' zipmanager.html > urls</code> ===== 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'') <code> #!/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) </code> Generate your md5 file with: <code>~/bin/enewsmd5 < urls > MD5SUM</code> And check the files' integrity with: <code>md5sum -c MD5SUM</code> 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

hacks/rough/easynews.com.txt · Last modified: 2010/02/17 01:42 by Toni Corvera
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki