/*** BEGIN LICENSE BLOCK {{{ Copyright (c) 2008 suVene distributable under the terms of an MIT-style license. http://www.opensource.jp/licenses/mit-license.html }}} END LICENSE BLOCK ***/ // PLUGIN_INFO//{{{ var PLUGIN_INFO = {NAME} hatena bottle change notice. はてなボトルの変更通知。 suVene 0.1.2 MIT 2.0pre 2.0pre http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/notifier/subject_hatelabo_bottle.js ; //}}} (function() { var notifier = liberator.plugins.notifier; if (!notifier) return; var libly = notifier.libly; var $U = libly.$U; var logger = $U.getLogger('subject_hatelabo_bottle'); var URL = 'http://bottle.hatelabo.jp'; notifier.subject.register(notifier.SubjectHttp, { interval: 60, options: { url: URL, headers: null, extra: null }, parse: function(res) { // if (this.count == 0) return []; // for debug var doc = res.getHTMLDocument('id("body")//div[contains(concat(" ", @class, " "), " entry ")]'); return doc; }, 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) { var permalink = $U.getFirstNodeFromXPath('descendant::a[@class="hatena-star-uri"]', d); if (permalink) permalink = URL + permalink; return new notifier.Message('Hatelabo bottle', $U.xmlSerialize(d), permalink) })); } }); })(); // vim: set fdm=marker sw=4 ts=4 sts=0 et: spector.js?h=3.6&id=03139870c25fe5b4a797679de9dcc80370c7d82b'>treecommitdiffstats
path: root/inspector.js
blob: 7404dbf2edc12497873a830c81ccb6172580462d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93