[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]

/g/ - Technology

Only inane comments

Catalog

8chan Bitcoin address: 1NpQaXqmCBji6gfX8UgaQEmEstvVY7U32C
The next generation of Infinity is here (discussion) (contribute)
ATTENTION TOR USERS: I accidentally released the PRIVATE key for the Tor hidden service into a public IRC channel. The Tor URL fullchan4jtta4sx.onion is now considered COMPROMISED and NOT OWNED by the 8chan administration. The new URL is oxwugzccvk3dk6tj.onion.
Email
Comment *
File
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Flag
Embed
(replaces files and can be used instead)
Options
dicesidesmodifier
Password (For file and post deletion.)

Allowed file types:jpg, jpeg, gif, png, webm, mp4, pdf
Max filesize is 8 MB.
Max image dimensions are 10000 x 10000.
You may upload 5 per post.


RulesResources

 No.3093

Hi guys I made 2 scripts that together work to download all the images of a thread and the main board message (as the original txt file it's hosted as). I could use some criticism on the functionality.

idk if I can upload the files directly but if that doesn't work I'll paste the contents. Also for the perl section you need WWW:Mechanize installed. This can easily be done as described here

http://cpansearch.perl.org/src/PETDANCE/WWW-Mechanize-Cached-1.32/INSTALL

To use these scripts just

'chmod +x AutoDownload.sh'

and then

'./AutoDownload.sh'

Code for the AutoDownload.sh


perl ThreadScript.perl
sed -i '$!N; /^\(.*\)\n\1$/!P; D' outputlinks.txt
sed -i '/.php/d' outputlinks.txt
sed -i '/.css/d' outputlinks.txt
sed -i '/.html/d' outputlinks.txt
sed -i '/.htm/d' outputlinks.txt
sed -i '/.co/d' outputlinks.txt
sed -i '/.php/d' outputlinks.txt
wget -i outputlinks.txt

& code for ThreadScript.perl


use WWW::Mechanize;
print "please copy the url of the thread\n";
$link = <>;
$mech = WWW::Mechanize->new();
$mech->get("$link");
open STDOUT, ">", "outputlinks.txt" or die "$0: open: $!";
open STDERR, ">&STDOUT" or die "$0: dup: $!";
$mech->dump_links(undef, 'absolut' => 1);

 No.3095

File: 1439312538819.jpg (1.64 MB, 1920x1080, 16:9, 1439143608928.jpg)




[Return][Go to top][Catalog][Post a Reply]
Delete Post [ ]
[]
[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]