Frank Gjildberg
2009-Mar-17 10:42 UTC
[Mechanize-users] Get a list of users, and for each user, visit a URL
Hey, I got this smalltime social network here with about 200 users. In the beginning we didn''t have the "make all users friends of the admin" function that we do now, so I have to manually add these 200 users as friends of the admin. My friend coded this thing in PHP and I ain''t got much insight into its underpinnings (but I know that it''s a mess, and that the design is horrible, but anyway), I figured this''d be a great way to learn Mechanize. Basically I need to create a script that: 1) Goes to http://members.clebration.com 2) Gets a list of all the users on that page, each user looking like http://my.clebration.com/some_user 3) Do the same for http://members.clebration.com/?page=2 and all the way up to infinite 4) Then, for each user, simply go to http://my.clebration.com/some_user/friendship/add_request 5) The system should respond with a blank page saying "Friend request to <strong>some_user</strong> is sent" But where do I start? What tutorials do I need to read? Are there any sample scripts? Regards, Frank -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20090317/af3f60ca/attachment.html>
Frank Gjildberg
2009-Mar-17 12:58 UTC
[Mechanize-users] Get a list of users, and for each user, visit a URL
Hey, I got this smalltime social network here with about 200 users. In the beginning we didn''t have the "make all users friends of the admin" function that we do now, so I have to manually add these 200 users as friends of the admin. My friend coded this thing in PHP and I ain''t got much insight into its underpinnings (but it''s a mess), so I figured this''d be a great way to learn Mechanize. Basically I need to create a script that: 1) Goes to http://members.clebration.com 2) Gets a list of all the users on that page, each user looking like http://my.clebration.com/some_user 3) Do the same for http://members.clebration.com/?page=2 and all the way up to infinite 4) Then, for each user, simply go to http://my.clebration.com/some_user/friendship/add_request 5) The system should respond with a blank page saying "Friend request to <strong>some_user</strong> is sent" But where do I start? What tutorials do I need to read? Regards, Frank
Matt White
2009-Mar-17 15:33 UTC
[Mechanize-users] Get a list of users, and for each user, visit a URL
Here''s a good place to start:
http://letmegooglethatforyou.com/?q=ruby+mechanize+tutorial
________________________________
From: Frank Gjildberg <therapshow at gmail.com>
To: mechanize-users at rubyforge.org
Sent: Tuesday, March 17, 2009 4:42:27 AM
Subject: [Mechanize-users] Get a list of users, and for each user, visit a URL
Hey,
I got this smalltime social network here with about 200 users. In the beginning
we didn''t have the "make all users friends of the admin"
function that we do now, so I have to manually add these 200 users as friends of
the admin.
My friend coded this thing in PHP and I ain''t got much insight into its
underpinnings (but I know that it''s a mess, and that the design is
horrible, but anyway), I figured this''d be a great way to learn
Mechanize. Basically I need to create a script that:
1) Goes to http://members.clebration.com
2) Gets a list of all the users on that page, each user looking like
http://my.clebration.com/some_user
3) Do the same for http://members.clebration.com/?page=2 and all the way up to
infinite
4) Then, for each user, simply go to
http://my.clebration.com/some_user/friendship/add_request
5) The system should respond with a blank page saying "Friend request to
<strong>some_user</strong> is sent"
But where do I start? What tutorials do I need to read? Are there any sample
scripts?
Regards,
Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/mechanize-users/attachments/20090317/27284c08/attachment.html>
Frank Gjildberg
2009-Mar-18 08:39 UTC
[Mechanize-users] Get a list of users, and for each user, visit a URL
2009/3/17 Matt White <whitethunder922 at yahoo.com>:> Here''s a good place to start: > > http://letmegooglethatforyou.com/?q=ruby+mechanize+tutorial >Right. Well, thanks a lot, I''ll report back ASAP.