Search code examples
javascriptnode.jsopen-uri

Open URI - Opening multiple pages


Using Node's open-uri module, is it possible to open multiple pages such as this? For example, a user's blog might have 10 pages.

ruby

index = 1
downloads = []
page = open("http://#{user_name}.tumblr.com/page/#{index.to_s}") do |page|
  page.each_line do |line|
        downloads.push($&) if line =~ regex
    end
end

Solution

  • Actually, after finishing up the bot I just wrote, I used a recursive solution. Check out this post!