[26172] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8361 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 26 14:05:28 2005

Date: Fri, 26 Aug 2005 11:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 26 Aug 2005     Volume: 10 Number: 8361

Today's topics:
        LWP user agent query <iss025@bangor.ac.uk>
    Re: LWP user agent query <1usa@llenroc.ude.invalid>
    Re: LWP user agent query <iss025@bangor.ac.uk>
    Re: LWP user agent query <iss025@bangor.ac.uk>
    Re: LWP user agent query <no@email.com>
        posting 20050826 xiang_g@40networks.com
    Re: Using Crypt::DSA <mikef@brillig.security.berkeley.edu>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 26 Aug 2005 14:40:47 +0100
From: "P.R.Brady" <iss025@bangor.ac.uk>
Subject: LWP user agent query
Message-Id: <430F1BDF.7010506@bangor.ac.uk>

I tried my web crawler/link checker on a neighbour's site and found 
problems with the button top right entitled 'cymraeg' in this page (and 
the same button on  others): 
http://www.anglesey.gov.uk/english/community/health/smoke-free/smoke-free.htm

I think I need to extract the url:
http://www.anglesey.gov.uk/cgi-bin/change_language.asp?language=cymraeg
for the get as in the following code but I am getting 404 not found 
returned.

Internet Explorer seems very happy with the button and returns the Welsh 
version, but Netscape 7 is not entirely happy with it either.

Where is the problem?   My hand extraction of the target url, the code 
below or an issue in the host?

Regards
Phil



use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Response;
use HTML::TokeParser;

my $referer= 
'http://www.anglesey.gov.uk/english/community/health/smoke-free/smoke-free.htm';
my $url= 
'http://www.anglesey.gov.uk/cgi-bin/change_language.asp?language=cymraeg';

#open the browser
my $browser = LWP::UserAgent->new;
$browser->timeout(30);

my $response = $browser->get($url,
         Referer =>  $referer,
         'User-Agent' => 'Mozilla/7. [en] (Win98; U)',
         'Accept'  => 'text/html, image/gif, image/x-xbitmap, 
image/jpeg, image/pjpeg, image/png, */*',
         'Accept-Charset' => 'ISO-8859-1, *, utf-8',
         'Accept-Language' => 'cy, en, en-GB',
         'media-range' => '*/*',
         'max-redirect' => '70',
        );

my $status= $response->status_line;

print "Status=$status\n";

my $base =  $response->base;
print "Base=$base\n";
if  ($response->is_success) {
     print "Show data?";
     $_= <STDIN>;
     if (/y/i){
         my $doc = $response -> content;
         print "$doc\n";
     }
}
exit;



------------------------------

Date: Fri, 26 Aug 2005 14:13:31 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: LWP user agent query
Message-Id: <Xns96BE680356C24asu1cornelledu@127.0.0.1>

"P.R.Brady" <iss025@bangor.ac.uk> wrote in
news:430F1BDF.7010506@bangor.ac.uk: 

> I tried my web crawler/link checker on a neighbour's site and found 
> problems with the button top right entitled 'cymraeg' in this page
> (and the same button on  others): 
> http://www.anglesey.gov.uk/english/community/health/smoke-free/smoke-
> free.htm 
> 
> I think I need to extract the url:
> http://www.anglesey.gov.uk/cgi-bin/change_language.asp?
> language=cymraeg
> for the get as in the following code but I am getting 404 not found 
> returned.
> 
> Internet Explorer seems very happy with the button and returns the
> Welsh version, but Netscape 7 is not entirely happy with it either.

Clicking on the link in Firefox re-directs me to http://www.cos.com/

I am inclined to think this is a case of either bad HTML or bad ASP 
programming, and thus off-topic here.

Sinan
-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


------------------------------

Date: Fri, 26 Aug 2005 16:28:36 +0100
From: "P.R.Brady" <iss025@bangor.ac.uk>
Subject: Re: LWP user agent query
Message-Id: <430F3524.3060409@bangor.ac.uk>

P.R.Brady wrote:
> I tried my web crawler/link checker on a neighbour's site ..

many thanks both.  Set my mind at rest!

Phil



------------------------------

Date: Fri, 26 Aug 2005 16:40:37 +0100
From: "P.R.Brady" <iss025@bangor.ac.uk>
Subject: Re: LWP user agent query
Message-Id: <430F37F5.9040702@bangor.ac.uk>

