summaryrefslogtreecommitdiff
path: root/modules/backend-rpc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/backend-rpc.php')
-rw-r--r--modules/backend-rpc.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index e7c1f5721..e93571207 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -982,6 +982,26 @@
return;
}
+ if ($subop == "getTweetInfo") {
+ header("Content-Type: text/html");
+ $id = db_escape_string($_REQUEST['id']);
+
+ $result = db_query($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));
+
+ return;
+ }
+
print "<rpc-reply><error>Unknown method: $subop</error></rpc-reply>";
}
?>