Mercurial > boosterpack
comparison PokeScrape.pl @ 0:477258d09353 boosterpack
[svn r1] initial import
author | robert |
---|---|
date | Sun, 30 Aug 2009 02:19:26 -0400 |
parents | |
children | d7dd496a4fa6 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:477258d09353 |
---|---|
1 use Card; | |
2 use Storable; | |
3 | |
4 open POKE, "<all.dat"; | |
5 | |
6 @allcards = (); | |
7 | |
8 | |
9 for $line(<POKE>) | |
10 { | |
11 $line =~ m/(<img.*?>).*?(<img.*?>).*?/; | |
12 | |
13 $img1 = $1; | |
14 $img3 = $2; | |
15 $line =~ m/(<a.*?<\/a>).*?/; | |
16 $img2 = $1; | |
17 | |
18 | |
19 #<img src="/cdexdata/images/types/w.gif" alt="Water" title="Water" height="17" width="17" class="t"> | |
20 | |
21 #<a id="base-set-2-blastoise" href="/scans/base-set/2-blastoise.jpg" title="Blastoise from Base Set (#2)" target="1">Blastoise</a> | |
22 | |
23 #<img src="/cdexdata/images/rarities/rare-holo.gif" alt="Rare Holo" title="Rare Holo" width="28" height="16"> | |
24 | |
25 | |
26 | |
27 | |
28 $img1 =~ m/alt="(.*?)"/; | |
29 $typeTag = $1; | |
30 | |
31 $img2 =~ m/\(\#(\d+)\)/; | |
32 $numTag = $1; | |
33 $img2 =~ m/href="(.*?)"/; | |
34 $pix = $1; | |
35 $img2 =~ m/>(.*)</; | |
36 $nameTag = $1; | |
37 $img2 =~ m/from (.*?) \(/; | |
38 $setTag = $1; | |
39 | |
40 $img3 =~ m/alt="(.*?)"/; | |
41 $rarityTag = $1; | |
42 | |
43 | |
44 if ($line =~ m/^<td/) | |
45 { | |
46 print $numTag," ",$nameTag, "\n"; | |
47 $tempCard = Card->new(); | |
48 $tempCard->addTags($typeTag,$numTag,$nameTag,$setTag,$rarityTag); | |
49 $tempCard->setPix($pix); | |
50 push @allcards,$tempCard; | |
51 | |
52 | |
53 } | |
54 | |
55 | |
56 | |
57 } | |
58 | |
59 | |
60 store \@allcards, 'CARD.perl'; | |
61 | |
62 | |
63 | |
64 my $refnewstruct = retrieve 'CARD.perl'; | |
65 | |
66 | |
67 print @$refnewstruct[0]->getTags(); |