Alan J. Flavell wrote:
> On Fri, 26 Aug 2005, P.R.Brady wrote:
> 
> 
>>I tried my web crawler/link checker on a neighbour's site and found problems
>>with the button top right entitled 'cymraeg' in this page (and the same button
>>on  others):
>>http://www.anglesey.gov.uk/english/community/health/smoke-free/smoke-free.htm
> 
> 
> As soon as I click it, my browser throws an alert telling me that 
> the site wants to set a cookie.  
> However, even if I respond by allowing session cookies, I get an
> error alert, telling me that "community could not be found".
> 
> 
>>Internet Explorer seems very happy with the button and returns the Welsh
>>version, but Netscape 7 is not entirely happy with it either.
> 
> 
> That sounds ominouosly like the all too prevalent situation of a web 
> page that's been designed to work only with the operating system 
> compoment that thinks it's a browser, but not with a www-compatible 
> client agent.
> 
> 
>>I think I need to extract the url:
>>http://www.anglesey.gov.uk/cgi-bin/change_language.asp?language=cymraeg
>>for the get as in the following code but I am getting 404 not found
>>returned.
> 
> 
> You've worked that out from the 'form method="GET" ...' which is used
> to implement this switch, right?
> 


That's right, but IE shows
http://www.anglesey.gov.uk/cgi-bin/change_language.asp?language=cymraeg&x=26&y=11
in it's url bar after successfully extracting the Welsh page.  Adding 
the x and y don't help the perl reader.

We're no fans of IE and MS web products here either.

Phil



------------------------------

Date: Fri, 26 Aug 2005 17:21:19 +0100
From: Brian Wakem <no@email.com>
Subject: Re: LWP user agent query
Message-Id: <3n8trvFeajlU1@individual.net>

P.R.Brady wrote:

> I tried my web crawler/link checker on a neighbour's site and found
> problems with the button top right entitled 'cymraeg' in this page (and
> the same button on  others):
>
http://www.anglesey.gov.uk/english/community/health/smoke-free/smoke-free.htm
> 
> I think I need to extract the url:
> http://www.anglesey.gov.uk/cgi-bin/change_language.asp?language=cymraeg
> for the get as in the following code but I am getting 404 not found
> returned.
> 
> Internet Explorer seems very happy with the button and returns the Welsh
> version, but Netscape 7 is not entirely happy with it either.
> 
> Where is the problem?   My hand extraction of the target url, the code
> below or an issue in the host?
> 
> Regards


All UK government website are poorly written by 10-a-penny frontpage
monkeys.  I had the misfortune of automating some processes through one
particular government website.  They told me before I started that the site
would only work in IE.  Well it didn't work very well in IE and produced
random errors all over the place.  Eventually I gave up and told them to
fix their site before I would try again.

  

-- 
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png


------------------------------

Date: Fri, 26 Aug 2005 10:10:59 PDT
From: xiang_g@40networks.com
Subject: posting 20050826
Message-Id: <430f4d23.comp.lang.perl.misc@mail2>

"Right," Joshua said. "But you don't know the exact process."
"Where are you?" Miranda said. "Are you in LA?"
"We don't know that," Carl said.
"Joshua," I called.


------------------------------

Date: Fri, 26 Aug 2005 16:13:25 +0000 (UTC)
From: Mike Friedman <mikef@brillig.security.berkeley.edu>
Subject: Re: Using Crypt::DSA
Message-Id: <denf35$no7$1@agate.berkeley.edu>

Sisyphus <sisyphus1@nomail.afraid.org> wrote:
> 
> "Mike Friedman" <mikef@brillig.security.berkeley.edu> wrote in message
> 
>>
>> So, once again, assuming I've signed a message, creating a signature
>> object, how do I write that signature to a file so it can be used
>> as input to a verify script?
>>
> 
> It may simply be that you failed to bless() the key and signature
> retrieved from file. Here's a script that writes to file, then reads
> from that file and verifies the message using information obtained only
> from that file:
> ...

Rob,

Looking at your sample script (but not yet having tried it), it seems that
it will work (and is quite educational, in fact).  However, I still have a
concern, which has to do with how I intend to use my scripts.

I want to be able to create a public key file and a signature in formats
that can be distributed to a user community whose applications may be
using other DSA implementations (e.g., Java crypto lib, or other scripting
languages besides perl).  So, it's important that the public key file be
in a reasonably standard format.  Also, I'd be passing the signature as
a base64-encoded string via a web form field.  Once the application
base64-decodes it, the signature should be in a format easily fed to its
DSA verify routine.

I'm thinking of how other products, like SSH, do this sort of thing,
with my main focus being on how various DSA implementations do signature
verification.

Thanks.

Mike


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 8361
***************************************


home help back first fref pref prev next nref lref last post