[29822] in Perl-Users-Digest
Perl-Users Digest, Issue: 1065 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 26 14:14:21 2007
Date: Mon, 26 Nov 2007 11:14:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 26 Nov 2007 Volume: 11 Number: 1065
Today's topics:
Re: Script to disconnect Linksys WRT54G wireless router <davewilson69@sbcglobal.net>
Re: Script to disconnect Linksys WRT54G wireless router <davewilson69@sbcglobal.net>
Re: Script to disconnect Linksys WRT54G wireless router <ben@morrow.me.uk>
Re: Script to disconnect Linksys WRT54G wireless router <davewilson69@sbcglobal.net>
Re: Spidering Hacks <s.denaxas@gmail.com>
Re: Spidering Hacks <alexxx.magni@gmail.com>
Re: Spidering Hacks <spamtrap@dot-app.org>
Re: Spidering Hacks <alexxx.magni@gmail.com>
Re: Spidering Hacks <ben@morrow.me.uk>
Re: Spidering Hacks <spamtrap@dot-app.org>
Re: Spidering Hacks <alexxx.magni@gmail.com>
Re: Spidering Hacks <spamtrap@dot-app.org>
ST <ryoung@medicalpharmacies.com>
Re: ST <jurgenex@hotmail.com>
Re: ST <uri@stemsystems.com>
Re: ST <bik.mido@tiscalinet.it>
Re: ST <simon.chao@fmr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 26 Nov 2007 05:41:09 -0800
From: Wilson <davewilson69@sbcglobal.net>
Subject: Re: Script to disconnect Linksys WRT54G wireless router on Windows
Message-Id: <k3A2j.3095$fl7.1885@newssvr22.news.prodigy.net>
>> Can you post any working Perl script?
> I'll see if we have it saved somewhere.
I think I've narrowed down the problem to the acceptance of the Linksys
security certificate when the Linksys WRT54G router is first contacted.
The way I tested that was to set it to http instead of https in the router
configuration. Just a few more tries before I give up totally on Perl and
go with something else.
------------------------------
Date: Mon, 26 Nov 2007 14:37:09 GMT
From: Wilson <davewilson69@sbcglobal.net>
Subject: Re: Script to disconnect Linksys WRT54G wireless router on Windows
Message-Id: <pSA2j.27042$lD6.13863@newssvr27.news.prodigy.net>
On Mon, 26 Nov 2007 05:41:09 -0800, Wilson wrote:
> The way I tested that was to set it to http instead of https
Drat. Failed again.
Does anyone know what a "read timeout" is telling me?
Wilson
C:\perl>fixrouter.pl
500 read timeout
Content-Type: text/plain
Client-Date: Mon, 26 Nov 2007 14:17:22 GMT
Client-Warning: Internal response
500 read timeout
------------------------------
Date: Mon, 26 Nov 2007 15:17:00 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Script to disconnect Linksys WRT54G wireless router on Windows
Message-Id: <ck4r15-m3b.ln1@osiris.mauzo.dyndns.org>
[f'ups set to clpm. Please stop cross-posting everything.]
Quoth Wilson <davewilson69@sbcglobal.net>:
> On Mon, 26 Nov 2007 05:41:09 -0800, Wilson wrote:
> > The way I tested that was to set it to http instead of https
>
> Drat. Failed again.
> Does anyone know what a "read timeout" is telling me?
>
> C:\perl>fixrouter.pl
> 500 read timeout
> Content-Type: text/plain
> Client-Date: Mon, 26 Nov 2007 14:17:22 GMT
> Client-Warning: Internal response
>
> 500 read timeout
The Client-Warning says this response is faked by LWP, and the message
says that, well, a read timed out. The server isn't responding
sufficiently promptly: set a longer timeout with $ua->timeout, or find
out why it's failing to respond.
Ben
------------------------------
Date: Mon, 26 Nov 2007 18:00:12 GMT
From: Wilson <davewilson69@sbcglobal.net>
Subject: Re: Script to disconnect Linksys WRT54G wireless router on Windows
Message-Id: <MQD2j.20703$4V6.20093@newssvr14.news.prodigy.net>
On Mon, 26 Nov 2007 15:17:00 +0000, Ben Morrow wrote:
> The Client-Warning says this response is faked by LWP, and the message
> says that, well, a read timed out. The server isn't responding
> sufficiently promptly: set a longer timeout with $ua->timeout, or find
> out why it's failing to respond.
Since it takes a good minute or two to timeout, I suspect it's the former
and not the latter. I think the server isn't responding. Dunno why yet.
When I telnet to the router's port 80 (with https disabled), I can *talk*
to the Linksys WRT54G router, for example
c:\perl> telnet 192.168.0.1 80
HEAD / HTTP/1.0 <return><return>
Going further, I can "access" the desired web page
c:\perl> telnet 192.168.0.1 80
GET /StaRouter.htm HTTP/1.0 <return><return>
Which spits out:
HTTP/1.0 401 Unauthorized Access Denied
Server: Intoto Http Server v1.0
WWW-Authenticate: Basic realm="WRT54G"
Content-type: text/html
Pragma: no-cache
Connection: Close
<HTML><HEAD><TITLE>401 Unauthorized</TITLE></HEAD>
<BODY BGCOLOR="#cc9999"><H4>401 Unauthorized</H4>
Authorization required.
</BODY></HTML>
So, I think I'll look up the commands to log into the router using telnet
to port 80. If that works, I can write a telnetrc script. I'm no
programmer, but, I really hate to lose something that should be as simple
as a few lines of code.
Wilson
Connection to host lost.
C:\Documents and Settings\admin>
------------------------------
Date: Mon, 26 Nov 2007 05:17:44 -0800 (PST)
From: Spiros Denaxas <s.denaxas@gmail.com>
Subject: Re: Spidering Hacks
Message-Id: <d174974b-ee07-46d6-8a55-f012116744c4@r31g2000hsg.googlegroups.com>
On Nov 26, 10:28 am, "alexxx.ma...@gmail.com" <alexxx.ma...@gmail.com>
wrote:
> Working on a project for a spider able to gather info for my books
> list,
> I read a bit of "Spidering Hacks" (OReilly) - which fortunately is all
> in Perl.
>
> I was deciding to use the Google API, so I looked also to "Google
> Hacks".
>
> Up to now I never registered for a Google API, so when going to the
> place suggested by the book (http://www.google.com/apis/download.html)
> I was redirected tohttp://code.google.com, where a huge number of
> possible APIs are present.
>
> Do you know where I have to look, to simply obtain the (authorization?
> key?) to use the Google search api?
>
> thanks!
>
> Alessandro
Hi,
which API does the book prompt you to use? AFAIK, Google has both a
SOAP and an AJAX version of their search API.
Their SOAP API is no longer open to new registrations and thus cannot
be used (unless of course you already have an SOAP API code).
The AJAX API page can be found at : http://code.google.com/apis/ajaxsearch/
You can register for a key at : http://code.google.com/apis/ajaxsearch/signup.html
Hope this helps,
Spiros
ps. You might also want to check out the GoogleHack proect,
http://google-hack.sourceforge.net/
------------------------------
Date: Mon, 26 Nov 2007 05:48:58 -0800 (PST)
From: "alexxx.magni@gmail.com" <alexxx.magni@gmail.com>
Subject: Re: Spidering Hacks
Message-Id: <0841ed26-7c54-4458-a314-7ddec328a7b5@s12g2000prg.googlegroups.com>
From what I just read, SOAP was just what I needed - if only I had a
key, which I havent.
And AYAX if Javascript only, right? So I'm out of luck, with Perl -
damn!
Thank you for your help...
Alessandro
Spiros Denaxas ha scritto:
> On Nov 26, 10:28 am, "alexxx.ma...@gmail.com" <alexxx.ma...@gmail.com>
> wrote:
> > Working on a project for a spider able to gather info for my books
> > list,
> > I read a bit of "Spidering Hacks" (OReilly) - which fortunately is all
> > in Perl.
> >
> > I was deciding to use the Google API, so I looked also to "Google
> > Hacks".
> >
> > Up to now I never registered for a Google API, so when going to the
> > place suggested by the book (http://www.google.com/apis/download.html)
> > I was redirected tohttp://code.google.com, where a huge number of
> > possible APIs are present.
> >
> > Do you know where I have to look, to simply obtain the (authorization?
> > key?) to use the Google search api?
> >
> > thanks!
> >
> > Alessandro
>
> Hi,
>
> which API does the book prompt you to use? AFAIK, Google has both a
> SOAP and an AJAX version of their search API.
> Their SOAP API is no longer open to new registrations and thus cannot
> be used (unless of course you already have an SOAP API code).
>
> The AJAX API page can be found at : http://code.google.com/apis/ajaxsearch/
> You can register for a key at : http://code.google.com/apis/ajaxsearch/signup.html
>
> Hope this helps,
>
> Spiros
>
> ps. You might also want to check out the GoogleHack proect,
> http://google-hack.sourceforge.net/
------------------------------
Date: Mon, 26 Nov 2007 09:13:46 -0500
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: Spidering Hacks
Message-Id: <m1prxxjdr9.fsf@dot-app.org>
"alexxx.magni@gmail.com" <alexxx.magni@gmail.com> writes:
> Do you know where I have to look, to simply obtain the (authorization?
> key?) to use the Google search api?
The same place you'd look to use their API from Ruby, Python, etc.
Did you have a Perl question?
sherm--
--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Mon, 26 Nov 2007 06:48:53 -0800 (PST)
From: "alexxx.magni@gmail.com" <alexxx.magni@gmail.com>
Subject: Re: Spidering Hacks
Message-Id: <9d791873-31f3-479f-9fa7-00f3fd6e4a7b@n20g2000hsh.googlegroups.com>
Yes, I had it, and other people kindly answered it.
Seriously, however, I don't see the reason for such narrowness of
mind...
I documented myself on Spidering Hacks, a Perl-only book on such kind
of programs, and intended to find a way to develop my own using a
Google <Perl> API.
If you believe this group forbids this kind of questions, it's your
opinion, and yours only
Best regards
Alessandro
Sherman Pendley ha scritto:
> "alexxx.magni@gmail.com" <alexxx.magni@gmail.com> writes:
>
> > Do you know where I have to look, to simply obtain the (authorization?
> > key?) to use the Google search api?
>
> The same place you'd look to use their API from Ruby, Python, etc.
>
> Did you have a Perl question?
>
> sherm--
>
> --
> WV News, Blogging, and Discussion: http://wv-www.com
> Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Mon, 26 Nov 2007 15:21:44 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Spidering Hacks
Message-Id: <8t4r15-m3b.ln1@osiris.mauzo.dyndns.org>
[top-posting fixed. don't do that]
Quoth "alexxx.magni@gmail.com" <alexxx.magni@gmail.com>:
> Sherman Pendley ha scritto:
> > "alexxx.magni@gmail.com" <alexxx.magni@gmail.com> writes:
> >
> > > Do you know where I have to look, to simply obtain the (authorization?
> > > key?) to use the Google search api?
> >
> > The same place you'd look to use their API from Ruby, Python, etc.
> >
> > Did you have a Perl question?
>
<snip>
> If you believe this group forbids this kind of questions, it's your
> opinion, and yours only
It's not Sherm's opinion only; see the section in the Posting Guidelines
called 'Question should be about Perl, not about the application area'.
Those guidelines were drawn up by general consensus among the regulars
here.
Ben
------------------------------
Date: Mon, 26 Nov 2007 11:27:11 -0500
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: Spidering Hacks
Message-Id: <m1d4txj7kw.fsf@dot-app.org>
"alexxx.magni@gmail.com" <alexxx.magni@gmail.com> writes:
Upside-down, and quoting signatures. Please don't do that. Have you read
the posting guidelines that appear here frequently?
> Sherman Pendley ha scritto:
>
>> "alexxx.magni@gmail.com" <alexxx.magni@gmail.com> writes:
>>
>> > Do you know where I have to look, to simply obtain the (authorization?
>> > key?) to use the Google search api?
>>
>> The same place you'd look to use their API from Ruby, Python, etc.
>>
>> Did you have a Perl question?
>
> Yes, I had it, and other people kindly answered it.
Yes, but that was another thread - and I was one of those people. :-)
My point was that the question in *this* thread has nothing to do with Perl.
Ruby, Python, C, Java, or any other programmers all obtain their Google keys
the same way - the procedure for doing so has nothing whatsoever to do with
the language with which you intend to use it.
> Seriously, however, I don't see the reason for such narrowness of
> mind...
It's simple. There are many Perl programmers here, and only a small subset
of us may have used Google's API. But, there's nothing Perl-specific about
obtaining a key; a programmer who's done so to use the key in his Ruby app
could help you just as well as anyone here.
By asking your Google questions in a language-neutral forum that's dedicated
to such questions, and your Perl questions in a forum that's dedicated to
those, you increase your chances of getting an answer.
> If you believe this group forbids this kind of questions, it's your
> opinion, and yours only
Actually, it's not. It's the group consensus, as documented in the posting
guidelines that appear here frequently. Have you read them?
sherm--
--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Mon, 26 Nov 2007 09:08:02 -0800 (PST)
From: "alexxx.magni@gmail.com" <alexxx.magni@gmail.com>
Subject: Re: Spidering Hacks
Message-Id: <938dfff1-fdd0-4191-b717-1d964feab44a@b40g2000prf.googlegroups.com>
On 26 Nov, 17:27, Sherman Pendley <spamt...@dot-app.org> wrote:
> "alexxx.ma...@gmail.com" <alexxx.ma...@gmail.com> writes:
>
> Upside-down, and quoting signatures. Please don't do that. Have you read
> the posting guidelines that appear here frequently?
>
> > Sherman Pendley ha scritto:
>
> >> "alexxx.ma...@gmail.com" <alexxx.ma...@gmail.com> writes:
>
> >> > Do you know where I have to look, to simply obtain the (authorization?
> >> > key?) to use the Google search api?
>
> >> The same place you'd look to use their API from Ruby, Python, etc.
>
> >> Did you have a Perl question?
>
> > Yes, I had it, and other people kindly answered it.
>
> Yes, but that was another thread - and I was one of those people. :-)
>
> My point was that the question in *this* thread has nothing to do with Perl.
> Ruby, Python, C, Java, or any other programmers all obtain their Google keys
> the same way - the procedure for doing so has nothing whatsoever to do with
> the language with which you intend to use it.
>
> > Seriously, however, I don't see the reason for such narrowness of
> > mind...
>
> It's simple. There are many Perl programmers here, and only a small subset
> of us may have used Google's API. But, there's nothing Perl-specific about
> obtaining a key; a programmer who's done so to use the key in his Ruby app
> could help you just as well as anyone here.
>
> By asking your Google questions in a language-neutral forum that's dedicated
> to such questions, and your Perl questions in a forum that's dedicated to
> those, you increase your chances of getting an answer.
Probably then it's my mistake.
I often asked for help/advice in this group, since I use Perl heavily,
and it seldom let me down - I used to feel rather at home here.
Granted, I agree that my question was not related to <perl> per se,
but to a <perl API>, but I failed to see it as a big problem - I wasnt
spamming (I posted on comp.lang.perl.misc only) and I believed the
*misc leaf allowed this.
Alessandro
> > If you believe this group forbids this kind of questions, it's your
> > opinion, and yours only
>
> Actually, it's not. It's the group consensus, as documented in the posting
> guidelines that appear here frequently. Have you read them?
>
> sherm--
------------------------------
Date: Mon, 26 Nov 2007 14:07:58 -0500
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: Spidering Hacks
Message-Id: <m1myt0j04x.fsf@dot-app.org>
"alexxx.magni@gmail.com" <alexxx.magni@gmail.com> writes:
> Probably then it's my mistake.
Don't lose sleep over it - it wasn't a very big one. :-)
> I often asked for help/advice in this group, since I use Perl heavily,
> and it seldom let me down - I used to feel rather at home here.
Please feel free to continue feeling that way! Granted, my first "did you
have a Perl question" was kind of snarky, and I apologize for that. But I
honestly intended to be helpful - it's my opinion that choosing the right
group for a question is as critical a research skill as choosing the right
keywords for a Google search.
sherm--
--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Mon, 26 Nov 2007 08:28:16 -0800 (PST)
From: tekwiz <ryoung@medicalpharmacies.com>
Subject: ST
Message-Id: <91b6926f-5506-4183-92ed-c4ccdb080995@s6g2000prc.googlegroups.com>
I'm trying to make the sort criteria for an ST variable. If I preset a
variable to the required information as in:
my $SortC = "$a->[$FIELD1] <=> $b->[$FIELD1]
||
$a->[$FIELD25] cmp $b->[$FIELD25]";
and then set the ST to :
my @SA = map { $_->[0] }
sort { $SortC }
map { [$_, split(/\|/)] } @A;
It will return Sort does not return a numeric value.; However, if I
statically set the sort strings above it works. Any ideas on how to
make it variable "on the fly".
------------------------------
Date: Mon, 26 Nov 2007 16:42:08 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: ST
Message-Id: <AHC2j.13207$r81.3868@trndny05>
tekwiz wrote:
> I'm trying to make the sort criteria for an ST variable.
Stupid question: what is an ST variable?
I only recall ST being used as in Atari ST but never in connection with a
variable.
jue
------------------------------
Date: Mon, 26 Nov 2007 17:19:39 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: ST
Message-Id: <x7ir3oapqt.fsf@mail.sysarch.com>
>>>>> "t" == tekwiz <ryoung@medicalpharmacies.com> writes:
t> I'm trying to make the sort criteria for an ST variable. If I preset a
t> variable to the required information as in:
t> my $SortC = "$a->[$FIELD1] <=> $b->[$FIELD1]
t> ||
t> $a->[$FIELD25] cmp $b->[$FIELD25]";
why are those quotes there? where did you ever get the idea that you can
just pass around a string of code and have it magically execute?
t> and then set the ST to :
t> my @SA = map { $_->[0] }
t> sort { $SortC }
that is sorting based on a fixed string which is always true. your sort
results will have nothing to do with the data.
if you want to make an ST sort (or the faster GRT) use Sort::Maker. you
can even print out the generated sort code so you can learn from it.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Mon, 26 Nov 2007 18:50:06 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: ST
Message-Id: <0n1mk311rb038a6dc3n8djtc6h38b429si@4ax.com>
On Mon, 26 Nov 2007 08:28:16 -0800 (PST), tekwiz
<ryoung@medicalpharmacies.com> wrote:
>I'm trying to make the sort criteria for an ST variable. If I preset a
>variable to the required information as in:
>
>my $SortC = "$a->[$FIELD1] <=> $b->[$FIELD1]
> ||
> $a->[$FIELD25] cmp $b->[$FIELD25]";
Huh?!? You're putting a STRING in $SortC
>
>and then set the ST to :
>
>my @SA = map { $_->[0] }
> sort { $SortC }
You're somehow expecting the code that "by pure chance" happens to be
in $SortC to be eval()uated. That's not the case. Do a favour to
yourself and re-read
perldoc -f sort
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Mon, 26 Nov 2007 10:50:08 -0800 (PST)
From: nolo contendere <simon.chao@fmr.com>
Subject: Re: ST
Message-Id: <095ffc28-7208-4b50-b413-60f94836e1b2@b15g2000hsa.googlegroups.com>
On Nov 26, 11:42 am, "J=FCrgen Exner" <jurge...@hotmail.com> wrote:
> tekwiz wrote:
> > I'm trying to make the sort criteria for an ST variable.
>
> Stupid question: what is an ST variable?
> I only recall ST being used as in Atari ST but never in connection with a
> variable.
>
You may have already figured this out by now, but in case you haven't:
ST in this context refers to Schwartzian Transform.
------------------------------
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 V11 Issue 1065
***************************************