Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Publishing Associates Statistics Help

by Anonymous Monk
on Apr 18, 2005 at 20:18 UTC ( #449007=note: print w/replies, xml ) Need Help??

in reply to Publishing Associates Statistics Help

#!/usr/bin/perl -w # # # Logs into Amazon, downloads earning report, # and writes an HTML version for your site. # Usage: perl use strict; use URI::Escape; use HTTP::Cookies; use LWP::UserAgent; use Net::SSLeay; # Set your Associates account info. my $email = ''; my $pass = 'mypasswordhere'; my $aftag = 'amazonid'; # Create a user agent object # and fake the agent string. my $ua = LWP::UserAgent->new; $ua->agent("(compatible; MSIE 4.01; MSN 2.5; AOL 4.0; Windows 98)"); $ua->cookie_jar({}); # in-memory cookie jar. # Request earning reports, logging in as one pass. my $rpturl = "". "network/reports/main.html"; my $rptreq = HTTP::Request->new(POST => $rpturl); my $rptdata = "report-type=shipments-by-item". # get individual item +s "&date-selection=qtd". # all earnings this q +uarter "&login_id=".uri_escape($email). # our email address. "&login_password=".uri_escape($pass). # and password. "& my report". # get downloadble +. "&enable-login-post=true"; # log in and post at once. $rptreq->content_type('application/x-www-form-urlencoded'); $rptreq->content($rptdata); my $report = $ua->request($rptreq); print $report->content; # Set the report to array. my @lines = split(/\n/, $report->content); # Get the time period. my @fromdate = split(/\t/, $lines[1]); my @todate = split(/\t/, $lines[2]); my $from = $fromdate[1]; my $to = $todate[1]; # Print header... print "<html><body>"; print "<h2>Items Purchased Through This Site</h2>"; print "from $from to $to <br><br>\n"; print "<ul>"; # Loop through the rest of the report. splice(@lines,0,5); foreach my $line (@lines) { my @fields = split(/\t/, $line); my $title = $fields[1]; my $asin = $fields[2]; my $edition = $fields[4]; my $items = $fields[8]; # Format items as HTML for display. print "<li><a href=\"$asin/ref=nosim/ +". "$aftag\">$title</a> ($items) $edition <br>\n"; } print "</ul></body></html>"; And this is my error: C:\Perl>perl Can't locate auto/Net/SSLeay/autosplit.ix in @INC (@INC contains: C:/P +erl/lib C: /Perl/site/lib .) at C:/Perl/lib/ line 160. at C:/Perl/lib/Net/ line 61 Can't locate loadable object for module Net::SSLeay in @INC (@INC cont +ains: C:/P erl/lib C:/Perl/site/lib .) at line 11 Compilation failed in require at line 11. BEGIN failed--compilation aborted at line 11.
I have Windows XP. Is NET:SSLeay a current Perl Module, should I be using something else? How to I do HTTPS requests?

Replies are listed 'Best First'.
Re^2: Publishing Associates Statistics Help
by CountZero (Bishop) on Apr 18, 2005 at 20:29 UTC
    Net::SSLeay is a Perl module you will have to install from CPAN or with PPM.


    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://449007]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2021-05-06 13:51 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (75 votes). Check out past polls.