From dcb63b7c7103f21a48e3de6b56d6dd55ecc8750e Mon Sep 17 00:00:00 2001
From: anekos
Date: Wed, 16 Dec 2009 11:57:53 +0000
Subject: ニコニコ動画の変更に対応
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@36164 d0d07461-0603-4401-acd4-de1884942a52
---
matanico.js | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
(limited to 'matanico.js')
diff --git a/matanico.js b/matanico.js
index a005a0e..d33d505 100644
--- a/matanico.js
+++ b/matanico.js
@@ -5,7 +5,7 @@ let PLUGIN_INFO =
今見ている動画 / 検索結果の情報を Twitter に投稿する。
janus_wel
New BSD License
-0.72
+0.73
2.3pre
2.3pre
http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/matanico.js
@@ -120,13 +120,13 @@ matanico_related_tag_servicename:
function NicoScraper() {}
NicoScraper.prototype = {
_constants: {
- VERSION: '0.70',
- PAGECHECK: {
- watch: '^http://[^.]+\\.nicovideo\\.jp/watch/',
- live: '^http://live\\.nicovideo\\.jp/watch/',
- tag: '^http://[^.]+\\.nicovideo\\.jp/tag/',
- relatedTag: '^http://[^.]+\\.nicovideo\\.jp/related_tag/',
- },
+ VERSION: '0.73',
+ PAGECHECK: [
+ ['live', '^http://live\\.nicovideo\\.jp/watch/'],
+ ['watch', '^http://[^.]+\\.nicovideo\\.jp/watch/'],
+ ['tag', '^http://[^.]+\\.nicovideo\\.jp/tag/'],
+ ['relatedTag', '^http://[^.]+\\.nicovideo\\.jp/related_tag/'],
+ ],
},
version: function () { return this.constants.VERSION; },
@@ -134,7 +134,7 @@ NicoScraper.prototype = {
pagecheck: function () {
const pageCheckData = this._constants.PAGECHECK;
const currentURL = this.getURL();
- for (let [name, url] in Iterator(pageCheckData)) {
+ for each (let [name, url] in pageCheckData) {
if (currentURL.match(url)) return name;
}
throw new Error('current tab is not nicovideo.jp');
@@ -155,10 +155,10 @@ NicoScraper.prototype = {
let subjectNode;
switch (this.pagecheck()) {
case 'watch':
- subjectNode = $f('//h1/a[contains(concat(" ", @class, " "), " video ")]');
+ subjectNode = $f('id("des_2")/table[2]/tbody/tr/td[2]');
break;
case 'live':
- subjectNode = $f('//h1[contains(concat(" ", @class, " "), " title ")]');
+ subjectNode = $f('id("stream_description")');
break;
default:
break;
@@ -310,7 +310,8 @@ liberator.modules.commands.addUserCommand(
},
{
bang: true,
- }
+ },
+ true
);
// sub
--
cgit v1.2.3