LWP and Xerox printers

R

RAT

I am trying to write an LWP script to automate the retrieval of usage
reports from Xerox printers. I called Xerox and they say there is no
automated way or alternative to the web gui which requires logging in
and hitting a button to generate new reports. I can log in and
retrieve the reports but when I run the PHP to generate the new
reports, it says OK and does nothing.

my $ua = LWP::UserAgent->new(cookie_jar => {});
$ua->cookie_jar->set_cookie("PHPSESSID");
my $rsp = $ua->post('http://111.111.111.111/properties/authentication/
login.php?webUsername=mgtuser&webPassword=secret'); # no, not real pw
& IP

# This lines reports OK but does NOT generate a new report
my $newrep = $ua->post('http://111.111.111.111/properties/accounting/
generateReport.php');

I've tried adding more cookies (there were 3 others). I added user
agent and referring URL - no change.

It's a popular printer. Anyone done this? Clues?

http://yesistilluseperl.blogspot.com/
 
J

J. Gleixner

I am trying to write an LWP script to automate the retrieval of usage
reports from Xerox printers. I called Xerox and they say there is no
automated way or alternative to the web gui which requires logging in
and hitting a button to generate new reports. I can log in and
retrieve the reports but when I run the PHP to generate the new
reports, it says OK and does nothing.

my $ua = LWP::UserAgent->new(cookie_jar => {});
$ua->cookie_jar->set_cookie("PHPSESSID");
my $rsp = $ua->post('http://111.111.111.111/properties/authentication/
login.php?webUsername=mgtuser&webPassword=secret'); # no, not real pw
& IP

# This lines reports OK but does NOT generate a new report
my $newrep = $ua->post('http://111.111.111.111/properties/accounting/
generateReport.php');

I've tried adding more cookies (there were 3 others). I added user
agent and referring URL - no change.

It's a popular printer. Anyone done this? Clues?

I'd suggest using Firebug or the Web Scraping Proxy to see what's sent
when using the browser. Possibly there is some JavaScript events
happening when you are 'hitting a button', which you might have to
figure out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top