-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDART.pl
56 lines (56 loc) · 1.74 KB
/
DART.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/local/bin/perl
use strict; use warnings;
use WWW::Mechanize;
################### SUMMONS #
# DART - deviantart locations
# :) ~=== ---skrp of MKRX
# SETUP #####################
my @category = ( # max req is 40k per
'digitalart',
'traditional',
'photography',
'artisan',
'literature',
'film',
'motionbooks',
'flash',
'designs',
'customization',
'cartoons',
'manga',
'anthro',
'fanart',
'resources',
'projects',
'contests',
'journals',
'darelated',
'scraps'
);
my $dump = 'DART_MASTER'; my $log = 'DART_LOG';
open(my $payfh, '>>', $dump);
my $base = 'data-super-full-img="';
my $i_batch = 0; my $tmp = 'tmp';
my $mech = WWW::Mechanize->new( from => 'wikiark.org', timeout => 45 );
foreach my $cat (@category) {
print "##### $cat #####\n";
for my $i (0 .. 39_999) {
if ($i > 23 and $i % 25 == 0)
{ $i_batch += 25; print "@@@@ $i_batch @@@@\n"; }
my $i_base = 'http://www.deviantart.com/browse/all/'.$cat.'/?offset='.$i_batch;
print "%%%% $i_base %%%%\n";
if (eval {$mech->get($i_base)}) {
$mech->save_content($tmp);
open(my $iterfh, '<', $tmp);
my @tmp = readline $iterfh; chomp @tmp; close $iterfh; #unlink $tmp;
foreach (@tmp) {
if (/$base/) {
$_ =~ s/.*$base//;
$_ =~ s/\".*//;
print $payfh "$_\n";
}
}
}
else { die "failed on $i_base\n"; }
}
}