15 Commits
1.4.7 ... 2.1.0

Author SHA1 Message Date
Grant Pannell
5bd3261dc2 Fix readme version 2017-12-25 04:15:16 +10:30
Grant Pannell
0c31d8c37a Version bump 2.1 2017-12-25 04:14:39 +10:30
Grant Pannell
56f9d06435 Sync with tt-rss, use pdo for db queries 2017-12-25 04:11:49 +10:30
Grant Pannell
408e0d7695 Fix missing argument, php 7.1 2017-10-20 01:14:44 +10:30
root
da3f333f98 Fix execute perms 2017-05-16 01:20:09 +09:30
Grant Pannell
254d5fdd9e update readme 2017-05-16 01:15:53 +09:30
Grant Pannell
6d26584d34 Take back my plugin - fix a bunch of bugs which counters not updating,
clean things up, sync back with ttrss source
2017-05-16 01:10:32 +09:30
chyiz
a7fd1e385e Merge branch 'fixCCache' 2017-05-12 02:19:18 -04:00
Matt S
9c75e5a1e2 Update fever_api.php to support CCache class 2017-05-08 21:40:29 +01:00
Colin Dunn
0b1475d938 Update fever_api.php to support Article class
The latest commit to tt-rss now has classes for various objects, including an Article class, which causes errors in the plugin. This update make the plugin functional again.
2017-05-05 11:22:53 +10:00
Torsten Stelling
c4c8660215 Merge pull request #20 from AbeEstrada/patch-1
Update version, closes #18
2015-11-23 18:46:02 +01:00
Abe Estrada
bf23afd8ac Update version, closes #18 2015-05-19 15:22:35 -06:00
Torsten Stelling
16fcb8852c Updated documentation
with Press ;) Seems to work now...
2014-01-15 23:18:59 +01:00
Torsten Stelling
30e3d5cd93 renamed $IS_PRESS to $ID_HACK_FOR_MRREADER
Renamed $IS_PRESS to $ID_HACK_FOR_MRREADER to make code more readable. This helps others understand the code.
2014-01-15 22:48:49 +01:00
Torsten Stelling
cfdb4e92f8 Updates to download section in dokumentation 2014-01-15 17:36:18 +01:00
4 changed files with 970 additions and 1029 deletions

View File

@@ -29,7 +29,7 @@ Following Features are implemented:
## <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>
@@ -38,6 +38,7 @@ These clients should be working fine with this API emulation.
* [Reeder](http://reederapp.com) - iPhone
* [Mr.Reader](http://www.curioustimes.de/mrreader/index.html) - iPad
* [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
* displays feeds as 'orphan' items, but runs fine
@@ -117,3 +118,16 @@ v1.4.6 - 2014/1/15
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

1753
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
View File

@@ -1,59 +1,67 @@
<?php
// do not support refresh command, this could take ages.
if (isset($_REQUEST["refresh"]))
{
exit;
}
// do not support refresh command, this could take ages.
if (isset($_REQUEST["refresh"]))
{
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'])));
$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";
}
chdir("../..");
set_include_path(dirname(__FILE__) . PATH_SEPARATOR .
$tt_root2 . PATH_SEPARATOR .
$tt_root2 . "/include" . PATH_SEPARATOR .
get_include_path());
define('TTRSS_SESSION_NAME', 'ttrss_api_sid');
define('NO_SESSION_AUTOSTART', true);
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";
require_once "db.php";
require_once "db-prefs.php";
require_once "functions.php";
require_once "fever_api.php";
define('AUTH_DISABLE_OTP', true);
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 &&
function_exists("ob_gzhandler")) {
ob_start("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");
} else {
ob_start();
}
if (!init_plugins()) return;
$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);
if ($handler->before($method)) {
if (method_exists($handler, 'index')) {
$handler->index($method);
}
$handler->after();
}
ob_end_flush();
?>
ob_end_flush();
?>

130
fever/init.php Executable file → Normal file
View File

@@ -1,88 +1,80 @@
<?php
class Fever extends Plugin {
private $host;
private $host;
function about() {
return array(1.45,
"Emulates the Fever API for Tiny Tiny RSS",
"digitaldj & murphy");
}
function about() {
return array(2.1,
"Emulates the Fever API for Tiny Tiny RSS",
"DigitalDJ & murphy");
}
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_PREFS_TAB, $this);
}
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_PREFS_TAB, $this);
}
/* plugins/main/init.php hook_prefs_tab */
function before($method) {
return true;
}
function hook_prefs_tab($args) {
if ($args != "prefPrefs") return;
function csrf_ignore($method) {
return true;
}
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __("Fever Emulation") . "\">";
function hook_prefs_tab($args) {
if ($args != "prefPrefs") return;
print "<h3>" . __("Fever Emulation") . "</h3>";
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\">
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 "<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>" . __("Additional details can be found at ") . "<a href=\"http://www.feedafever.com/api\" target=\"_blank\">https://feedafever.com/api</a></p>";
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>" . __("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 "<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"]))
{
$result = db_query("SELECT login FROM ttrss_users WHERE id = '" . db_escape_string($_SESSION["uid"]) . "'");
if ($line = db_fetch_assoc($result))
{
$password = md5($line["login"] . ":" . $_POST["password"]);
$this->host->set($this, "password", $password);
echo __("Password saved.");
}
}
}
function after() {
}
function api_version() {
return 2;
}
function save()
{
if (isset($_POST["password"]) && isset($_SESSION["uid"]))
{
$result = db_query("SELECT login FROM ttrss_users WHERE id = '" . db_escape_string($_SESSION["uid"]) . "'");
if ($line = db_fetch_assoc($result))
{
$password = md5($line["login"] . ":" . $_POST["password"]);
$this->host->set($this, "password", $password);
echo __("Password saved.");
}
}
}
function api_version() {
return 2;
}
}
?>