aboutsummaryrefslogtreecommitdiffstats
path: root/pixiv.js
diff options
context:
space:
mode:
authormitsugu oyama2011-02-03 22:03:43 +0900
committermitsugu oyama2011-02-03 22:06:31 +0900
commit1e2c113fd5bbe5388e7b8c088343ae3933afe17d (patch)
tree006f1c760abdb0cf16ceb72805723546202a31a1 /pixiv.js
parente5e8fe2af7dfb8ac639e1a01e793bcde4156cb6c (diff)
downloadvimperator-plugins-1e2c113fd5bbe5388e7b8c088343ae3933afe17d.tar.bz2
changed specification of manga page
Diffstat (limited to 'pixiv.js')
-rw-r--r--pixiv.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/pixiv.js b/pixiv.js
index 2d5e7d1..eda6cfa 100644
--- a/pixiv.js
+++ b/pixiv.js
@@ -1,6 +1,6 @@
// INFO //
var INFO =
-<plugin name="pixiv.js" version="0.3"
+<plugin name="pixiv.js" version="0.4"
summary="Download image from pixiv"
href="http://github.com/vimpr/vimperator-plugins/blob/master/pixiv.js"
xmlns="http://vimperator.org/namespaces/liberator">
@@ -181,11 +181,16 @@ commands.addUserCommand(
let i;
let htmldoc=getDOMHtmlDocument(pageContents);
if(htmldoc){
- for(i=0;;i++){
- tblElm=htmldoc.getElementById('page'+i);
- if(!tblElm) break;
- url.push(tblElm.getElementsByTagName('tr').item(1)
- .getElementsByTagName('img').item(0).getAttribute('src'));
+ let max=htmldoc.getElementsByClassName('image-container').length;
+ let strScript;
+ let st,end;
+ for(i=0;i<max;i++){
+ strScript=htmldoc.getElementsByClassName('image-container').item(i)
+ .getElementsByTagName('script').item(0)
+ .childNodes.item(0).nodeValue;
+ st=strScript.substr(strScript.search(/unshift/i)+'unshift'.length+2);
+ end=st.substr(0,st.indexOf("'"));
+ url.push(end);
}
}else{
url.length=0;