LWP and Xerox printers

Discussion in 'Perl Misc' started by RAT, Jul 28, 2011.

  1. RAT

    RAT Guest

    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/
     
    RAT, Jul 28, 2011
    #1
    1. Advertising

  2. RAT

    J. Gleixner Guest

    On 07/28/11 14:13, RAT wrote:
    > 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.
     
    J. Gleixner, Jul 28, 2011
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Moreno

    python and printers

    Alex Moreno, May 13, 2005, in forum: Python
    Replies:
    0
    Views:
    272
    Alex Moreno
    May 13, 2005
  2. lmttag
    Replies:
    5
    Views:
    989
    Steven Cheng[MSFT]
    May 3, 2007
  3. Luqman
    Replies:
    2
    Views:
    504
    Luqman
    Sep 6, 2007
  4. z71mdridin

    ASP.NET and Bluetooth Printers

    z71mdridin, Feb 25, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    521
    Eliyahu Goldin
    Feb 26, 2008
  5. Pascal Gineste

    Impersonate by code and printers ?

    Pascal Gineste, Sep 9, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    115
    Pascal Gineste
    Sep 9, 2004
Loading...

Share This Page