LWP Problem

2007-03-29 Thread quqi xiao

Hi,could anyone help me?
I found a problem when I visit my website,The website will show me like
this:
Software error:

Can't locate auto/LWP/UserAgent/cookie_jar.al in @INC (@INC contains:
../util/EZXAP_Net/LWP/blib/lib
/usr/local/apache2/htdocs/src/id/util/EZXAP_Net/LWP/lib
/usr/local/apache2/htdocs/src/id/util/EZXAP_Net/Net
/usr/local/apache2/htdocs/src/id/util/EZXAP_FLEX ../util/EZXAP_FLEX
../util/EZXAP_Net/Net ../util/EZXAP_Net
/usr/local/lib/perl5/5.8.8/i686-linux /usr/local/lib/perl5/5.8.8
/usr/local/lib/perl5/site_perl/5.8.8/i686-linux
/usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl .)
at /usr/local/apache2/htdocs/src/id/system/test.pl line 118

For help, please send mail to the webmaster ([EMAIL PROTECTED]), giving
this error message and the time and date of the error.

And when I remove the floder LWP in EZXAP_NET,everything is ok.But I
don't konw why.I think the program use the default LWP package in this
machine.

My question is what is cookie_jar.al?Where and When used this file?Is
this a *temporarily* file?I run find in root directory,but can not
find this file.It's so puzzled for me.Could anyone kindly answer this
quesion,Thanks a lot.With Best wishes.

QQ

2007-03-29


Re: LWP Problem

2007-03-29 Thread Mumia W.

On 03/29/2007 04:30 AM, quqi xiao wrote:

Hi,could anyone help me?
I found a problem when I visit my website,The website will show me like
this:
Software error:

Can't locate auto/LWP/UserAgent/cookie_jar.al in @INC (@INC contains:
../util/EZXAP_Net/LWP/blib/lib
/usr/local/apache2/htdocs/src/id/util/EZXAP_Net/LWP/lib
/usr/local/apache2/htdocs/src/id/util/EZXAP_Net/Net
/usr/local/apache2/htdocs/src/id/util/EZXAP_FLEX ../util/EZXAP_FLEX
../util/EZXAP_Net/Net ../util/EZXAP_Net
/usr/local/lib/perl5/5.8.8/i686-linux /usr/local/lib/perl5/5.8.8
/usr/local/lib/perl5/site_perl/5.8.8/i686-linux
/usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl .)
at /usr/local/apache2/htdocs/src/id/system/test.pl line 118

For help, please send mail to the webmaster ([EMAIL PROTECTED]), giving
this error message and the time and date of the error.

And when I remove the floder LWP in EZXAP_NET,everything is ok.But I
don't konw why.I think the program use the default LWP package in this
machine.

My question is what is cookie_jar.al?Where and When used this file?Is
this a *temporarily* file?I run find in root directory,but can not
find this file.It's so puzzled for me.Could anyone kindly answer this
quesion,Thanks a lot.With Best wishes.

QQ

2007-03-29



It is probably a conflict between the default LWP package and your own 
LWP package in EZXAP_NET; however, without seeing the code that 
generates this error, and without knowing what operating system this is, 
it's hard to say what the problem is.





Re: LWP Problem

2007-03-29 Thread Mumia W.

On 03/29/2007 12:18 PM, quqi xiao wrote:

2007/3/29, Mumia W. [EMAIL PROTECTED]:


