Skip to content

Instantly share code, notes, and snippets.

@koyachi
Created October 4, 2010 15:53
Show Gist options
  • Save koyachi/609923 to your computer and use it in GitHub Desktop.
Save koyachi/609923 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
require 'open-uri'
module JD_EXT
module FixMP3TagFromSC
class << self
def jd_webui_url
'http://localhost:8765/'
end
def fix(path)
# TODO: impl
end
def filenames_from_jd_webui
doc = Nokogiri::HTML(open(jd_webui_url))
doc.xpath('//tr[@class="downloadfinished"]/td[3][text()="soundcloud.com"]/../td[2]/a/text()')
end
def run
filenames_from_jd_webui.each do |filename|
puts filename
# fix(filename)
end
end
end
end
end
JD_EXT::FixMP3TagFromSC.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment