RailsCast’s Crawler – RubyScript


First of all thanks to RyanBates for his valuable contribution towards the rails community with those short and easy-to-understand railscast videos. From Past few months I continuously watching those videos. Yesterday while downloading one of those videos, I realize rather than downloading them when its needed, it better to write some very short & sweet script which will do that for me which giving me any trouble. After looking for some already existing rubyscripts on internet, I ended up writing my own.

require ‘rubygems’
require ‘hpricot’
require ‘open-uri’
class GetRailsCasts
def initialize
end
def start
1.upto(229){ |eps|
eps_doc = Hpricot(open(“#{@host}#{eps}”)) rescue nil
if eps_doc
# cd to the folder where u want to store the rails-cast videos
`cd /Users/sandy/railscasts; wget #{(eps_doc/”.download/a”).first[:href]}`
end
}
end
end
Comment are most welcome
About these ads

11 thoughts on “RailsCast’s Crawler – RubyScript

  1. When someone writes an paragraph he/she maintains the image of a user in his/her mind that how a user can know
    it. Therefore that’s why this article is outstdanding. Thanks!

  2. Having read this I thought it was extremely informative.
    I appreciate you spending some time and energy
    to put this short article together. I once again find myself personally
    spending a lot of time both reading and commenting. But so
    what, it was still worth it!

  3. Hey there I am so thrilled I found your site, I really
    found you by mistake, while I was researching
    on Askjeeve for something else, Anyhow I am here now and would
    just like to say kudos for a marvelous post and a all round thrilling blog (I also love the theme/design),
    I don’t have time to read it all at the
    moment but I have book-marked it and also included your RSS feeds, so when I have time I will be
    back to read more, Please do keep up the awesome b.

  4. Excellent pieces. Keep writing such kind of information on your site.

    Im really impressed by it.
    Hello there, You have performed a great job. I’ll certainly digg it and individually suggest to my friends. I’m sure they’ll be benefited from this website.

  5. Hello my family member! I want to say that this post is awesome, nice written and include approximately all
    significant infos. I would like to peer more posts like this .

  6. When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get three e-mails with the same comment.

    Is there any way you can remove me from that service? Cheers!

  7. Normally I don’t learn post on blogs, but I would like to say that this write-up very forced me to check out and do it! Your writing taste has been surprised me. Thank you, quite great article.

  8. Wow, awesome blog layout! How long have you been blogging for?

    you make blogging look easy. The overall look of your website is great, let alone the content!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s