On 03/29/2007 04:30 AM, quqi xiao wrote:
 Hi,could anyone help me?
 I found a problem when I visit my website,The website will show me like
 this:
 Software error:

 Can't locate auto/LWP/UserAgent/cookie_jar.al in @INC (@INC contains:
 ../util/EZXAP_Net/LWP/blib/lib
 /usr/local/apache2/htdocs/src/id/util/EZXAP_Net/LWP/lib
 /usr/local/apache2/htdocs/src/id/util/EZXAP_Net/Net
 /usr/local/apache2/htdocs/src/id/util/EZXAP_FLEX ../util/EZXAP_FLEX
 ../util/EZXAP_Net/Net ../util/EZXAP_Net
 /usr/local/lib/perl5/5.8.8/i686-linux /usr/local/lib/perl5/5.8.8
 /usr/local/lib/perl5/site_perl/5.8.8/i686-linux
 /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl .)
 at /usr/local/apache2/htdocs/src/id/system/test.pl line 118

 For help, please send mail to the webmaster ([EMAIL PROTECTED]), giving
 this error message and the time and date of the error.

 And when I remove the floder LWP in EZXAP_NET,everything is ok.But I
 don't konw why.I think the program use the default LWP package in this
 machine.

 My question is what is cookie_jar.al?Where and When used this file?Is
 this a *temporarily* file?I run find in root directory,but can not
 find this file.It's so puzzled for me.Could anyone kindly answer this
 quesion,Thanks a lot.With Best wishes.

 QQ

 2007-03-29


It is probably a conflict between the default LWP package and your own
LWP package in EZXAP_NET; however, without seeing the code that
generates this error, and without knowing what operating system this is,
it's hard to say what the problem is.





Thanks for your reply.My own LWP package is a lower version than the 
default 
LWP.The operating system is Lunix + Apache.
Could you please tell me what's the usage of the cookie_jar.al? 
I find it from /,but noting could be found.(command:find / -name 
cookie_jar.al)





I don't know what cookie_jar.al is, but it most probably has something 
to do with the Autoloader (perldoc AutoLoader).


Why is it you want to use a lower version of LWP than the system?




Re: LWP problem

2003-07-23 Thread Michael A Chase
On Wed, 23 Jul 2003 06:33:21 - chimni [EMAIL PROTECTED] wrote:

   Firstly , i apologise about mailing you directly rather then using 
 th e list (i have no idea to join this archive).
  I have a problem with HTML::PARSER on hp-ux 11 .This somehow is 
 affecting my scripts that use LWP.
  I noticed a similar problem addressed to you by another 
 user .Therefore ,decide to write to you
 The HTML::Parser build 3.28 gives me the following erros during test
 
 Unrecognized identifier s in argspec at blib/lib/HTML/Parser.pm line 
 75.
 
 Any ideas why this happens.
 Pardon my ignorance ,i am newer than a newbie at this,but even if 
 there is a problem with this module why does it affect LWP.
 (LWP also failed tests with the same error)
 
 and a simple script like using LWP::simple and getting a webpage
 gives the srror 500 unrecognised identifier s in argspec 
 sorry for the bother.

I have forwarded this to [EMAIL PROTECTED]  Please continue there.
Other people in the list may be able to respond better and faster.

For them to help, a snippet from the failing script that demonstrates
the problem would help.  From a cursory look at the line mentioned in
the error, it appears you are passing an invalid argument to
HTML::Parser - new().

-- 
Mac :})
** I usually forward private questions to the appropriate mail list. **
Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.



Re: Fw: LWP Problem: Error: 500 Line too long (limit is 4096) - Thanks!

2002-11-19 Thread poly
Thank you very much for helping me with this problem.  Gisle's 
recommendation to add
push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, MaxLineLength = 16*1024);
saves the day.  Actually, I kept 
push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, MaxLineLength = 0);
because some people at the other end do things you least expect.

The problem was indeed with the headers.  For some reason the script or 
server at the other end was sending back the whole content of the form 
as a Sent header!!!  Something like:
HTTP/1.1 200 OK 
Connection: close 
Date: Tue, 19 Nov 2002 22:28:09 GMT 
Server: Microsoft-IIS/5.0 
Content-Type: text/xml 
Client-Date: Tue, 19 Nov 2002 21:59:42 GMT 
Client-Response-Num: 1 
Sent: xmldata=%3C%3Fxml+version%3D%221.0%22%3F%3E%3Cavailreq%3E%
3Cheader+acctno%3DSOME 12KB OF DATA

