Changeset 1080

Show
Ignore:
Timestamp:
07/13/06 19:05:05
Author:
otsune
Message:

Add ordersReport via http://yadorigi.seesaa.net/article/18547105.html

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/CustomFeed/AmazonAssociateReportJP.pm

    r810 r1080  
    4545    $feed->add_entry($earnings_entry); 
    4646 
     47    my $orders_entry = Plagger::Entry->new; 
     48    $orders_entry->title('注文レポート'); 
     49    $orders_entry->link('https://associates.amazon.co.jp/gp/associates/network/reports/report.html'); 
     50    $orders_entry->date( Plagger::Date->now() ); 
     51    $orders_entry->body( $mech->orders_html); 
     52    $feed->add_entry($orders_entry); 
     53   
    4754    $context->update->add($feed); 
    4855} 
     
    108115} 
    109116 
     117sub orders_html { 
     118    my $self = shift; 
     119    my $html; 
     120    $self->mech->follow_link(url_regex => qr/report\.html.*?ordersReport/); 
     121    $self->mech->submit_form(form_number => 8); 
     122    my $content = $self->mech->content; 
     123    if ($content =~ m!(<table class="report" id="ordersReport">.*?</table>)!is) { 
     124        $html = $1; 
     125    } 
     126    if ($content =~ m!(<table class="ordersReportSummary">.*?</table>)!is) { 
     127        $html .= $1; 
     128    } 
     129    return $html; 
     130} 
     131 
    1101321; 
    111133