Created
August 27, 2014 16:33
-
-
Save akecn/2a43074ce7e7fbbf9cf6 to your computer and use it in GitHub Desktop.
网易云音乐列表页面:删除指定序号的歌曲记录
This file contains 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
var script = document.createElement('script'); | |
script.src="http://g.tbcdn.cn/kissy/k/1.4.4/seed.js"; | |
script.onload = function() { | |
KISSY.use("io, dom", function(S, IO, DOM) { | |
var rt = []; | |
S.each(document.querySelectorAll("span.num"), function(d) { | |
var tr = DOM.parent(d, 'tr'); | |
var num = d.innerHTML * 1; | |
var id = DOM.attr(DOM.get('.icn-del', tr), "data-res-id"); | |
if(num > 14 && num < 80) { | |
rt.push(id); | |
} | |
}); | |
console.log(rt); | |
IO({ | |
url: "http://music.163.com/api/playlist/manipulate/tracks?csrf_token=6442486af58921a47a78c364b8b239d2", | |
data: { | |
pid:5042714, | |
trackIds:'["'+rt.join('","') + '"]', | |
op:"del" | |
}, | |
type:"POST", | |
dataType:"json", | |
success: function(data) { | |
console.log(data) | |
} | |
}); | |
}); | |
}; | |
document.body.appendChild(script); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment