OSDN Git Service

ニコニコ動画検索サービスページ構成変更に伴う修正。
authoryuki <yuki@bdf3b611-c98c-6041-8292-703d9c9adbe7>
Mon, 31 May 2010 19:37:53 +0000 (19:37 +0000)
committeryuki <yuki@bdf3b611-c98c-6041-8292-703d9c9adbe7>
Mon, 31 May 2010 19:37:53 +0000 (19:37 +0000)
git-svn-id: http://192.168.11.7/svn/repository/NicoBrowser/branches/dev20100601_search@329 bdf3b611-c98c-6041-8292-703d9c9adbe7

src/nicobrowser/util/ResultParse.groovy

index 5ec1365..5c26e7c 100644 (file)
@@ -7,19 +7,19 @@ import org.cyberneko.html.parsers.SAXParser
 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']
     }