Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bd3261dc2 | ||
|
|
0c31d8c37a | ||
|
|
56f9d06435 | ||
|
|
408e0d7695 | ||
|
|
da3f333f98 | ||
|
|
254d5fdd9e | ||
|
|
6d26584d34 | ||
|
|
a7fd1e385e | ||
|
|
9c75e5a1e2 | ||
|
|
0b1475d938 | ||
|
|
c4c8660215 | ||
|
|
bf23afd8ac | ||
|
|
16fcb8852c | ||
|
|
30e3d5cd93 | ||
|
|
cfdb4e92f8 | ||
|
|
04dfc947a8 | ||
|
|
1706ba074f |
19
README.md
19
README.md
@@ -29,7 +29,7 @@ Following Features are implemented:
|
|||||||
|
|
||||||
## <a name="downloads">Downloads</a>
|
## <a name="downloads">Downloads</a>
|
||||||
|
|
||||||
Please click the [```Download ZIP```](https://github.com/dasmurphy/tinytinyrss-fever-plugin/archive/master.zip) button to download current version. ;)
|
Please click on [```releases```](https://github.com/dasmurphy/tinytinyrss-fever-plugin/releases) button to download the latest stable version. Or click the [```Download ZIP```](https://github.com/dasmurphy/tinytinyrss-fever-plugin/archive/master.zip) button to download the edge version. ;)
|
||||||
|
|
||||||
## <a name="supported">Supported/Tested Clients</a>
|
## <a name="supported">Supported/Tested Clients</a>
|
||||||
|
|
||||||
@@ -38,6 +38,7 @@ These clients should be working fine with this API emulation.
|
|||||||
* [Reeder](http://reederapp.com) - iPhone
|
* [Reeder](http://reederapp.com) - iPhone
|
||||||
* [Mr.Reader](http://www.curioustimes.de/mrreader/index.html) - iPad
|
* [Mr.Reader](http://www.curioustimes.de/mrreader/index.html) - iPad
|
||||||
* [ReadKit](http://readkitapp.com) - OS X
|
* [ReadKit](http://readkitapp.com) - OS X
|
||||||
|
* [Press](https://play.google.com/store/apps/details?id=com.twentyfivesquares.press) - Android
|
||||||
* [Meltdown](https://github.com/phubbard/Meltdown) - Android
|
* [Meltdown](https://github.com/phubbard/Meltdown) - Android
|
||||||
* displays feeds as 'orphan' items, but runs fine
|
* displays feeds as 'orphan' items, but runs fine
|
||||||
|
|
||||||
@@ -114,3 +115,19 @@ v1.4.6 - 2014/1/15
|
|||||||
|
|
||||||
* merged bigger pull request to get more Fever API RSS Readers to work
|
* merged bigger pull request to get more Fever API RSS Readers to work
|
||||||
|
|
||||||
|
v1.4.7 - 2014/1/15
|
||||||
|
|
||||||
|
* added rewrite url function to module, since it was removed from tinytinyrss
|
||||||
|
|
||||||
|
v2.0 - 2017/5/16
|
||||||
|
|
||||||
|
* Fix ccache exceptions
|
||||||
|
* Sync previously copied snipets with latest tt-rss source
|
||||||
|
* General clean up / refactor
|
||||||
|
* Replace clunky sanitization with what is provided by tt-rss
|
||||||
|
* Use new Article class for enclosures
|
||||||
|
|
||||||
|
v2.1 - 2017/12/25
|
||||||
|
|
||||||
|
* Sync previously copied snipets with latest tt-rss source
|
||||||
|
* Use PDO API for DB queries
|
||||||
1707
fever/fever_api.php
Executable file → Normal file
1707
fever/fever_api.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
100
fever/index.php
Executable file → Normal file
100
fever/index.php
Executable file → Normal file
@@ -1,59 +1,67 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// do not support refresh command, this could take ages.
|
// do not support refresh command, this could take ages.
|
||||||
if (isset($_REQUEST["refresh"]))
|
if (isset($_REQUEST["refresh"]))
|
||||||
{
|
{
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* api/index.php */
|
||||||
|
error_reporting(E_ERROR | E_PARSE);
|
||||||
|
|
||||||
error_reporting(E_ERROR | E_PARSE);
|
require_once "../../config.php";
|
||||||
|
|
||||||
|
set_include_path(dirname(__FILE__) . PATH_SEPARATOR .
|
||||||
|
dirname(dirname(dirname(__FILE__))) . PATH_SEPARATOR .
|
||||||
|
dirname(dirname(dirname(__FILE__))) . "/include" . PATH_SEPARATOR .
|
||||||
|
get_include_path());
|
||||||
|
|
||||||
$tt_root = dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME'])));
|
chdir("../..");
|
||||||
$tt_root2 = $tt_root;
|
|
||||||
if (file_exists($tt_root."/config.php")) {
|
|
||||||
require_once $tt_root."/config.php";
|
|
||||||
} else { //if (file_exists("../../config.php")) {
|
|
||||||
$tt_root = "../..";
|
|
||||||
$tt_root2 = dirname(dirname(dirname(__FILE__)));
|
|
||||||
require_once $tt_root."/config.php";
|
|
||||||
}
|
|
||||||
|
|
||||||
set_include_path(dirname(__FILE__) . PATH_SEPARATOR .
|
define('TTRSS_SESSION_NAME', 'ttrss_api_sid');
|
||||||
$tt_root2 . PATH_SEPARATOR .
|
define('NO_SESSION_AUTOSTART', true);
|
||||||
$tt_root2 . "/include" . PATH_SEPARATOR .
|
|
||||||
get_include_path());
|
|
||||||
|
|
||||||
chdir($tt_root);
|
require_once "autoload.php";
|
||||||
|
require_once "db.php";
|
||||||
|
require_once "db-prefs.php";
|
||||||
|
require_once "functions.php";
|
||||||
|
require_once "sessions.php";
|
||||||
|
|
||||||
|
require_once "fever_api.php";
|
||||||
|
|
||||||
define('NO_SESSION_AUTOSTART', true);
|
ini_set("session.gc_maxlifetime", 86400);
|
||||||
|
|
||||||
require_once "autoload.php";
|
define('AUTH_DISABLE_OTP', true);
|
||||||
require_once "db.php";
|
|
||||||
require_once "db-prefs.php";
|
|
||||||
require_once "functions.php";
|
|
||||||
require_once "fever_api.php";
|
|
||||||
|
|
||||||
define('AUTH_DISABLE_OTP', true);
|
if (defined('ENABLE_GZIP_OUTPUT') && ENABLE_GZIP_OUTPUT &&
|
||||||
|
function_exists("ob_gzhandler")) {
|
||||||
|
|
||||||
if (defined('ENABLE_GZIP_OUTPUT') && ENABLE_GZIP_OUTPUT &&
|
ob_start("ob_gzhandler");
|
||||||
function_exists("ob_gzhandler")) {
|
} else {
|
||||||
|
ob_start();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_REQUEST["sid"]) {
|
||||||
|
session_id($_REQUEST["sid"]);
|
||||||
|
@session_start();
|
||||||
|
} else if (defined('_API_DEBUG_HTTP_ENABLED')) {
|
||||||
|
@session_start();
|
||||||
|
}
|
||||||
|
|
||||||
|
startup_gettext();
|
||||||
|
|
||||||
ob_start("ob_gzhandler");
|
if (!init_plugins()) return;
|
||||||
} else {
|
|
||||||
ob_start();
|
$handler = new FeverAPI($_REQUEST);
|
||||||
}
|
|
||||||
|
|
||||||
if (!init_plugins()) return;
|
if ($handler->before("")) {
|
||||||
|
if (method_exists($handler, 'index')) {
|
||||||
|
$handler->index();
|
||||||
|
}
|
||||||
|
$handler->after();
|
||||||
|
}
|
||||||
|
|
||||||
|
header("Api-Content-Length: " . ob_get_length());
|
||||||
|
|
||||||
$handler = new FeverAPI(Db::get(), $_REQUEST);
|
ob_end_flush();
|
||||||
|
?>
|
||||||
if ($handler->before($method)) {
|
|
||||||
if (method_exists($handler, 'index')) {
|
|
||||||
$handler->index($method);
|
|
||||||
}
|
|
||||||
$handler->after();
|
|
||||||
}
|
|
||||||
|
|
||||||
ob_end_flush();
|
|
||||||
|
|
||||||
?>
|
|
||||||
130
fever/init.php
Executable file → Normal file
130
fever/init.php
Executable file → Normal file
@@ -1,88 +1,80 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Fever extends Plugin {
|
class Fever extends Plugin {
|
||||||
private $host;
|
private $host;
|
||||||
|
|
||||||
function about() {
|
function about() {
|
||||||
return array(1.45,
|
return array(2.1,
|
||||||
"Emulates the Fever API for Tiny Tiny RSS",
|
"Emulates the Fever API for Tiny Tiny RSS",
|
||||||
"digitaldj & murphy");
|
"DigitalDJ & murphy");
|
||||||
}
|
}
|
||||||
|
|
||||||
function init($host) {
|
function init($host) {
|
||||||
$this->host = $host;
|
$this->host = $host;
|
||||||
$host->add_hook($host::HOOK_PREFS_TAB, $this);
|
|
||||||
}
|
$host->add_hook($host::HOOK_PREFS_TAB, $this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* plugins/main/init.php hook_prefs_tab */
|
||||||
|
|
||||||
function before($method) {
|
function hook_prefs_tab($args) {
|
||||||
return true;
|
if ($args != "prefPrefs") return;
|
||||||
}
|
|
||||||
|
|
||||||
function csrf_ignore($method) {
|
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __("Fever Emulation") . "\">";
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function hook_prefs_tab($args) {
|
print "<h3>" . __("Fever Emulation") . "</h3>";
|
||||||
if ($args != "prefPrefs") return;
|
|
||||||
|
|
||||||
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __("Fever Emulation") . "\">";
|
print "<p>" . __("Since the Fever API uses a different authentication mechanism to Tiny Tiny RSS, you must set a separate password to login. This password may be the same as your Tiny Tiny RSS password.") . "</p>";
|
||||||
|
|
||||||
print "<h3>" . __("Fever Emulation") . "</h3>";
|
print "<p>" . __("Set a password to login with Fever:") . "</p>";
|
||||||
|
|
||||||
print "<p>" . __("Since the Fever API uses a different authentication mechanism to Tiny Tiny RSS, you must set a separate password to login. This password may be the same as your Tiny Tiny RSS password.") . "</p>";
|
print "<form dojoType=\"dijit.form.Form\">";
|
||||||
|
|
||||||
print "<p>" . __("Set a password to login with Fever:") . "</p>";
|
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
|
||||||
|
evt.preventDefault();
|
||||||
|
if (this.validate()) {
|
||||||
|
new Ajax.Request('backend.php', {
|
||||||
|
parameters: dojo.objectToQuery(this.getValues()),
|
||||||
|
onComplete: function(transport) {
|
||||||
|
notify_info(transport.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//this.reset();
|
||||||
|
}
|
||||||
|
</script>";
|
||||||
|
|
||||||
|
print_hidden("op", "pluginhandler");
|
||||||
|
print_hidden("method", "save");
|
||||||
|
print_hidden("plugin", "fever");
|
||||||
|
|
||||||
print "<form dojoType=\"dijit.form.Form\">";
|
print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" type=\"password\" name=\"password\" />";
|
||||||
|
print "<button dojoType=\"dijit.form.Button\" type=\"submit\">" . __("Set Password") . "</button>";
|
||||||
|
print "</form>";
|
||||||
|
|
||||||
print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
|
print "<p>" . __("To login with the Fever API, set your server details in your favourite RSS application to: ") . get_self_url_prefix() . "/plugins/fever/" . "</p>";
|
||||||
evt.preventDefault();
|
print "<p>" . __("Additional details can be found at ") . "<a href=\"http://www.feedafever.com/api\" target=\"_blank\">https://feedafever.com/api</a></p>";
|
||||||
if (this.validate()) {
|
|
||||||
new Ajax.Request('backend.php', {
|
|
||||||
parameters: dojo.objectToQuery(this.getValues()),
|
|
||||||
onComplete: function(transport) {
|
|
||||||
notify_info(transport.responseText);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//this.reset();
|
|
||||||
}
|
|
||||||
</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=\"fever\" />";
|
|
||||||
print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" type=\"password\" name=\"password\" />";
|
|
||||||
print "<button dojoType=\"dijit.form.Button\" type=\"submit\">" . __("Set Password") . "</button>";
|
|
||||||
print "</form>";
|
|
||||||
|
|
||||||
print "<p>" . __("To login with the Fever API, set your server details in your favourite RSS application to: ") . get_self_url_prefix() . "/plugins/fever/" . "</p>";
|
print "<p>" . __("Note: Due to the limitations of the API and some RSS clients (for example, Reeder on iOS), some features are unavailable: \"Special\" Feeds (Published / Tags / Labels / Fresh / Recent), Nested Categories (hierarchy is flattened)") . "</p>";
|
||||||
print "<p>" . __("Additional details can be found at ") . "<a href=\"http://www.feedafever.com/api\" target=\"_blank\">http://www.feedafever.com/api</a></p>";
|
|
||||||
|
|
||||||
print "<p>" . __("Note: Due to the limitations of the API and some RSS clients (for example, Reeder on iOS), some features are unavailable: \"Special\" Feeds (Published / Tags / Labels / Fresh / Recent), Nested Categories (hierarchy is flattened)") . "</p>";
|
print "</div>";
|
||||||
|
}
|
||||||
|
|
||||||
print "</div>";
|
function save()
|
||||||
}
|
{
|
||||||
|
if (isset($_POST["password"]) && isset($_SESSION["uid"]))
|
||||||
function save()
|
{
|
||||||
{
|
$result = db_query("SELECT login FROM ttrss_users WHERE id = '" . db_escape_string($_SESSION["uid"]) . "'");
|
||||||
if (isset($_POST["password"]) && isset($_SESSION["uid"]))
|
if ($line = db_fetch_assoc($result))
|
||||||
{
|
{
|
||||||
$result = db_query("SELECT login FROM ttrss_users WHERE id = '" . db_escape_string($_SESSION["uid"]) . "'");
|
$password = md5($line["login"] . ":" . $_POST["password"]);
|
||||||
if ($line = db_fetch_assoc($result))
|
$this->host->set($this, "password", $password);
|
||||||
{
|
echo __("Password saved.");
|
||||||
$password = md5($line["login"] . ":" . $_POST["password"]);
|
}
|
||||||
$this->host->set($this, "password", $password);
|
}
|
||||||
echo __("Password saved.");
|
}
|
||||||
}
|
|
||||||
}
|
function api_version() {
|
||||||
}
|
return 2;
|
||||||
|
}
|
||||||
function after() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function api_version() {
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user