OSDN Git Service

2010/06/01 検索結果ページ仕様変更対応
authoryuki <yuki@bdf3b611-c98c-6041-8292-703d9c9adbe7>
Tue, 1 Jun 2010 06:38:55 +0000 (06:38 +0000)
committeryuki <yuki@bdf3b611-c98c-6041-8292-703d9c9adbe7>
Tue, 1 Jun 2010 06:38:55 +0000 (06:38 +0000)
git-svn-id: http://192.168.11.7/svn/repository/NicoBrowser/branches/dev20100601_search@330 bdf3b611-c98c-6041-8292-703d9c9adbe7

src/nicobrowser/util/ResultParse.groovy

index 5c26e7c..e018301 100644 (file)
@@ -7,12 +7,12 @@ 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'] == 'thumb_frm'}
+        def res = html.'**'.findAll{it.@class == 'vinfo_title'}
 
         List<nicobrowser.util.Result> list = []
         res.each{list += new nicobrowser.util.Result(
-                it.P[2].A[0].@href[0].text().replaceAll('watch/','').toString(),
-                it.P[2].A[0].SPAN[0].toString())}
+                it.@href[0].text().replaceAll('watch/',''),
+                it.text())}
 
         return list
     }