]> git.wh0rd.org Git - tt-rss.git/blob - plugins/identica/identica.js
d31fc55f468f885747d145c7efae93d52337e422
[tt-rss.git] / plugins / identica / identica.js
1         function shareArticleToIdentica(id) {
2         try {
3                 var query = "?op=pluginhandler&plugin=identica&method=getInfo&id=" + param_escape(id);
4
5                 console.log(query);
6
7                 var d = new Date();
8       var ts = d.getTime();
9
10                 var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
11                         "status=0,toolbar=0,location=0,width=600,height=500,scrollbars=1,menubar=0");
12
13                 new Ajax.Request("backend.php", {
14                         parameters: query,
15                         onComplete: function(transport) {
16                                 var ti = JSON.parse(transport.responseText);
17
18                                 var share_url = "http://identi.ca/index.php?action=bookmarkpopup&_=" + ts +
19                                         "&title=" + param_escape(ti.title) +
20                                         "&url=" + param_escape(ti.link);
21
22                                 w.location.href = share_url;
23
24                         } });
25
26
27         } catch (e) {
28                 exception_error("shareArticleIdentica", e);
29         }
30         }
31