Skip to content

Instantly share code, notes, and snippets.

@kimitoboku
Last active December 20, 2015 05:57
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 kimitoboku/f6ce0bfed4c64d514be2 to your computer and use it in GitHub Desktop.
Save kimitoboku/f6ce0bfed4c64d514be2 to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'pp'
require 'nokogiri'
require 'kconv'
URL = "https://www.ead.tut.ac.jp/board/main.aspx"
doc = Nokogiri::HTML.parse(open(URL).read.toutf8)
lectureCancellation = doc.xpath(%Q[//table[@id="grvCancel"]])
lectureCancellation.text.split(/(\s\s\s+)/).each do |i|
if(i =~ /\(.\)/)then
puts i.gsub("\t", "").gsub("\r", "").gsub("\n", "")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment