mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-29 06:21:27 +00:00
implement sharing of arbitrary stuff using bookmarklet and API call, bump API version
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
class API extends Handler {
|
||||
|
||||
const API_LEVEL = 3;
|
||||
const API_LEVEL = 4;
|
||||
|
||||
const STATUS_OK = 0;
|
||||
const STATUS_ERR = 1;
|
||||
@@ -419,6 +419,17 @@ class API extends Handler {
|
||||
print $this->wrap(self::STATUS_ERR, array("error" => 'UNKNOWN_METHOD'));
|
||||
}
|
||||
|
||||
function shareToPublished() {
|
||||
$title = db_escape_string(strip_tags($_REQUEST["title"]));
|
||||
$url = db_escape_string(strip_tags($_REQUEST["url"]));
|
||||
$content = db_escape_string(strip_tags($_REQUEST["content"]));
|
||||
|
||||
if (create_published_article($this->link, $title, $url, $content, $_SESSION["uid"])) {
|
||||
print $this->wrap(self::STATUS_OK, array("status" => 'OK'));
|
||||
} else {
|
||||
print $this->wrap(self::STATUS_ERR, array("error" => 'Publishing failed'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user