For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > October 2004 > Inter Program Communication ...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Inter Program Communication ...
Stoill Barzakov

2004-10-26, 3:57 pm

Slackware Linux + Konqueror

I've got an invoice shown on the Konqueror screen from some web/billing
frontend . I'ts mostly text fields and few submit buttons . I want to
collect info from Konqueror (it may include all the html content) and feed
It through already made Perl code to Fiscal Printer .

Direct print from Konqueror is not an option . The Fiscal Printer doesn't
accept standart pure text print . It has own language with CRC on every
command sent .

Is there a Perl module with capability to grab contents of the page shown in
Konqueror if I know Konqueror process ID ?

--
___
(o o) Still ...
--ooO-(_)-Ooo--------------------------------------------------
Tad McClellan

2004-10-26, 3:57 pm

Stoill Barzakov <stoill@unixsol.org> wrote:

> I've got an invoice shown on the Konqueror screen from some web/billing
> frontend . I'ts mostly text fields and few submit buttons . I want to
> collect info from Konqueror (it may include all the html content) and feed
> It through already made Perl code to Fiscal Printer .



> Is there a Perl module with capability to grab contents of the page shown in
> Konqueror



What Konqueror shows are a bunch of pixels.

Are you wanting to get a screen shot?


> if I know Konqueror process ID ?



No, but I don't think that is what you need.

You CAN grab the same page that you see in Konqueror if you
know the URL that you gave to Konqueror.

By the time Konqueror renders it on the screen it is already
Hamburger, too late to make Steak, so move a bit forward in
the flow of things before the HTML is ground up for rendering.

perldoc -q HTML

How do I fetch an HTML file?

How do I automate an HTML form submission?


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
Ben Morrow

2004-10-26, 3:57 pm


Quoth Stoill Barzakov <stoill@unixsol.org>:
> Slackware Linux + Konqueror
>
> I've got an invoice shown on the Konqueror screen from some web/billing
> frontend . I'ts mostly text fields and few submit buttons . I want to
> collect info from Konqueror (it may include all the html content) and feed
> It through already made Perl code to Fiscal Printer .
>
> Direct print from Konqueror is not an option . The Fiscal Printer doesn't
> accept standart pure text print . It has own language with CRC on every
> command sent .
>
> Is there a Perl module with capability to grab contents of the page shown in
> Konqueror if I know Konqueror process ID ?


I doubt it... you would almost certainly need Perl XPCOM bindings, which
AFAIK haven't been written yet :). I am sort-of semi-considering looking
at it, but it looks to be *quite* a job.

At least in Moz/Firefox, you can set the 'printer' to be a pipe to any
process (which will receive postscript): can you not write a (or use a
pre-written) PS->Fiscal Printer converter there?

Ben

--
All persons, living or dead, are entirely coincidental.
ben@morrow.me.uk Kurt Vonnegut
Laura

2004-10-26, 3:57 pm

Stoill Barzakov wrote:

> Slackware Linux + Konqueror
>
> I've got an invoice shown on the Konqueror screen from some web/billing
> frontend . I'ts mostly text fields and few submit buttons . I want to
> collect info from Konqueror (it may include all the html content) and feed
> It through already made Perl code to Fiscal Printer .
>
> Direct print from Konqueror is not an option . The Fiscal Printer doesn't
> accept standart pure text print . It has own language with CRC on every
> command sent .
>
> Is there a Perl module with capability to grab contents of the page shown
> in Konqueror if I know Konqueror process ID ?
>


why not have the html form submit to a perl cgi program which will in turn
execute your 'already made perl code' with the appropriate data?
Stoill Barzakov

2004-10-27, 8:56 am

Tad McClellan wrote:


> perldoc -q HTML
>
> How do I fetch an HTML file?
>
> How do I automate an HTML form submission?


I've already been through most of the *simple* docs . What I need is to get
Exactly what the current user is Konquering and IF it is Invoice screen
(I've got some marks that will define this) to grab the page from It and
process It . Bitmap will not do . I need pure text or pure html .

--
___
(o o) Still ...
--ooO-(_)-Ooo--------------------------------------------------
Stoill Barzakov

2004-10-27, 8:56 am

Ben Morrow wrote:

> I doubt it... you would almost certainly need Perl XPCOM bindings, which
> AFAIK haven't been written yet :). I am sort-of semi-considering looking
> at it, but it looks to be *quite* a job.
>
> At least in Moz/Firefox, you can set the 'printer' to be a pipe to any
> process (which will receive postscript): can you not write a (or use a
> pre-written) PS->Fiscal Printer converter there?
>
> Ben
>


This could work :-| but Mozilla haz a really mean Cyrillic support . It's
not even little WYSIWYG, an if I see cyrillic on screen when I print It's
all boxes instead of chars :-/ therefore It will just eat my time writting
a filter .

.... anyway, is there a way to get ONLY the url currently Konquered by user ?
If I can fetch It from the browser, a conversion and print can be
arranged .

--
___
(o o) Still ...
--ooO-(_)-Ooo--------------------------------------------------
Stoill Barzakov

2004-10-27, 8:56 am

<posted & mailed>

Laura wrote:

>
> why not have the html form submit to a perl cgi program which will in turn
> execute your 'already made perl code' with the appropriate data?


I CAN'T touch the server :( I can only work from billing/client side . And
sorry to say - never wrote good cgi script myself .

--
___
(o o) Still ...
--ooO-(_)-Ooo--------------------------------------------------
Eric Bohlman

2004-10-27, 8:56 pm

Stoill Barzakov <stoill@unixsol.org> wrote in
news:2u93etF26k0ssU1@uni-berlin.de:

> I've already been through most of the *simple* docs . What I need is
> to get Exactly what the current user is Konquering and IF it is
> Invoice screen (I've got some marks that will define this) to grab the
> page from It and process It . Bitmap will not do . I need pure text
> or pure html .


One possibility would be to set your program up to as a "local proxy
server". You'd tell Konqueror (or any other browser) to connect to it
(locally) as a proxy, and it would simply transparently pass on any
requests to the real server and serve the response to the browser. But it
would also examine the response and, if appropriate (e.g. the response has
a content-type of "text/html"), store it.

Look in the "HTTP" section of CPAN for modules with "proxy" in their names.
For that matter, you could probably cobble up something from LWP::UserAgent
and HTTP::Daemon pretty quickly (since HTTP::Daemon will get HTTP::Request
objects, which you can pass on directly to LWP::UserAgent, from the browser
and can send HTTP::Response objects obtained from LWP::UserAgent to the
browser).
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com