Commit 3159864f authored by moli's avatar moli
Browse files

No commit message

No commit message
parent cf0de204
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>
feedproxy
=========
it's like a personal Google Reader server
**it's like a personal Google Reader server**
A backend to aggregate many rss or atom news feeds into one, your own feed.
......@@ -18,7 +18,7 @@ Supports Amazon Kindle, can send the referred article contents with images autom
Features
* Intended Audience: Advanced End Users
* requires an always online server with php, curl, pear, mysql, httpd
* requires an always online server with `php`, `curl`, `pear`, `mysql`, `httpd`
* fetch frequency set individually by watched feeds
* supports multiple user accounts
* (optional) marks news read when your client showed the news to you
......@@ -31,60 +31,41 @@ Features
Some tweaks:
*) turn on read receipt in the configuration file feedproxy.conf by setting [reader]/state_read to true
*) can measure which news link you visited by setting [reader]/state_visited to true in the configuration file feedproxy.conf
*) if you are using various feed reader clients you can change the default configuration options in the query string
e.g. http://example.com/feedproxy/feedproxy.php?missing_http204=1
*) set up multiple accounts by specifing an account name for a feed in the feedproxy_subs table
UPDATE feedproxy_subs SET account='johndoe' WHERE account='' AND feedid=1;
now use the following url: http://example.com/feedproxy/feedproxy.php?account=johndoe
*) send the content of selected feeds to your Kindle via Kindle-It from Five Filters
UPDATE feedproxy_subs SET kindleit='yes' WHERE account='johndoe' AND feedid=1;
* turn on read receipt in the configuration file `feedproxy.conf` by setting `[reader]/state_read` to `true`
* can measure which news link you visited by setting `[reader]/state_visited` to `true` in the configuration file `feedproxy.conf`
* if you are using various feed reader clients you can change the default configuration options in the query string
e.g. `http://example.com/feedproxy/feedproxy.php?missing_http204=1`
* set up multiple accounts by specifing an account name for a feed in the `feedproxy_subs` table
`UPDATE feedproxy_subs SET account='johndoe' WHERE account='' AND feedid=1;`
now use the following url: `http://example.com/feedproxy/feedproxy.php?account=johndoe`
* send the content of selected feeds to your Kindle via Kindle-It from Five Filters
`UPDATE feedproxy_subs SET kindleit='yes' WHERE account='johndoe' AND feedid=1;`
make sure you name your account to the username of your kindle email address!
e.g. if your kindle email is janedoe@free.kindle.com then feedproxy account name must be janedoe!
*) send some of the subscription news by email to a specified email address
UPDATE feedproxy_subs SET emailto='send.email.here@example.com, and.an.other.copy.here@example.com' WHERE account='johndoe' AND feedid=1;
*) you can add an optional password so others knowing your account name cannot read your news
create a file named pw_account_johndoe_{$md5string}.php where '{$md5string}' is a random md5 string
now use the following url: http://example.com/feedproxy/feedproxy.php?account=johndoe&auth=password
e.g. if your kindle email is `janedoe@free.kindle.com` then feedproxy account name must be `janedoe`!
* send some of the subscription news by email to a specified email address
`UPDATE feedproxy_subs SET emailto='send.email.here@example.com, and.an.other.copy.here@example.com' WHERE account='johndoe' AND feedid=1;`
* you can add an optional password so others knowing your account name cannot read your news
create a file named `pw_account_johndoe_{$md5string}.php` where `'{$md5string}'` is a random md5 string
now use the following url: `http://example.com/feedproxy/feedproxy.php?account=johndoe&auth=password`
if the password file exists on the server, you must provide your password in every query
*) test your installation by using testfeed.php as a feed provider url. add a new feed to the database
INSERT INTO feedproxy_feed SET url='http://example.com/feedproxy/testfeed.php'; INSERT INTO feedproxy_subs SET feedid=LAST_INSERT_ID();
* test your installation by using `testfeed.php` as a feed provider url. add a new feed to the database
`INSERT INTO feedproxy_feed SET url='http://example.com/feedproxy/testfeed.php'; INSERT INTO feedproxy_subs SET feedid=LAST_INSERT_ID();`
it will create a news entry on every run, if you set the fetchrate to 15 minutes then every 15 minutes
INSTALLATION:
1) copy feedproxy to an always online server
2) install php-cli, php-pear, php-curl, php-mysql onto the server
3) install XML_Feed_Parser PEAR package onto the server
4) create a mysql access for feedproxy
5) create feedproxy database tables by using the scheme in feedproxy.sql
6) replace placeholder mysql hostname, username and database name in feedproxy.conf to your newly created access data
7) replace placeholder mysql password in the 3rd line of pw_db*.php file
8) install a crontab, see example file feedproxy.crontab
9) insert a database row for a feed you'd like to read
e.g. INSERT INTO feedproxy_feed SET url='http://moli.hu/gamerankings/gamerankings.atom';
you can modify the default fetchrate (15 minutes) e.g. UPDATE feedproxy_feed SET fetchrate=60 WHERE feedid=1;
10) insert a database row for the feed you just inserted to subscribe to it
e.g. INSERT INTO feedproxy_subs SET feedid=1;
11) add a new feed to your feed reader client, the address is your feedproxy installation url on your server
e.g. http://example.com/feedproxy/feedproxy.php
1. copy feedproxy to an always online server
2. install `php-cli`, `php-pear`, `php-curl`, `php-mysql` onto the server
3. install `XML_Feed_Parser` PEAR package onto the server
4. create a mysql access for feedproxy
5. create feedproxy database tables by using the scheme in `feedproxy.sql`
6. replace placeholder mysql hostname, username and database name in `feedproxy.conf` to your newly created access data
7. replace placeholder mysql password in the 3rd line of `pw_db*.php` file
8. install a crontab, see example file `feedproxy.crontab`
9. insert a database row for a feed you'd like to read
e.g. `INSERT INTO feedproxy_feed SET url='http://moli.hu/gamerankings/gamerankings.atom';`
you can modify the default fetchrate (15 minutes) e.g. `UPDATE feedproxy_feed SET fetchrate=60 WHERE feedid=1;`
10. insert a database row for the feed you just inserted to subscribe to it
e.g. `INSERT INTO feedproxy_subs SET feedid=1;`
11. add a new feed to your feed reader client, the address is your feedproxy installation url on your server
e.g. `http://example.com/feedproxy/feedproxy.php`
This diff is collapsed.
#!/bin/bash
if [ `ps --no-heading -C feedproxy-aggregator | wc -l` -lt 3 ]
then
php feedproxy-aggregator.php
fi
<?php
function skip ($feed, $entry) {
if (false
|| ($feed["url"]=="http://example.com/foobar.rss" && !empty($entry["title"]) && !preg_match("/^FooBar/",$entry["title"]))
) return true;
return false;
}
?>
\ No newline at end of file
[database]
hostname = "hostname.of.your.mysql.server.com"
username = "username_of_your_mysql_access"
database = "name_of_your_mysql_database_on_the_mysql_server"
[reader]
; set this if your feed reader client is broken (like the opera browser) and cannot parse over like 10 feed entries at once
is_broken = false
; set this if you want to report news read state to the feedproxy server. measures by including a faux image in every news. increases traffic and load
state_read = true
; set this if you want to report news visited state to the feedproxy server. measures by making a redirect for news links so it increases traffic and load
state_visited = false
; set this if your feed reader client cannot display news entry authors (like trssreader)
missing_author = true
; set this if your feed reader client doesnt understand http 204 return code (like akregator)
missing_http204 = false
; set this if your feed reader client doesnt handle entry updated times (like akregator) and does not redisplay entries as new if their updated times are new
missing_updated = false
[email]
from = "sender.of.the.emails@example.com"
[base]
url = "http://example.com/feedproxy/"
CREATE TABLE `feedproxy_feed` (
`feedid` smallint(5) unsigned NOT NULL auto_increment,
`groupid` varchar(63) default NULL,
`url` varchar(255) NOT NULL default '',
`fetchrate` smallint(5) unsigned NOT NULL default '15',
`nextfetch` timestamp NOT NULL default CURRENT_TIMESTAMP,
`title` varchar(255) default NULL,
`link` varchar(255) default NULL,
`etag` varchar(255) default NULL,
`lastmod` varchar(63) default NULL,
`updated` timestamp NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`feedid`),
UNIQUE KEY `url` (`url`),
KEY `nextfetch` (`nextfetch`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `feedproxy_subs` (
`account` varchar(63) NOT NULL default '',
`feedid` smallint(5) unsigned NOT NULL auto_increment,
`active` enum('yes') default 'yes',
`kindleit` enum('no','yes') NOT NULL default 'no',
`emailto` varchar(255) NOT NULL default '',
UNIQUE KEY `feedid_account` (`feedid`,`account`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `feedproxy_entry` (
`entryid` int(10) unsigned NOT NULL auto_increment,
`feedid` smallint(5) unsigned NOT NULL,
`groupid` varchar(63) NOT NULL default '0',
`created` timestamp NOT NULL default '0000-00-00 00:00:00',
`published` timestamp NOT NULL default '0000-00-00 00:00:00',
`updated` timestamp NOT NULL default '0000-00-00 00:00:00',
`uniqueid` blob,
`link` text,
`author` varchar(255) default NULL,
`author_url` varchar(255) default NULL,
`author_email` varchar(255) default NULL,
`title` text,
`summary` text,
`content` text,
`touch` timestamp NOT NULL default '0000-00-00 00:00:00' on update CURRENT_TIMESTAMP,
PRIMARY KEY (`entryid`),
UNIQUE KEY `groupid_uniqueid` (`groupid`,`uniqueid`(255)),
KEY `feedid` (`feedid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `feedproxy_state` (
`account` varchar(63) NOT NULL default '',
`entryid` int(10) unsigned NOT NULL auto_increment,
`state` enum('new','forwarded','read','visited') NOT NULL default 'new',
`forwardedto` varchar(63) default NULL,
`forwardedtimes` smallint(5) unsigned NOT NULL default '0',
`auth` varchar(63) NOT NULL default '',
`ip` varchar(15) default NULL,
`touch` timestamp NOT NULL default '0000-00-00 00:00:00' on update CURRENT_TIMESTAMP,
UNIQUE KEY `entryid_account` (`entryid`,`account`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
<?php
/*
password_for_fetching_feed_news_data_into_your_feed_reader_client
*/
?>
\ No newline at end of file
<?php
/*
password_for_mysql_database_server
*/
?>
\ No newline at end of file
<?php
$conf = parse_ini_file ("feedproxy.conf");
$filepath="{$conf["base"]["url"]}feedproxy/testfeed.php";
$title="test";
$now = date ("c");
$stamp = time ();
header ("content-type: application/atom+xml", true);
echo <<<HEREDOC
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
<id>$filepath</id>
<updated>$now</updated>
<title>$title</title>
<link rel="self" href="$filepath" type="application/atom+xml" title="$title" hreflang="en"/>
<author><name>$title</name></author>
<entry>
<id>$filepath?$stamp</id>
<updated>$now</updated>
<title>new $now</title>
<content type="html">new $stamp</content>
</entry>
<entry>
<id>$filepath</id>
<updated>$now</updated>
<title>updated $now</title>
<content type="html">updated $now</content>
</entry>
</feed>
HEREDOC;
?>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment