RE: TVGuide

2005-03-28 Thread Thomas, Mark - BLS CTR
I would recommend starting with WWW::Mechanize. It's an easier-to-use layer
on top of LWP with many conveniences for following links, filling out forms,
etc.

Sample code:

use WWW::Mechanize;
my $mech = WWW::Mechanize-new();

$mech-get( $url_to_login_page );

$mech-submit_form(
form_name = 'frmLogin',
fields= { email  = '[EMAIL PROTECTED]', },
);

# Do more stuff, follow links, etc.

# Print the results
print $mech-content;


Hope this helps.
-- Mark.

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On 
 Behalf Of Jerry Kassebaum
 Sent: Monday, March 28, 2005 9:24 AM
 To: perl-win32-users@listserv.ActiveState.com
 Subject: TVGuide
 
 
 I would like to automate tvguide.com.
 
 I have read Spidering Hacks, but I'm stuck.
 
 Here is the form portion of their code that takes my e-mail 
 address for the 
 log-in:
 
 
 
 *
 
 form action=login.asp method=post id=frmLogin name=frmLogin
   tr
   td bgcolor=#EE
   valign=top
   align=left
   style=padding-left:10px; 
 padding-right:5px; padding-top:15px; 
 padding-bottom:8px;
   input id=guid name=returnurl 
 type=hidden value=
   input id=guid name=referrer 
 type=hidden value=
   input id=guid name=regMode 
 type=hidden value=0
 
 
 
   bPlease enter your email address:/bbr
   img src=/images/space.gif width=14 
 height=14br
   INPUT type=text name=email 
 id=email value= size=20 
 style=width:150px
   input  type=image
   name=go
   id=go
   src=/myprofile/images/login.gif
   align=absmiddle
   border=0
   hspace=5
 
   /td
   /tr
 /form
 
 ***
 
 
 
 
 
 
 Here's what I have so far:
 
 
 
 use LWP;
 $browser=LWP::UserAgent-new;
 $url=http://tvguide.com/;;
 $response=$browser-post($url, ['name'='email', 'id'='email', 
 'value'='[EMAIL PROTECTED]',]);
 print$response;
 
 *
 
 
 
 I get: HTTP::Response=HASH(0x2883cb4)
 
 
 Now what?
 
 
 ___
 Perl-Win32-Users mailing list 
 Perl-Win32-Users@listserv.ActiveState.com
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: TVGuide

2005-03-28 Thread Johan Lindstrom
At 16:24 2005-03-28, Jerry Kassebaum wrote:
use LWP;
$browser=LWP::UserAgent-new;
$url=http://tvguide.com/;;
$response=$browser-post($url, ['name'='email', 'id'='email', 
'value'='[EMAIL PROTECTED]',]);
print$response;
What you get back is a HTTP::Response object. Reading the docs for that 
class (perldoc HTTP::Response) says the HTML you want to scrape is in 
$response-content.

Read lwpcook (perldoc lwpcook) to understand the issues at hand, then 
install WWW::Mechanize and read the docs for that module. It's even more 
adapted to being a web browser than LWP::UserAgent and will make your life 
a lot easier.

This is a good (but old) introduction to Mechanize:
http://www.perladvent.org/2002/16th/
/J
 --  --- -- --  --  - - --  -
Johan LindströmSourcerer @ Boss Casinos   johanl AT DarSerMan.com
Latest bookmark: TCP Connection Passing
http://tcpcp.sourceforge.net/
dmoz: /Computers/Programming/Languages/JavaScript/ 12
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: TVGuide

2005-03-28 Thread Thomas, Mark - BLS CTR
I should have also mentioned the XMLTV project
(http://sourceforge.net/projects/xmltv) which is a very popular project for
retrieving TV data. The backend, written in Perl, grabs TV data and formats
it into XML. It is used in PVR software such as MythTV. There are many
front-ends, too, such as TVGuide for Windows
(http://tvguide.sourceforge.net/) and others written in Perl and other
languages (check out the Related Projects section of
http://membled.com/work/apps/xmltv/)

Depending on your needs, your work may already be done!

-- Mark. 

 
  -Original Message-
  From: Jerry Kassebaum
  
  I would like to automate tvguide.com.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs