Created
January 22, 2013 19:15
-
-
Save ssig33/4597455 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| require 'bundler' | |
| require 'fileutils' | |
| FileUtils.cd File.expand_path(File.dirname(__FILE__)) | |
| Bundler.require | |
| require 'open-uri' | |
| alice = Mechanize.new | |
| page = alice.get "http://lantis-net.com/sasamisan/" | |
| FileUtils.touch 'list' unless File.exist?('list') | |
| list = open('list').read.split("\n") | |
| page.root.xpath("//div[@class='pv_c']//a").select{|x| x.children.first['src'] =~ /r64/}.each{|link| | |
| url = "http://lantis-net.com/sasamisan/#{link['href']}" | |
| next if list.index url | |
| asf = XmlSimple.xml_in(open(url).read)['Entry'].first['REF'].first['HREF'] | |
| system 'mimms', asf | |
| list << url | |
| } | |
| open('list','w'){|x| x.puts list.sort.join("\n")} |
This file contains hidden or 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
| source :rubygems | |
| gem 'mechanize' | |
| gem 'xml-simple', require: 'xmlsimple' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment