class ResultParse {
List<nicobrowser.util.Result> parse(InputStream is){
def html = new XmlSlurper(new SAXParser()).parse(is)
- def res = html.'**'.findAll{it.attributes()['class'] == 'video'}
+ def res = html.'**'.findAll{it.attributes()['class'] == 'thumb_frm'}
List<nicobrowser.util.Result> list = []
res.each{list += new nicobrowser.util.Result(
- it.attributes()['href'].replaceAll('watch/','').toString(),
- it.toString())}
+ it.P[2].A[0].@href[0].text().replaceAll('watch/','').toString(),
+ it.P[2].A[0].SPAN[0].toString())}
return list
}
String getNextPage(InputStream is){
def html = new XmlSlurper(new SAXParser()).parse(is)
- def res = html.'**'.find{it.attributes()['class'] == 'nextpage'}
+ def res = html.'**'.find{it.attributes()['rel'] == 'next'}
if(res==null) return null
return res.attributes()['href']
}