Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/env ruby
require 'open-uri'
require 'nokogiri'
doc = Nokogiri::HTML(open(""))
output =
doc.xpath('//img[@class="hscard-static"]').each do |card|
tmp = card['data-href'].to_s
url = card['src'].to_s
title = tmp[%r|^.+/.+?-(.+)$|,1]
output.push [title,url]
output.each do |card|
puts sprintf("![%s](%s)", card[0], card[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment