Skip to content

Instantly share code, notes, and snippets.

@capripot
Last active January 13, 2016 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capripot/cbf704d2cbc2ef554126 to your computer and use it in GitHub Desktop.
Save capripot/cbf704d2cbc2ef554126 to your computer and use it in GitHub Desktop.
Get hiring New York Tech Meetup websites in a .csv
#!/usr/local/var/rbenv/shims/ruby
#
# Use like this
# ./scrap_nytm.rb > file.csv
#
# You need Nokogiri (gem install nokogiri)
#
require 'rubygems'
require 'nokogiri'
require 'open-uri'
site = "https://nytm.org/made?list=true&page="
links = []
(1..1).each do |page|
source = Nokogiri::HTML(open("#{site}#{page}"))
source.css(".made-listing li").each do |li|
link = nil
li.css("a").each do |a|
if a.text == "Hiring"
links << link
else
link = a
end
end
end
sleep 1
end
links.each do |l|
puts "\"#{l.text}\", \"#{l["href"]}\"\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment