Skip to content

Instantly share code, notes, and snippets.

Created May 24, 2015 09:44
Show Gist options
  • Save anonymous/808010006f78380cd6a3 to your computer and use it in GitHub Desktop.
Save anonymous/808010006f78380cd6a3 to your computer and use it in GitHub Desktop.
agent = Mechanize.new
agent.get("https://thepiratebay.gd/search/#{URI.escape(params[:name])}/0/99/101") do |page|
torrent_page = agent.click(page.link_with(:class => /detLink/))
@hash = torrent_page.search("/html/body/div[@id='content']/div[@id='main-content']/div[1]/div[@id='detailsouterframe']/div[@id='detailsframe']/div[@id='details']/dl[@class='col1']")
@hash = @hash.to_s.scan(/[a-f0-9]{40}/i)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment