Skip to content

Commit

Permalink
tweaked to get (now missing) self link
Browse files Browse the repository at this point in the history
  • Loading branch information
charsbar committed Feb 27, 2010
1 parent 19e2402 commit fc26a4c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/WWW/Mixi/Scraper/Plugin/ViewDiary.pm
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ sub scrape {
description => $self->html_or_text;
process 'div.diaryPhoto>table>tr>td',
'images[]' => $scraper{images};
process 'div.personalNavigation01>ul.personalNaviHome>li.top>a',
mylink => '@href';
process 'div.personalNavigation01>ul.personalNaviFriend>li.top>a',
link => '@href';
result qw( time subject description images link mylink string );
process 'div.diaryPaging01>div.diaryPagingLeft>a',
prev_link => '@href';
result qw( time subject description images prev_link string );
};

my $stash = $self->post_process($scraper{diary}->scrape(\$html))->[0];
$stash->{link} ||= delete $stash->{mylink};
my $stash = $scraper{diary}->scrape(\$html);
$stash->{link} = delete $stash->{prev_link};
$stash->{link} =~ s/neighbor_diary/view_diary/;
$stash->{link} =~ s/&direction=prev.*//;
$stash = $self->post_process($stash)->[0];

my $string = delete $stash->{string} || '';
$stash->{subject} =~ s/$string$//;
Expand Down

0 comments on commit fc26a4c

Please sign in to comment.