Last active
January 13, 2016 12:46
-
-
Save capripot/cbf704d2cbc2ef554126 to your computer and use it in GitHub Desktop.
Get hiring New York Tech Meetup websites in a .csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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