# Code to login into any account with login and passport

**URL:** <https://www.ruby-forum.com/t/code-to-login-into-any-account-with-login-and-passport/90523>\
**Category:** Ruby\
**Created:** [March 29, 2007, 4:17pm UTC](https://www.ruby-forum.com/t/code-to-login-into-any-account-with-login-and-passport/90523 "2007-03-29T16:17:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sachin\_Gadkar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c0e974/32.png) [@Sachin\_Gadkar](https://www.ruby-forum.com/u/Sachin_Gadkar)\
**Post date:** [March 29, 2007, 4:17pm UTC](https://www.ruby-forum.com/t/code-to-login-into-any-account-with-login-and-passport/90523/1 "2007-03-29T16:17:07Z")

</div>

Hi Ruby\_pals,  
Say, I have login and password for an account.  
Is it possible to get logged into it through a ruby code.

Kindly suggest, ways.

–  
removed\_email\_address@domain.invalid

URL : [http://nichas143.tripod.com](http://nichas143.tripod.com)

---

<div class="post-metadata">

**Author:** ![Sachin\_Gadkar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c0e974/32.png) [@Sachin\_Gadkar](https://www.ruby-forum.com/u/Sachin_Gadkar)\
**Post date:** [March 29, 2007, 9:04pm UTC](https://www.ruby-forum.com/t/code-to-login-into-any-account-with-login-and-passport/90523/2 "2007-03-29T21:04:18Z")

</div>

Sachin Gadkar wrote:

> Hi Ruby\_pals,  
> Say, I have login and password for an account.  
> Is it possible to get logged into it through a ruby code.

One way is to use scRUBYt!:

==========================================================  
rubyforge\_data = Scrubyt::Extractor.define do  
fetch ‘[http://rubyforge.org/](http://rubyforge.org/)’  
click\_link ‘Log In’  
fill\_textfield ‘form\_loginname’, ‘_login\_here_’  
fill\_textfield ‘form\_pw’, ‘_pass\_here_’  
submit 0

stuff ‘My Personal Page’

# end

Or you can use WWW::Mechanize (scRUBYt! is also built on Mechanize) to  
do the same thing. If you would like to also scrape something there, I  
would suggest scRUBYt!, otherwise Mechanize is the way to go.

Cheers,  
Peter  
\_  
[http://www.rubyrailways.com](http://www.rubyrailways.com) :: Ruby and Web2.0 blog  
[http://scrubyt.org](http://scrubyt.org) :: Ruby web scraping framework  
[http://rubykitchensink.ca/](http://rubykitchensink.ca/) :: The indexed archive of all things Ruby

---

<div class="post-metadata">

**Author:** ![Sachin\_Gadkar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c0e974/32.png) [@Sachin\_Gadkar](https://www.ruby-forum.com/u/Sachin_Gadkar)\
**Post date:** [March 29, 2007, 9:06pm UTC](https://www.ruby-forum.com/t/code-to-login-into-any-account-with-login-and-passport/90523/3 "2007-03-29T21:06:28Z")

</div>

On Thu, Mar 29, 2007 at 11:16:20PM +0900, Sachin Gadkar wrote:

> Hi Ruby\_pals,  
> Say, I have login and password for an account.  
> Is it possible to get logged into it through a ruby code.
> 
> Kindly suggest, ways.

I kindly suggest that you ask your question in a more specific way.

“An account” could mean a zillion things. A Windows account? A Unix  
account?  
A Cisco router login? A bank account? The question is meaningless as it  
stands.

If you phrased the question as: “I have a login and password for an  
account  
on a Unix machine which I can access via telnet or ssh. Is there a Ruby  
client for either of these protocols?” then it would be specific. On the  
other hand, taking 30 seconds of your time to enter the keywords into  
Google  
would immediately give you the answer you are looking for. Not doing  
this  
just gives the impression that you can’t be bothered to think for  
yourself.

For advice on ways to get better answers from mailing lists, try reading  
[http://www.catb.org/~esr/faqs/smart-questions.html#intro](http://www.catb.org/~esr/faqs/smart-questions.html#intro)

Regards,

Brian.

---

<div class="post-metadata">

**Author:** ![Sachin\_Gadkar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c0e974/32.png) [@Sachin\_Gadkar](https://www.ruby-forum.com/u/Sachin_Gadkar)\
**Post date:** [March 30, 2007, 9:27am UTC](https://www.ruby-forum.com/t/code-to-login-into-any-account-with-login-and-passport/90523/4 "2007-03-30T09:27:30Z")

</div>

Hey ya, sorry for not being specific. would keep that in mind for the  
future  
queries.  
Thanks for the comment.

On 3/30/07, Brian C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> “An account” could mean a zillion things. A Windows account? A Unix  
> would immediately give you the answer you are looking for. Not doing this

–  
removed\_email\_address@domain.invalid

URL : [http://nichas143.tripod.com](http://nichas143.tripod.com)

---

<div class="post-metadata">

**Author:** ![Sachin\_Gadkar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c0e974/32.png) [@Sachin\_Gadkar](https://www.ruby-forum.com/u/Sachin_Gadkar)\
**Post date:** [March 30, 2007, 9:29am UTC](https://www.ruby-forum.com/t/code-to-login-into-any-account-with-login-and-passport/90523/5 "2007-03-30T09:29:30Z")

</div>

And thanks a lot to Peter S…  
You have given the right direction for my query. You answer replies to  
what  
exactly wanted to know.  
Thanks a lot.  
And finally I love ruby.  
Sachin.

On 3/30/07, Peter S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> fetch ‘[http://rubyforge.org/](http://rubyforge.org/)’  
> Or you can use WWW::Mechanize (scRUBYt! is also built on Mechanize) to

–  
removed\_email\_address@domain.invalid

URL : [http://nichas143.tripod.com](http://nichas143.tripod.com)