Poly
www.netforall.com/Poly/

 email [EMAIL PROTECTED] writes:
 
  I am using LWP to post a form with one pair name1, $value1 to a CGI 
  script. $value1 is very long (8222 bytes), but I can post 
successfully 
  to most servers.  However, it failed on IIS 5 and I receive the 
error:
  500 Line too long (limit is 4096)
 
 The 500 Line too long (limit is 4096) is generated internally in
 Net::HTTP when one of the header lines of the response are longer than
 this.  What is the header value is the server sending back in this
 case?
 
  When I post the form data using a browser like Netscape, or IE, it 
  works, so I suspect there is something that I need to do for LWP to 
  work too.  Probably breaking $value1 into pieces, but I don't see 
how.  
  Specifying a Content_Length header does not help.  My code is 
something 
  like the following. Please let me know if you have any suggestion. 
 
 Try to add this code to your client:
 
 push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, MaxLineLength = 
16*1024);
 
 





Re: Fw: LWP Problem: Error: 500 Line too long (limit is 4096)

2002-11-13 Thread Gisle Aas
email [EMAIL PROTECTED] writes:

 I am using LWP to post a form with one pair name1, $value1 to a CGI 
 script. $value1 is very long (8222 bytes), but I can post successfully 
 to most servers.  However, it failed on IIS 5 and I receive the error:
 500 Line too long (limit is 4096)

The 500 Line too long (limit is 4096) is generated internally in
Net::HTTP when one of the header lines of the response are longer than
this.  What is the header value is the server sending back in this
case?

 When I post the form data using a browser like Netscape, or IE, it 
 works, so I suspect there is something that I need to do for LWP to 
 work too.  Probably breaking $value1 into pieces, but I don't see how.  
 Specifying a Content_Length header does not help.  My code is something 
 like the following. Please let me know if you have any suggestion. 

Try to add this code to your client:

push(@LWP::Protocol::http::EXTRA_SOCK_OPTS, MaxLineLength = 16*1024);



LWP - Problem with parsing IMG tags

2001-06-07 Thread Steve Borruso

Greetings,

Having a problem parsing specific IMG tags from web pages.
Code (see below)  has worked for over a year.
It  parses image tags from specific ebay html pages.
Certain IMG tags are not showing up now (intermittently).
For the same html, sometimes I get all the IMG tags and
sometimes specific ones are missing.
Can't reproduce it with a browser.
Using LWP and HTML::LinkExtor to parse the img tags

I want to capture the HTML page that I'm parsing (within the same
UserAgent request) so I can see the img tag format when they don't
parse.
Have fumbled with several attempts at doing this so far.

Any assistance is most appreciated

Thanks,
Steve

  # Example url
  $itemurl =
'http://cgi.ebay.com/aw-cgi/eBayISAPI.dll?ViewItemitem=1605076637';

  @imgs = ();
  $ua = new LWP::UserAgent;

sub callback {
my($tag, %attr) = @_;
return if $tag ne 'img';  # we only look closer at img ...
push(@imgs, values %attr);
   }

  # Make the parser. Don't know the base yet, might be diff from
$itemurl
  $p = HTML::LinkExtor-new(\callback);

  # Request document and parse it as it arrives
  $res = $ua-request(HTTP::Request-new(GET = $itemurl),
sub{$p-parse($_[0])});

  # Expand all image URLs to absolute ones
  my $base = $res-base;
  @imgs = map { $_ = url($_, $base)-abs; } @imgs;







LWP: problem with HTTP 302 responses setting cookies

2000-11-01 Thread Justin Mason

Hi there,

I'm the author of sitescooper, http://sitescooper.org/ , a GPL'ed perl app
for UNIX, Windows and Macs which snarfs the important bits of news sites
(just the text, skipping ads etc.), and converts the HTML into other
formats for reading offline on e.g. a Palm handheld.

Thanks for LWP... I used to use a homebrew HTTP client lib, but so many
sites used so many features of HTTP (cookies, redirects, etc.) it just
became obvious that LWP was the way to go, and I'm glad I took that route.


