aboutsummaryrefslogtreecommitdiffstats
path: root/notifier/subject_hatena_message.js
diff options
context:
space:
mode:
authordrry2009-01-04 16:44:41 +0000
committerdrry2009-01-04 16:44:41 +0000
commiteedccef4a1da859fb5f6382a4ee34c059a4c42cb (patch)
treee050c2d5c3e90f626cc0de979f8f73c5cef5eaa1 /notifier/subject_hatena_message.js
parent274755d24c7024b110ec67d4a86699e16db09ae7 (diff)
downloadvimperator-plugins-eedccef4a1da859fb5f6382a4ee34c059a4c42cb.tar.bz2
* fixed missing `var` statements.
* fixed a regex. * removed subversion props. * et cetera. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@27924 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'notifier/subject_hatena_message.js')
-rw-r--r--notifier/subject_hatena_message.js21
1 files changed, 9 insertions, 12 deletions
diff --git a/notifier/subject_hatena_message.js b/notifier/subject_hatena_message.js
index d14878a..e4d6955 100644
--- a/notifier/subject_hatena_message.js
+++ b/notifier/subject_hatena_message.js
@@ -30,27 +30,24 @@ notifier.subject.register(notifier.SubjectHttp, {
extra: {}
},
preInitialize: function() {
- [username, password] = $U.getUserAndPassword('https://www.hatena.ne.jp', 'https://www.hatena.ne.jp');
+ var [username, password] = $U.getUserAndPassword('https://www.hatena.ne.jp', 'https://www.hatena.ne.jp');
this.options.extra.username = username;
this.options.extra.password = password;
return (username && password) ? true : false;
},
- parse: function(res) {
- var doc = res.getHTMLDocument('//table[@class="list"]//tr');
- return doc;
- },
+ parse: function(res)
+ res.getHTMLDocument('//table[@class="list"]//tr'),
diff: function(cache, parsed)
parsed.filter(function(element)
!cache.some(function(c) c.textContent == element.textContent)),
- buildMessages: function(diff) {
- return diff.map($U.bind(this, function(d) {
+ buildMessages: function(diff)
+ diff.map($U.bind(this, function(d) {
var anchor = $U.getFirstNodeFromXPath('descendant::a[@class="message-title"]', d);
- var permalink = URL + (anchor.href ? anchor.href : "");
- var [title, message, date] = [elm.textContent.replace(/^\s+|\s+$/g,"").replace(/>\s+</g,"><") for ([i,elm] in Iterator(d.cells))];
+ var permalink = URL + (anchor.href ? anchor.href : '');
+ var [title, message, date] = [elm.textContent.replace(/^\s+|\s+$/g,'').replace(/>\s+</g,'><') for ([i,elm] in Iterator(d.cells))];
var html = title + ' (' + date + ')<br/>' + message;
- return new notifier.Message('Hatena::Message', html, permalink)
- }));
- }
+ return new notifier.Message('Hatena::Message', html, permalink);
+ }))
});
})();