/* * Please write the below line into .vimperatorrc. * let g:twittperator_plugin_pong = 1 * let g:twittperator_screen_name = "" */ (function () { let screenName = liberator.globalVariables.twittperator_screen_name; if (!screenName) return liberator.echoerr('please. let g:twittperator_screen_name = ""'); plugins.twittperator.ChirpUserStream.addListener( function onMsg (msg, raw) { function negi (pattern, reply) { if (RegExp('^\\s*@' + screenName + '\\s+' + pattern + '\s*$')(msg.text.trim())) { plugins.twittperator.Twitter.say('@' + msg.user.screen_name + ' ' + reply, msg.id_str); return true; } } if (!(msg.text && msg.user)) return; if (msg.text.trim() === ('@' + screenName)) return plugins.twittperator.Twitter.say('@' + msg.user.screen_name, msg.id_str); negi('ping', 'pong') || negi('pong', 'pang') || negi('pang', 'bang') || negi('bang', '( \u25D5 \u203F\u203F \u25D5 )') || negi('\u30C6\u30A3\u30ED', '\u30D5\u30A3\u30CA\u30FC\u30EC') || negi('ニンジャ', 'コマンドー!') || true; } ); })(); // vim: sw=2 ts=2 et fdm=marker ft=javascript: for Vimperator plugins
aboutsummaryrefslogtreecommitdiffstats
blob: 683be2bf9b906df93adfdecd9db2c4d8e7db3194 (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