Firstly, any chance of a listing on http://www.linpro.no/lwp/ in the
Applications section? cheers ;)


Secondly, I've run into a wee problem (finally, after months of using LWP,
about time too ;).

I subclass LWP::UserAgent and provide an impl of redirect_ok().  This is
necessary to handle rewriting redirected links in the output HTML.

Let's say I go to www.nytimes.com and post a login request to their auth
CGI.  It will respond with: (some headers left out for clarity)

HTTP/1.0 302 Found
Set-cookie: 
NYT-S=1848Snkvy1Q3sLApigKgArhs6g3X6hAB02PkYX0002FlYQWCcCQN5aiV88F/w3O90nieL4ZhdXbf9oOG./AKE9/AYhfJCICzIn;
 expires=Saturday, 30-Oct-2010 22:45:59 GMT; path=/; domain=.nytimes.com
Set-cookie: RDB=C80200494501003C45192701010002; expires=Tuesday, 
30-Jan-2001 22:45:59 GMT; path=/; domain=.nytimes.com
Location: http://www.nytimes.com/2000/11/01/politics/01CND-SPEND.html

Obviously I need to set those cookies to proceed, on both the redirected
request, and further requests to that site.


Since LWP::UserAgent::request() doesn't pass the $response to
redirect_ok(), that method cannot handle the cookies.  I can't see any
other way to do it at the moment.

So, any chance you could do one of the following:

  1. pass $response to redirect_ok(), so user code can implement this

  2. provide a version of LWP::UserAgent::request() that takes a
  cookie_jar argument, and call $cookie_jar-extract_cookies($response);
  and $cookie_jar-add_cookie_header($referral); for redirects.

I guess 1 is the preferred option from the API preservation point of view,
although most users IMHO would expect request() to handle cookies as in 2.

BTW -- if 2 is preferred -- be sure to check $referral_uri is a HTTP URL,
HTTP::Cookies dies on file: URLs due to a call to URI::port().


(in case you're curious: what I'm currently doing now in sitescooper is
implementing my own version of request() which does 2, and is used if
LWP::Version() = 5.47.)

Again, thx for LWP, it's saved me a ton of bother. Looking forward to
LWPng ;)

--j.



RE: LWP - problem with response

2000-07-13 Thread Pramod Sokke

That's what I'm saying too. When I use socket stuff directly, I get a good
response back.
But I'm trying to write a generic API using LWP and it works great for
everything except for this particular ASP script from this company.

At 11:38 AM 7/13/00 +1000, you wrote:
Hmmm.. Ive had a few similar probs in the past but I stumbled across this
bit of code, no idea if it'll help but basically it grabs the entire request
back from an ASP script and chucks it into $return_text, then just use some
reg exps to remove the rubbish, I hope I haven't chopped anything useful
from it, it's being used on a site at the moment so I had to remove the bits
that make it work for that project-

BEN

#!/usr/local/bin/perl

use sigtrap;
use IO::Socket;

$url="http://www.place.com/thing.asp";


