Skip to content

Instantly share code, notes, and snippets.

@hibiyasleep
Created December 14, 2014 15:18
Show Gist options
  • Select an option

  • Save hibiyasleep/b2dab44e9b5c3997a32b to your computer and use it in GitHub Desktop.

Select an option

Save hibiyasleep/b2dab44e9b5c3997a32b to your computer and use it in GitHub Desktop.
// target: http://zermoth.net/mabinogi/ost
// jquery: required
// setting: none
// output-variable: d
// output-type: object
t=''
tn=0
d={}
void(
$('h2, .tbOST tr').each(function(i, o){
$o=$(o)
if(o.tagName == 'H2'){
t = o.innerText
d[t] = []
tn += 1
} else {
var l = {
filename: $o.find('a').text(),
disknumber: tn,
tracknumber: $o.find(':first-child').text(),
title: $o.find(':nth-child(2)').text(),
subtitle: $o.find(':nth-child(4)').text()
}
d[t].push(l)
}
})
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment