- Timestamp:
- 07/08/09 22:45:15 (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/ActionStreams/plugins/ActionStreams/lib/ActionStreams/Event/Steam.pm
r1563 r1566 41 41 process q{div#BG_top h2}, 42 42 'title' => 'TEXT'; 43 process q{//div[@class='achievementClosed']}, 43 process q{html}, 44 'html' => 'HTML'; 45 process q{//div[@class='achieveTxtHolder']}, 44 46 'achvs[]' => scraper { 45 47 process 'h3', 'title' => 'TEXT'; … … 73 75 next URL if !$items; 74 76 75 my ($title, $ achvs) = @$items{qw( titleachvs )};77 my ($title, $html, $achvs) = @$items{qw( title html achvs )}; 76 78 $title =~ s{ \s* Stats \z }{}xmsi; 77 79 78 for my $item (@$achvs) { 80 next URL if ($title =~ /Global Gameplay/i); 81 82 # So we have the full source code in $html; we need to count how many achievements are before 83 # the critical <br /><br /><br /> line dividing achieved from unachieved. 84 85 next URL if ($html !~ /\<br\ \/\>\<br\ \/\>\<br\ \/\>.+/); # If the line isn't there, they don't have any achievements yet. 86 87 $html =~ s/\<br\ \/\>\<br\ \/\>\<br\ \/\>.+//; 88 my $count = scalar split(/achieveTxtHolder/, $html); 89 $count = $count - 2; #This method ends up with one too many, always, and we want the last valid *INDEX* number. 90 91 my @achievements = @$achvs; 92 $#achievements = $count; # Truncates the array 93 94 for my $item (@achievements) { 79 95 $item->{gametitle} = $title; 80 96 $item->{ident} = $ident; … … 88 104 $class->build_results( 89 105 author => $author, 90 items => $achvs,106 items => \@achievements, 91 107 identifier => 'ident,gamecode,title', 92 108 );
