Skip to content

Instantly share code, notes, and snippets.

@chrisroos chrisroos/
Created Oct 3, 2014

What would you like to do?
Parse CloudStore results and display as markdown


Parse a CloudStore search results page and display the results as markdown.

NOTE. It only displays the first page of search results

Usage example

$ curl -s "" | \
  ruby cloudstore-results-parser.rb
require 'nokogiri'
html =
doc = Nokogiri::HTML(html)
products = []'.product-shop').each do |product|
name ='.product-name').first.text.strip
price ='.price').first.text.strip
url ='.product-name a').first['href']
products << {name: name, price: price, url: url}
products.sort_by { |product| product[:name] }.each do |product|
puts "* [#{product[:name]}](#{product[:url]}) - #{product[:price]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.