Skip to content

Instantly share code, notes, and snippets.

@tapickell
Last active December 21, 2015 03:19
Show Gist options
  • Save tapickell/6241656 to your computer and use it in GitHub Desktop.
Save tapickell/6241656 to your computer and use it in GitHub Desktop.
get tags from website
#!/usr/bin/env ruby
require 'open-uri'
tags = []
outfile = File.open("tags.txt", "w")
open("http://ccis.edu") do |f|
f.each_line do |line|
if /[<]\w+/.match(line)
tags.push(/[<]\w+/.match(line).to_s.gsub "<", "")
end
end
end
tags.uniq!
tags.each { |tag| outfile.puts tag }
outfile.close
@tapickell
Copy link
Author

down to 17 lines w/ urs/bin/env...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment