Skip to content

Instantly share code, notes, and snippets.

@nikuuchi
Created November 2, 2012 07:48
Show Gist options
  • Select an option

  • Save nikuuchi/3999340 to your computer and use it in GitHub Desktop.

Select an option

Save nikuuchi/3999340 to your computer and use it in GitHub Desktop.
辞書引くためにブラウザ使うのが面倒だったから。
#!/usr/bin/env ruby
require 'open-uri'
require 'nokogiri'
dict = Nokogiri::HTML(open("http://ejje.weblio.jp/content/#{ARGV[0].downcase}")).search("div.Kejje")
dict.search("script").remove
dict.search("div.level0").each{|node| puts node.text.delete("\r")}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment