second mechanize
with nokogiri for parsing html and xml.

Some pesudo code would look like:

m = WWW.mechanize.new
Page p = m.get 'http://reddit.org/pages/123' # this is mechanize using http
get method to get web page content
p.get('//users') # this is the xpath and nokogiri comes in, to get a
specific element from html downloaded





On Tue, Dec 3, 2013 at 2:37 PM, Avdi Grimm <groups / inbox.avdi.org> wrote:

>
> On Mon, Dec 2, 2013 at 10:03 PM, JD JD <lists / ruby-forum.com> wrote:
>
>> For example, I wanted to build some bots that did things for me.  For
>> example, reddit is a big website.  I wanted to do two things on it.
>> One, I wanted to create something that could search a particular
>> username that I entered and return something I was lookinng for.  For
>> example, maybe pictures they posted in a certain subreddit (say
>> /r/funny).  Or return statistics on a user, say how much they post in a
>> certain subreddit (percentage).
>>
>
> Mechanize (http://mechanize.rubyforge.org/) is perfect for this. I've
> used it very happily for years.
>
> Although Reddit has an API, so you may not need to drop to the level of
> screen-scraping. There are even Ruby gems, such as this one:
> https://github.com/samsymons/RedditKit.rb
>