Skip to content

Instantly share code, notes, and snippets.

@bswinnerton
Created July 28, 2014 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bswinnerton/eeacb9e45f67196fc3b9 to your computer and use it in GitHub Desktop.
Save bswinnerton/eeacb9e45f67196fc3b9 to your computer and use it in GitHub Desktop.
require 'pry'
require 'nokogiri'
require 'rest-client'
endpoint_url = 'http://reddit.com'
response = RestClient.get(endpoint_url)
parsed_response = Nokogiri.parse(response)
titles = parsed_response.css('.content > .spacer > #siteTable > .thing > .entry > .title > a').map do |node|
node.text
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment