mirror of
https://github.com/balkian/go5ears.git
synced 2024-11-22 13:22:28 +00:00
Added support for HD. No empty fields
This commit is contained in:
parent
43e2f072bb
commit
898af95ceb
19
player.js
19
player.js
@ -36,12 +36,19 @@ app.get('/search', function(req, resp){
|
|||||||
html += data;
|
html += data;
|
||||||
}).on('end', function() {
|
}).on('end', function() {
|
||||||
// the whole of webpage data has been collected. parsing time!
|
// the whole of webpage data has been collected. parsing time!
|
||||||
$(html).find('.play').each(function(i,elem){
|
$(html).find('a.play').each(function(i,elem){
|
||||||
var prev = $(elem).prev();
|
var prev = $(elem).prevAll('a');
|
||||||
var title = $(prev).children(".song").text();
|
var title = $(prev).children('.song').text();
|
||||||
var group = $(prev).children(".group").text();
|
var quality = $(elem).next("p").text().split("|")[0].trim();
|
||||||
var id = prev.attr("href").split("/")[1];
|
title+=" ["+quality+"]";
|
||||||
results.push({id:id,title:title,group:group})
|
if($(elem).prev().is("img")){
|
||||||
|
title+=" HD!";
|
||||||
|
}
|
||||||
|
var group = $(prev).children('.group').text();
|
||||||
|
var id = prev.attr('href').split('/')[1];
|
||||||
|
if(typeof title != 'undefined' && typeof group != 'undefined' ){
|
||||||
|
results.push({id:id,title:title,group:group})
|
||||||
|
}
|
||||||
});
|
});
|
||||||
console.log("Results:"+JSON.stringify(results));
|
console.log("Results:"+JSON.stringify(results));
|
||||||
resp.send(JSON.stringify(results));
|
resp.send(JSON.stringify(results));
|
||||||
|
Loading…
Reference in New Issue
Block a user