On 5/22/07, Christian Luginbuehl <> wrote:
> > That's the thing, I've tried that but I can't find 'sign in' 'sign out'
> > or the my username, which usually appears in the top right. Also, I've
> > tried looking at the pade via IE after I've run the code, and that says
> > I'm not signed in as well.
> >
> > Any ideas?
>
> Check if there is a cookie involved that stores your session. As far as
> I understand the HTTP protocol, it is possible that WP is sending you a
> redirect together with your session cookie, which it expects to be sent
> back when (automatically) trying to GET the MainPage.
>
> It is just an idea, I never looked at the login process of WP and
> neither fully understand how much of the cookie handling is done for you
> with the Net::HTTP module.
I'm pretty sure that mediawiki (the software behind wikipedia) does in
fact use a cookie for authorization. It's been a while since I looked
at the code.
The OP might want to have a look at the pywikipediabot framework and
see how they do it. This is the 'official' bot framework for
wikipedia. It's written in python as the name would indicate, but
python code isn't THAT hard to read. <G>
It would be cool if there were a ruby equivalent to pywikipedia.
--
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/