my($return_text);
$url =~ m|(http://)?([^/]+)(/?.*)|;
$host = $2;
$uri = $3;
($host, $port) = split(':', $host);
$port = 80 if (!$port);
$remote = IO::Socket::INET-new( Proto = "tcp",
 PeerAddr  = $host,
 PeerPort  = "http($port)",
);
   
$remote-autoflush(1);
print $remote "GET $uri HTTP/1.0" . "\n\n";

while ( $remote ) 
{ 
$return_text .= $_; 
   }
close $remote;
return $return_text;

print "$return_text";
exit;

 -Original Message-
 From: Pramod Sokke [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, 13 July 2000 10:14
 To: [EMAIL PROTECTED]
 Subject: LWP - problem with response
 
 
 Hi,
 
 There is this one ASP script from our client that I'm having problems
 getting a good result back using LWP.
 When I use low-level socket stuff to talk to the script and 
 do a simple
 http GET, it returns a result like :
 HTTP/1.1 200 Successful Membership Update
 Server: Microsoft-IIS/5.0
 Date: Wed, 12 Jul 2000 21:10:09 GMT
 Connection: Keep-Alive
 Content-Length: 0
 Content-Type: text/html
 Cache-control: private
 
 However, when I use LWP to talk to the script, I get a blank response.
 This problem is only with this particular script from this 
 particular client.
 Other ASP and CGI/Perl scripts from other clients return good results.
 
 Is there something that I could be missing on my end or is it 
 possible that
 it's their problem?
 
 Thanks,
 Pramod
 
 



LWP - problem with response

2000-07-12 Thread Pramod Sokke

Hi,

There is this one ASP script from our client that I'm having problems
getting a good result back using LWP.
When I use low-level socket stuff to talk to the script and do a simple
http GET, it returns a result like :
HTTP/1.1 200 Successful Membership Update
Server: Microsoft-IIS/5.0
Date: Wed, 12 Jul 2000 21:10:09 GMT
Connection: Keep-Alive
Content-Length: 0
Content-Type: text/html
Cache-control: private

However, when I use LWP to talk to the script, I get a blank response.
This problem is only with this particular script from this particular client.
Other ASP and CGI/Perl scripts from other clients return good results.

Is there something that I could be missing on my end or is it possible that
it's their problem?

Thanks,
Pramod




(Is this a LWP problem?

2000-02-18 Thread Roy Nasser


Hi,

Here is my code, i am trying to use a hash from a required file but i am not
getting access...

FILE: meta
cut
#!/usr/bin/perl -w

print "Content-type: text/html\n\n";

package myPUA;

use Exporter();
use LWP::Parallel::UserAgent;
@ISA = qw(LWP::Parallel::UserAgent Exporter);
@EXPORT = @LWP::Parallel::UserAgent::EXPORT_OK;

sub on_connect {
my ($self, $request, $response, $entry) = @_;
}

sub on_failure {
my ($self, $request, $response, $entry) = @_;

}

{
 $first = 1;
 sub on_return {
  my ($self, $request, $response, $entry) = @_;
  if ($response-is_success) {
   $content = $response-content;
   main::handle_answer($content,$response);
   $first++;
  }
   return;
 }
}

package main;
use HTTP::Request;
use URI;


my %URL = ();
my %NAME = ();
my %REGEX = ();
my %REG_URL = ();
my %REG_TIT = ();
my %REG_DES = ();
my %RESULTS = ();
my %SHORT_ID = ();
my %RETURNED_URLS = ();
my %DONE = ();
my %REGSPLIT = ();
my %in = ();
my $reqs = "";
my $current = "";
my $req = "";
my $re = "";
my $nores = "";
my $CURRENT_URL = "";
my $CURRENT_CONTENT = "";
my $CURRENT_ID = "";

$| = 1;

ReadParse;
InitEngines;
require "mb1.br.edf";
print $URL{YahooBrasil};
/cut

FILE: mb1.br.edf
cut
#!/usr/bin/perl



 $URL{"YahooBrasil"} =
"http://br.busca.yahoo.com/search/br?p=$main::in{pl}n=".($main::in{me} +
5);
 $NAME{"YahooBrasil"} = "Yahoo Brasil!";
 $REGEX{"YahooBrasil"} = "A HREF=\"(.*?)\"(.*?)/A\n - (.*?)";
 $REGSPLIT{"YahooBrasil"} = "LI";
 $REG_URL{"YahooBrasil"} = 1;
 $REG_TIT{"YahooBrasil"} = 2;
 $REG_DES{"YahooBrasil"} = 3;

$SHORT_ID{"http://br.busca.yahoo.com/search/br?p=$main::in{pl}n=".($main::i
n{me} + 5)} = "YahooBrasil";

1;
/cut




Roy Nasser ([EMAIL PROTECTED])
Diretor T├ęcnico
http://Vem.ca/
+55-11-3347-3011
+55-11-9953-8853 (Cel.)
+55-11-211-0889 (Fax.)