Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm writing an application that will allow someone to log-in to their excite.com homepage and display the headlines and stuff like that for them on a palm pilot. I was wondering if anyone could point me in the direction of a tutorial on how to do this with LWP, as well as answer a few questions:

Do I have to know what cookies the excite.com page is setting to the browser and then set those cookies with my script, or can I pull up that portion of the homepage to set the cookies for me? I plan on having a "log-in" page where users would have to set their information which would then be submitted to the script to log-in to the actual excite.com page.

Thanks in advance
Jason H.

  • Comment on Using LWP to log-in to an external website

Replies are listed 'Best First'.
Re: Using LWP to log-in to an external website
by $code or die (Deacon) on Jan 06, 2001 at 23:39 UTC
    Hi,

    I don't think you will get much help here for this type of question. If you look at the responses to this recent node, you will see why.

    This can be done with LWP and the information needed is in the LWP modules docs. However, I wouldn't use your site for numerous security reasons. If your script is for personal use, I am sure that there are a few people who could help.
      it's for me to check news headlines at excite.com with my palm pilot.

      I realize it must be scary to think that someone could steal your excite.com username/password and know what stocks you own but I think most people would be willing to chance it.

Re: Using LWP to log-in to an external website
by btrott (Parson) on Jan 07, 2001 at 00:24 UTC
    I know this doesn't help in your quest, but... why don't you just use Excite Mobile?

    Some problems w/ your scheme:

    • You're going to find it difficult to get Excite cookies for yourself, unless you have an Excite domain. :) The browser simply won't send them to you.

    • As far as I know Excite doesn't provide any simple methods of authenticating against their user database, from an outside service. You'd have to send a request like their login page does and then do something with the result, which would probably be either a redirect to the start page or a "failed" page.
Re: Using LWP to log-in to an external website
by ichimunki (Priest) on Jan 07, 2001 at 04:46 UTC
    You can use the UserAgent module to feed your existing cookies out to the correct websites (as far as I know). So if the cookie is persistent, just might try the CookieJar (i think) method to point to where the cookie resides.

    If that doesn't work or the cookie expires after each session, then your Perl script needs to login. You just need to look at what their login form is sending in for authentication and mimic that. The UserAgent can handle both POST and GET requests.

    In this case, I think the perldocs for the module are pretty good (even I understood them) and you should give them a real good eyeballing, since they will probably answer your questions.