summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-03-27 15:18:38 +0400
committerAndrew Dolgov <[email protected]>2013-03-27 15:18:38 +0400
commit9d46d280b1f611904080ace89e48e0970b03be43 (patch)
treee409d1e6c769e0065d92a5e8581479d53df7b014 /plugins
parentaf2941dbb320d9506495c1577decbc9a3a9bedf1 (diff)
split several social plugins from trunk to separate optional downloads (see forum)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/flattr/flattr.pngbin693 -> 0 bytes
-rw-r--r--plugins/flattr/init.php46
-rw-r--r--plugins/googleplus/googleplus.js29
-rw-r--r--plugins/googleplus/googleplus.pngbin3295 -> 0 bytes
-rw-r--r--plugins/googleplus/init.php53
-rw-r--r--plugins/identica/identica.js31
-rw-r--r--plugins/identica/identica.pngbin121 -> 0 bytes
-rw-r--r--plugins/identica/init.php53
-rw-r--r--plugins/owncloud/init.php96
-rw-r--r--plugins/owncloud/owncloud.js27
-rw-r--r--plugins/owncloud/owncloud.pngbin625 -> 0 bytes
-rw-r--r--plugins/pinterest/init.php53
-rw-r--r--plugins/pinterest/pinterest.js31
-rw-r--r--plugins/pinterest/pinterest.pngbin3829 -> 0 bytes
-rw-r--r--plugins/pocket/init.php54
-rw-r--r--plugins/pocket/pocket.js31
-rw-r--r--plugins/pocket/pocket.pngbin471 -> 0 bytes
-rw-r--r--plugins/tweet/init.php53
-rw-r--r--plugins/tweet/tweet.js31
-rw-r--r--plugins/tweet/tweet.pngbin159 -> 0 bytes
20 files changed, 0 insertions, 588 deletions
diff --git a/plugins/flattr/flattr.png b/plugins/flattr/flattr.png
deleted file mode 100644
index 4933ffc21..000000000
--- a/plugins/flattr/flattr.png
+++ /dev/null
Binary files differ
diff --git a/plugins/flattr/init.php b/plugins/flattr/init.php
deleted file mode 100644
index b91019880..000000000
--- a/plugins/flattr/init.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-class Flattr extends Plugin {
- private $link;
- private $host;
-
- function init($host) {
- $this->link = $host->get_link();
- $this->host = $host;
-
- $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
- }
-
- function about() {
- return array(1.1,
- "Share articles on Flattr (if they exist in their catalogue)",
- "F. Eitel, N. Honing");
- }
-
- function hook_article_button($line) {
-
- $rv = "";
- $article_link = $line['link'];
-
- if ($article_link) {
- $encoded = urlencode($article_link);
- $r = file_get_contents("https://api.flattr.com/rest/v2/things/lookup/?url=$encoded");
- $response = json_decode($r, true);
- $image = "<img src=\"plugins/flattr/flattr.png\"
- class='tagsPic' style=\"cursor : pointer\"
- title='".__('Flattr this article.')."'>";
- // if Flattr has it in the catalogue, we display the button
- if ($response and array_key_exists('link', $response)) {
- $rv = "<a id='flattr' target='_blank' href='" . $response['link'] . "'> . $image . </a>";
- } else {
- // We can't submit a thing to the catalogue without giving a Flattr user id (who would be the owner)
- // see http://developers.flattr.net/auto-submit
- //$rv = "<a id='flattr' href='https://flattr.com/submit/auto?url=" . $encoded . "'>" . $image . "</a>";
- $rv = '';
- // Another useful thing would be any rel=payment link (which would have the user id as well),
- // but tt-rss is not checking that (yet), I believe. See http://developers.flattr.net/feed
- }
- }
- return $rv;
- }
-}
-?>
diff --git a/plugins/googleplus/googleplus.js b/plugins/googleplus/googleplus.js
deleted file mode 100644
index 027d9b40e..000000000
--- a/plugins/googleplus/googleplus.js
+++ /dev/null
@@ -1,29 +0,0 @@
- function shareArticleToGooglePlus(id) {
- try {
- var query = "?op=pluginhandler&plugin=googleplus&method=getInfo&id=" + param_escape(id);
-
- console.log(query);
-
- var d = new Date();
- var ts = d.getTime();
-
- var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
- "status=0,toolbar=0,location=0,width=500,height=450,scrollbars=1,menubar=0");
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- var ti = JSON.parse(transport.responseText);
-
- var share_url = "https://plus.google.com/share?url=" + param_escape(ti.link);
-
- w.location.href = share_url;
-
- } });
-
-
- } catch (e) {
- exception_error("tweetArticle", e);
- }
- }
-
diff --git a/plugins/googleplus/googleplus.png b/plugins/googleplus/googleplus.png
deleted file mode 100644
index ac46126d7..000000000
--- a/plugins/googleplus/googleplus.png
+++ /dev/null
Binary files differ
diff --git a/plugins/googleplus/init.php b/plugins/googleplus/init.php
deleted file mode 100644
index 6045d2df6..000000000
--- a/plugins/googleplus/init.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-class GooglePlus extends Plugin {
- private $link;
- private $host;
-
- function init($host) {
- $this->link = $host->get_link();
- $this->host = $host;
-
- $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
- }
-
- function about() {
- return array(1.0,
- "Share article on Google+",
- "homolibere");
- }
-
- function get_js() {
- return file_get_contents(dirname(__FILE__) . "/googleplus.js");
- }
-
- function hook_article_button($line) {
- $article_id = $line["id"];
-
- $rv = "<img src=\"plugins/googleplus/googleplus.png\"
- class='tagsPic' style=\"cursor : pointer\"
- onclick=\"shareArticleToGooglePlus($article_id)\"
- title='".__('Share on Google+')."'>";
-
- return $rv;
- }
-
- function getInfo() {
- $id = db_escape_string($this->link, $_REQUEST['id']);
-
- $result = db_query($this->link, "SELECT title, link
- FROM ttrss_entries, ttrss_user_entries
- WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
-
- if (db_num_rows($result) != 0) {
- $title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
- 100, '...');
- $article_link = db_fetch_result($result, 0, 'link');
- }
-
- print json_encode(array("title" => $title, "link" => $article_link,
- "id" => $id));
- }
-
-
-}
-?>
diff --git a/plugins/identica/identica.js b/plugins/identica/identica.js
deleted file mode 100644
index d31fc55f4..000000000
--- a/plugins/identica/identica.js
+++ /dev/null
@@ -1,31 +0,0 @@
- function shareArticleToIdentica(id) {
- try {
- var query = "?op=pluginhandler&plugin=identica&method=getInfo&id=" + param_escape(id);
-
- console.log(query);
-
- var d = new Date();
- var ts = d.getTime();
-
- var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
- "status=0,toolbar=0,location=0,width=600,height=500,scrollbars=1,menubar=0");
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- var ti = JSON.parse(transport.responseText);
-
- var share_url = "http://identi.ca/index.php?action=bookmarkpopup&_=" + ts +
- "&title=" + param_escape(ti.title) +
- "&url=" + param_escape(ti.link);
-
- w.location.href = share_url;
-
- } });
-
-
- } catch (e) {
- exception_error("shareArticleIdentica", e);
- }
- }
-
diff --git a/plugins/identica/identica.png b/plugins/identica/identica.png
deleted file mode 100644
index ee3cb61ea..000000000
--- a/plugins/identica/identica.png
+++ /dev/null
Binary files differ
diff --git a/plugins/identica/init.php b/plugins/identica/init.php
deleted file mode 100644
index 8e0ad4b9a..000000000
--- a/plugins/identica/init.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-class Identica extends Plugin {
- private $link;
- private $host;
-
- function init($host) {
- $this->link = $host->get_link();
- $this->host = $host;
-
- $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
- }
-
- function about() {
- return array(1.0,
- "Share articles on Identi.ca",
- "fox");
- }
-
- function get_js() {
- return file_get_contents(dirname(__FILE__) . "/identica.js");
- }
-
- function hook_article_button($line) {
- $article_id = $line["id"];
-
- $rv = "<img src=\"plugins/identica/identica.png\"
- class='tagsPic' style=\"cursor : pointer\"
- onclick=\"shareArticleToIdentica($article_id)\"
- title='".__('Share on identi.ca')."'>";
-
- return $rv;
- }
-
- function getInfo() {
- $id = db_escape_string($this->link, $_REQUEST['id']);
-
- $result = db_query($this->link, "SELECT title, link
- FROM ttrss_entries, ttrss_user_entries
- WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
-
- if (db_num_rows($result) != 0) {
- $title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
- 100, '...');
- $article_link = db_fetch_result($result, 0, 'link');
- }
-
- print json_encode(array("title" => $title, "link" => $article_link,
- "id" => $id));
- }
-
-
-}
-?>
diff --git a/plugins/owncloud/init.php b/plugins/owncloud/init.php
deleted file mode 100644
index 5d215b386..000000000
--- a/plugins/owncloud/init.php
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-require_once "config.php";
-
-class OwnCloud extends Plugin {
- private $link;
- private $host;
-
- function about() {
- return array(1.0,
- "Adds support for OwnCloud ReadLater",
- "cy8aer");
- }
-
- function init($host) {
- $this->link = $host->get_link();
- $this->host = $host;
-
- $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
- $host->add_hook($host::HOOK_PREFS_TAB, $this);
- }
-
- function save() {
- $owncloud_url = db_escape_string($this->link, $_POST["owncloud_url"]);
- $this->host->set($this, "owncloud", $owncloud_url);
- echo "Value set to $owncloud_url";
- }
-
- function get_js() {
- return file_get_contents(dirname(__FILE__) . "/owncloud.js");
- }
-
- function hook_prefs_tab($args) {
- if ($args != "prefPrefs") return;
-
- print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__("Owncloud")."\">";
-
- print "<br/>";
-
- $value = $this->host->get($this, "owncloud");
- print "<form dojoType=\"dijit.form.Form\">";
-
- print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
- evt.preventDefault();
- if (this.validate()) {
- console.log(dojo.objectToQuery(this.getValues()));
- new Ajax.Request('backend.php', {
- parameters: dojo.objectToQuery(this.getValues()),
- onComplete: function(transport) {
- notify_info(transport.responseText);
- }
- });
- }
- </script>";
-
- print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pluginhandler\">";
- print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"save\">";
- print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"plugin\" value=\"owncloud\">";
- print "<table width=\"100%\" class=\"prefPrefsList\">";
- print "<tr><td width=\"40%\">".__("Owncloud url")."</td>";
- print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" name=\"owncloud_url\" regExp='^(http|https)://.*' value=\"$value\"></td></tr>";
- print "</table>";
- print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">".__("Save")."</button>";
-
- print "</form>";
-
- print "</div>"; #pane
-
- }
-
- function hook_article_button($line) {
- return "<img src=\"plugins/owncloud/owncloud.png\"
- style=\"cursor : pointer\" style=\"cursor : pointer\"
- onclick=\"ownArticle(".$line["id"].")\"
- class='tagsPic' title='".__('Bookmark on OwnCloud ')."'>";
- }
-
- function getOwnCloud() {
- $id = db_escape_string($this->link, $_REQUEST['id']);
-
- $result = db_query($this->link, "SELECT title, link
- FROM ttrss_entries, ttrss_user_entries
- WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
-
- if (db_num_rows($result) != 0) {
- $title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
- 100, '...');
- $article_link = db_fetch_result($result, 0, 'link');
- }
-
- $own_url = $this->host->get($this, "owncloud");
-
- print json_encode(array("title" => $title, "link" => $article_link,
- "id" => $id, "ownurl" => $own_url));
- }
-}
-?>
diff --git a/plugins/owncloud/owncloud.js b/plugins/owncloud/owncloud.js
deleted file mode 100644
index df929e015..000000000
--- a/plugins/owncloud/owncloud.js
+++ /dev/null
@@ -1,27 +0,0 @@
-function ownArticle(id) {
- try {
- var query = "?op=pluginhandler&plugin=owncloud&method=getOwnCloud&id=" + param_escape(id);
-
- console.log(query);
-
- var d = new Date();
- var ts = d.getTime();
-
- var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
- "status=0,toolbar=0,location=0,width=600,height=500,scrollbars=1,menubar=0");
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- var ti = JSON.parse(transport.responseText);
-
- var share_url = ti.ownurl + "/apps/bookmarks/addBm.php?output=popup&url=" + param_escape(ti.link)
- + '&title=' + ti.title;
-
- w.location.href = share_url;
- } });
- } catch (e) {
- exception_error("ownArticle", e);
- }
-}
-
diff --git a/plugins/owncloud/owncloud.png b/plugins/owncloud/owncloud.png
deleted file mode 100644
index d31ba924b..000000000
--- a/plugins/owncloud/owncloud.png
+++ /dev/null
Binary files differ
diff --git a/plugins/pinterest/init.php b/plugins/pinterest/init.php
deleted file mode 100644
index 11fe64eb5..000000000
--- a/plugins/pinterest/init.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-class Pinterest extends Plugin {
- private $link;
- private $host;
-
- function about() {
- return array(1.0,
- "Share article on Pinterest",
- "?");
- }
-
- function init($host) {
- $this->link = $host->get_link();
- $this->host = $host;
-
- $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
- }
-
- function get_js() {
- return file_get_contents(dirname(__FILE__) . "/pinterest.js");
- }
-
- function hook_article_button($line) {
- $article_id = $line["id"];
-
- $rv = "<img src=\"plugins/pinterest/pinterest.png\"
- class='tagsPic' style=\"cursor : pointer\"
- onclick=\"pinterest($article_id)\"
- title='".__('Pinterest')."'>";
-
- return $rv;
- }
-
- function getInfo() {
- $id = db_escape_string($this->link, $_REQUEST['id']);
-
- $result = db_query($this->link, "SELECT title, link
- FROM ttrss_entries, ttrss_user_entries
- WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
-
- if (db_num_rows($result) != 0) {
- $title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
- 100, '...');
- $article_link = db_fetch_result($result, 0, 'link');
- }
-
- print json_encode(array("title" => $title, "link" => $article_link,
- "id" => $id));
- }
-
-
-}
-?>
diff --git a/plugins/pinterest/pinterest.js b/plugins/pinterest/pinterest.js
deleted file mode 100644
index 01c525f55..000000000
--- a/plugins/pinterest/pinterest.js
+++ /dev/null
@@ -1,31 +0,0 @@
- function pinterest(id) {
- try {
- var query = "?op=pluginhandler&plugin=pinterest&method=getInfo&id=" + param_escape(id);
-
- console.log(query);
-
- var d = new Date();
- var ts = d.getTime();
-
- var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
- "status=0,toolbar=0,location=0,width=650,height=600,scrollbars=1,menubar=0");
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- var ti = JSON.parse(transport.responseText);
-
- var share_url = "http://pinterest.com/pin/create/button/?" +
- "url=" + param_escape(ti.link) +
- "&description=" + param_escape(ti.title);
-
- w.location.href = share_url;
-
- } });
-
-
- } catch (e) {
- exception_error("tweetArticle", e);
- }
- }
-
diff --git a/plugins/pinterest/pinterest.png b/plugins/pinterest/pinterest.png
deleted file mode 100644
index b85aed3cd..000000000
--- a/plugins/pinterest/pinterest.png
+++ /dev/null
Binary files differ
diff --git a/plugins/pocket/init.php b/plugins/pocket/init.php
deleted file mode 100644
index e96d08001..000000000
--- a/plugins/pocket/init.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-class Pocket extends Plugin {
-
- private $link;
- private $host;
-
- function about() {
- return array(1.0,
- "Share article on Pocket (formerly Read It Later)",
- "?");
- }
-
- function init($host) {
- $this->link = $host->get_link();
- $this->host = $host;
-
- $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
- }
-
- function get_js() {
- return file_get_contents(dirname(__FILE__) . "/pocket.js");
- }
-
- function hook_article_button($line) {
- $article_id = $line["id"];
-
- $rv = "<img src=\"plugins/pocket/pocket.png\"
- class='tagsPic' style=\"cursor : pointer\"
- onclick=\"shareArticleToPocket($article_id)\"
- title='".__('Pocket')."'>";
-
- return $rv;
- }
-
- function getInfo() {
- $id = db_escape_string($this->link, $_REQUEST['id']);
-
- $result = db_query($this->link, "SELECT title, link
- FROM ttrss_entries, ttrss_user_entries
- WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
-
- if (db_num_rows($result) != 0) {
- $title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
- 100, '...');
- $article_link = db_fetch_result($result, 0, 'link');
- }
-
- print json_encode(array("title" => $title, "link" => $article_link,
- "id" => $id));
- }
-
-
-}
-?>
diff --git a/plugins/pocket/pocket.js b/plugins/pocket/pocket.js
deleted file mode 100644
index 021d5bb05..000000000
--- a/plugins/pocket/pocket.js
+++ /dev/null
@@ -1,31 +0,0 @@
- function shareArticleToPocket(id) {
- try {
- var query = "?op=pluginhandler&plugin=pocket&method=getInfo&id=" + param_escape(id);
-
- console.log(query);
-
- var d = new Date();
- var ts = d.getTime();
-
- var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
- "status=0,toolbar=0,location=0,width=500,height=400,scrollbars=1,menubar=0");
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- var ti = JSON.parse(transport.responseText);
-
- var share_url = "https://getpocket.com/save?" +
- "&title=" + param_escape(ti.title) +
- "&url=" + param_escape(ti.link);
-
- w.location.href = share_url;
-
- } });
-
-
- } catch (e) {
- exception_error("tweetArticle", e);
- }
- }
-
diff --git a/plugins/pocket/pocket.png b/plugins/pocket/pocket.png
deleted file mode 100644
index ff6bc85a4..000000000
--- a/plugins/pocket/pocket.png
+++ /dev/null
Binary files differ
diff --git a/plugins/tweet/init.php b/plugins/tweet/init.php
deleted file mode 100644
index bbcf7836c..000000000
--- a/plugins/tweet/init.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-class Tweet extends Plugin {
- private $link;
- private $host;
-
- function init($host) {
- $this->link = $host->get_link();
- $this->host = $host;
-
- $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
- }
-
- function about() {
- return array(1.0,
- "Share article on Twitter",
- "fox");
- }
-
- function get_js() {
- return file_get_contents(dirname(__FILE__) . "/tweet.js");
- }
-
- function hook_article_button($line) {
- $article_id = $line["id"];
-
- $rv = "<img src=\"plugins/tweet/tweet.png\"
- class='tagsPic' style=\"cursor : pointer\"
- onclick=\"tweetArticle($article_id)\"
- title='".__('Share on Twitter')."'>";
-
- return $rv;
- }
-
- function getInfo() {
- $id = db_escape_string($this->link, $_REQUEST['id']);
-
- $result = db_query($this->link, "SELECT title, link
- FROM ttrss_entries, ttrss_user_entries
- WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
-
- if (db_num_rows($result) != 0) {
- $title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
- 100, '...');
- $article_link = db_fetch_result($result, 0, 'link');
- }
-
- print json_encode(array("title" => $title, "link" => $article_link,
- "id" => $id));
- }
-
-
-}
-?>
diff --git a/plugins/tweet/tweet.js b/plugins/tweet/tweet.js
deleted file mode 100644
index 07e89d5f8..000000000
--- a/plugins/tweet/tweet.js
+++ /dev/null
@@ -1,31 +0,0 @@
- function tweetArticle(id) {
- try {
- var query = "?op=pluginhandler&plugin=tweet&method=getInfo&id=" + param_escape(id);
-
- console.log(query);
-
- var d = new Date();
- var ts = d.getTime();
-
- var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
- "status=0,toolbar=0,location=0,width=500,height=400,scrollbars=1,menubar=0");
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- var ti = JSON.parse(transport.responseText);
-
- var share_url = "http://twitter.com/share?_=" + ts +
- "&text=" + param_escape(ti.title) +
- "&url=" + param_escape(ti.link);
-
- w.location.href = share_url;
-
- } });
-
-
- } catch (e) {
- exception_error("tweetArticle", e);
- }
- }
-
diff --git a/plugins/tweet/tweet.png b/plugins/tweet/tweet.png
deleted file mode 100644
index ad3c177a2..000000000
--- a/plugins/tweet/tweet.png
+++ /dev/null
Binary files differ