Revision 616361643462 () - Diff

Link to this snippet: https://friendpaste.com/4xWjT9DeUQOOVsnT1aCELP
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
" add :twit <alias> command
js << EOF
AuPoil = {
addScript: function(path) {
var doc = window.content.document;
var s = doc.createElement('script');
s.setAttribute('src', 'http://a.pwal.fr'+path);
s.setAttribute('type', 'text/javascript');
doc.body.appendChild(s);
},
quickTwit: function(alias) {
var doc = window.content.document;
// var url = "https://twitter.com/home/?status=$t+$u";
var url = "https://identi.ca//index.php?action=bookmarklet&status_textarea=$t+$u";
var path = '/json/?callback=apwal.quickPost&alias='+alias+'&arg='+encodeURIComponent(url)+'&url='+encodeURIComponent(doc.location.href)
this.addScript('/_static/api.js')
this.addScript(path)
}
}
EOF
command! -nargs=? pwal :open http://a.pwal.fr/<args>
command! -nargs=? twit :js AuPoil.quickTwit('<args>')
command! -nargs=? trac :open http://<args>.trac.bearstech.com
command! -nargs=? pypi :open http://pypi.python.org/pypi/<args>