2022-08-07 00:22:50 +03:00
# RSS-Bridge
2019-06-25 19:39:28 +03:00
![RSS-Bridge ](static/logo_600px.png )
2022-08-07 00:22:50 +03:00
RSS-Bridge is a PHP project capable of generating RSS and Atom feeds for websites that don't have one.
2022-01-20 07:45:53 +03:00
[![LICENSE ](https://img.shields.io/badge/license-UNLICENSE-blue.svg )](UNLICENSE)
[![GitHub release ](https://img.shields.io/github/release/rss-bridge/rss-bridge.svg?logo=github )](https://github.com/rss-bridge/rss-bridge/releases/latest)
2022-01-20 08:09:57 +03:00
[![irc.libera.chat ](https://img.shields.io/badge/irc.libera.chat-%23rssbridge-blue.svg )](https://web.libera.chat/#rssbridge)
2022-10-12 21:48:34 +03:00
[![Chat on Matrix ](https://matrix.to/img/matrix-badge.svg )](https://matrix.to/#/#rssbridge:libera.chat)
2023-02-08 21:48:54 +03:00
[![Actions Status ](https://img.shields.io/github/actions/workflow/status/RSS-Bridge/rss-bridge/tests.yml?branch=master&label=GitHub%20Actions&logo=github )](https://github.com/RSS-Bridge/rss-bridge/actions)
2013-08-07 02:21:46 +04:00
2022-11-17 20:05:44 +03:00
|||
|:-:|:-:|
|![Screenshot #1 ](/static/screenshot-1.png?raw=true)|![Screenshot #2 ](/static/screenshot-2.png?raw=true)|
|![Screenshot #3 ](/static/screenshot-3.png?raw=true)|![Screenshot #4 ](/static/screenshot-4.png?raw=true)|
|![Screenshot #5 ](/static/screenshot-5.png?raw=true)|![Screenshot #6 ](/static/screenshot-6.png?raw=true)|
|![Screenshot #7 ](/static/twitter-form.png?raw=true)|![Screenshot #8 ](/static/twitter-rasmus.png?raw=true)|
2022-11-17 20:51:37 +03:00
## A subset of bridges
* `YouTube` : YouTube user channel, playlist or search
* `Twitter` : Return keyword/hashtag search or user timeline
* `Telegram` : Return the latest posts from a public group
* `Reddit` : Return the latest posts from a subreddit or user
* `Filter` : Filter an existing feed url
* `Vk` : Latest posts from a user or group
* `FeedMerge` : Merge two or more existing feeds into one
* `Twitch` : Fetch the latest videos from a channel
* `ThePirateBay` : Returns the newest indexed torrents from [The Pirate Bay ](https://thepiratebay.se/ ) with keywords
And [many more ](bridges/ ), thanks to the community!
2022-11-17 20:05:44 +03:00
[Full documentation ](https://rss-bridge.github.io/rss-bridge/index.html )
2013-08-11 15:30:41 +04:00
2022-08-07 00:22:50 +03:00
Check out RSS-Bridge right now on https://rss-bridge.org/bridge01 or find another
[public instance ](https://rss-bridge.github.io/rss-bridge/General/Public_Hosts.html ).
2013-08-08 00:33:21 +04:00
2022-08-07 00:22:50 +03:00
## Tutorial
2018-09-16 19:20:35 +03:00
2023-01-31 00:42:39 +03:00
RSS-Bridge requires php 7.4 (or higher).
2022-09-05 03:32:06 +03:00
2022-08-07 00:22:50 +03:00
### Install with git:
2018-09-16 19:20:35 +03:00
2022-08-07 00:22:50 +03:00
```bash
cd /var/www
git clone https://github.com/RSS-Bridge/rss-bridge.git
2018-09-16 16:12:53 +03:00
2022-08-07 00:22:50 +03:00
# Give the http user write permission to the cache folder
chown www-data:www-data /var/www/rss-bridge/cache
2013-08-12 00:44:05 +04:00
2022-08-07 00:22:50 +03:00
# Optionally copy over the default config file
cp config.default.ini.php config.ini.php
2013-08-13 00:46:16 +04:00
2022-08-07 00:22:50 +03:00
# Optionally copy over the default whitelist file
cp whitelist.default.txt whitelist.txt
```
2018-09-16 19:20:35 +03:00
2022-08-07 00:22:50 +03:00
Example config for nginx:
2013-08-13 00:46:16 +04:00
2022-08-07 00:22:50 +03:00
```nginx
# /etc/nginx/sites-enabled/rssbridge
server {
listen 80;
2022-09-05 03:32:06 +03:00
server_name example.com;
2022-08-07 00:22:50 +03:00
root /var/www/rss-bridge;
index index.php;
2018-09-16 16:12:53 +03:00
2022-08-07 00:22:50 +03:00
location ~ \.php$ {
include snippets/fastcgi-php.conf;
2022-10-29 11:21:51 +03:00
fastcgi_read_timeout 60s;
2022-08-07 00:22:50 +03:00
fastcgi_pass unix:/run/php/php-fpm.sock;
}
}
```
2013-08-07 02:31:25 +04:00
2022-08-07 00:22:50 +03:00
### Install with Docker:
2018-09-16 19:20:35 +03:00
2022-08-07 00:22:50 +03:00
Install by using docker image from Docker Hub:
2013-08-12 00:32:25 +04:00
2022-08-07 00:22:50 +03:00
```bash
# Create container
docker create --name=rss-bridge --publish 3000:80 rssbridge/rss-bridge
2018-09-16 19:20:35 +03:00
2022-08-07 00:22:50 +03:00
# Start container
docker start rss-bridge
```
2014-05-26 02:47:33 +04:00
2022-08-07 00:22:50 +03:00
Browse http://localhost:3000/
2018-09-16 19:20:35 +03:00
2022-08-07 00:22:50 +03:00
Install by locally building the image:
2014-05-26 02:47:33 +04:00
2022-08-07 00:22:50 +03:00
```bash
# Build image from Dockerfile
docker build -t rss-bridge .
2016-08-03 00:32:30 +03:00
2022-08-07 00:22:50 +03:00
# Create container
docker create --name rss-bridge --publish 3000:80 rss-bridge
2018-09-16 19:20:35 +03:00
2022-08-07 00:22:50 +03:00
# Start the container
docker start rss-bridge
```
Browse http://localhost:3000/
2022-12-03 06:56:37 +03:00
#### Install with docker-compose
Create a `docker-compose.yml` file locally with with the following content:
```yml
version: '2'
services:
rss-bridge:
image: rssbridge/rss-bridge:latest
volumes:
- < /local/custom/path>:/config
ports:
- 3000:80
restart: unless-stopped
```
Then launch with `docker-compose` :
```bash
docker-compose up
```
Browse http://localhost:3000/
2022-08-07 00:22:50 +03:00
### Alternative installation methods
2018-09-16 19:20:35 +03:00
2016-08-03 00:32:30 +03:00
[![Deploy on Scalingo ](https://cdn.scalingo.com/deploy/button.svg )](https://my.scalingo.com/deploy?source=https://github.com/sebsauvage/rss-bridge)
2019-06-08 15:53:26 +03:00
[![Deploy to Heroku ](https://www.herokucdn.com/deploy/button.svg )](https://heroku.com/deploy)
2022-04-05 13:22:47 +03:00
[![Deploy to Cloudron ](https://cloudron.io/img/button.svg )](https://www.cloudron.io/store/com.rssbridgeapp.cloudronapp.html)
2018-09-16 16:12:53 +03:00
2022-08-07 00:22:50 +03:00
The Heroku quick deploy currently does not work. It might possibly work if you fork this repo and
modify the `repository` in `scalingo.json` . See https://github.com/RSS-Bridge/rss-bridge/issues/2688
Learn more in
[Installation ](https://rss-bridge.github.io/rss-bridge/For_Hosts/Installation.html ).
2022-11-17 20:51:37 +03:00
## How-to
### How to create a new bridge from scratch
2022-08-07 00:22:50 +03:00
2022-09-21 23:20:51 +03:00
Create the new bridge in e.g. `bridges/BearBlogBridge.php` :
2022-08-07 00:22:50 +03:00
```php
< ?php
2022-09-21 23:20:51 +03:00
class BearBlogBridge extends BridgeAbstract
2022-08-07 00:22:50 +03:00
{
2022-09-21 23:20:51 +03:00
const NAME = 'BearBlog (bearblog.dev)';
2022-08-07 00:22:50 +03:00
public function collectData()
{
2022-09-21 23:20:51 +03:00
$dom = getSimpleHTMLDOM('https://herman.bearblog.dev/blog/');
2022-11-17 20:51:37 +03:00
foreach ($dom->find('.blog-posts li') as $li) {
$a = $li->find('a', 0);
$this->items[] = [
'title' => $a->plaintext,
'uri' => 'https://herman.bearblog.dev' . $a->href,
2022-08-07 00:22:50 +03:00
];
}
}
}
```
Learn more in [bridge api ](https://rss-bridge.github.io/rss-bridge/Bridge_API/index.html ).
### How to enable all bridges
2022-09-05 03:32:06 +03:00
Write an asterisks to `whitelist.txt` :
2022-08-07 00:22:50 +03:00
echo '*' > whitelist.txt
Learn more in [enabling briges ](https://rss-bridge.github.io/rss-bridge/For_Hosts/Whitelisting.html )
2018-09-16 19:20:35 +03:00
2022-08-07 00:22:50 +03:00
### How to enable a bridge
2018-09-16 19:20:35 +03:00
2022-08-07 00:22:50 +03:00
Add the bridge name to `whitelist.txt` :
2018-09-16 19:20:35 +03:00
2022-08-07 00:22:50 +03:00
echo 'FirefoxAddonsBridge' >> whitelist.txt
2018-09-16 19:20:35 +03:00
2022-08-07 00:22:50 +03:00
### How to enable debug mode
Create a file named `DEBUG` :
touch DEBUG
Learn more in [debug mode ](https://rss-bridge.github.io/rss-bridge/For_Developers/Debug_mode.html ).
### How to create a new output format
[Create a new format ](https://rss-bridge.github.io/rss-bridge/Format_API/index.html ).
## Explanation
We are RSS-Bridge community, a group of developers continuing the project initiated by sebsauvage,
webmaster of
[sebsauvage.net ](https://sebsauvage.net ), author of
[Shaarli ](https://sebsauvage.net/wiki/doku.php?id=php:shaarli ) and
[ZeroBin ](https://sebsauvage.net/wiki/doku.php?id=php:zerobin ).
2018-09-16 19:20:35 +03:00
2022-07-04 08:33:23 +03:00
See [CONTRIBUTORS.md ](CONTRIBUTORS.md )
2020-10-09 21:29:02 +03:00
2022-08-07 00:22:50 +03:00
RSS-Bridge uses caching to prevent services from banning your server for repeatedly updating feeds.
The specific cache duration can be different between bridges. Cached files are deleted automatically after 24 hours.
RSS-Bridge allows you to take full control over which bridges are displayed to the user.
That way you can host your own RSS-Bridge service with your favorite collection of bridges!
2022-11-17 20:51:37 +03:00
## Reference
### FeedItem properties
```php
$item = [
'uri' => 'https://example.com/blog/hello',
'title' => 'Hello world',
// Publication date in unix timestamp
'timestamp' => 1668706254,
'author' => 'Alice',
'content' => 'Here be item content',
'enclosures' => [
'https://example.com/foo.png',
'https://example.com/bar.png'
],
'categories' => [
'news',
'tech',
],
// Globally unique id
'uid' => 'e7147580c8747aad',
]
```
### Output formats:
2022-08-07 00:22:50 +03:00
* `Atom` : Atom feed, for use in feed readers
* `Html` : Simple HTML page
* `Json` : JSON, for consumption by other applications
* `Mrss` : MRSS feed, for use in feed readers
* `Plaintext` : Raw text, for consumption by other applications
### Licenses
2013-08-07 02:21:46 +04:00
2018-09-16 19:20:35 +03:00
The source code for RSS-Bridge is [Public Domain ](UNLICENSE ).
RSS-Bridge uses third party libraries with their own license:
2014-05-21 19:21:53 +04:00
2022-04-17 00:03:15 +03:00
* [`Parsedown` ](https://github.com/erusev/parsedown ) licensed under the [MIT License ](https://opensource.org/licenses/MIT )
* [`PHP Simple HTML DOM Parser` ](https://simplehtmldom.sourceforge.io/docs/1.9/index.html ) licensed under the [MIT License ](https://opensource.org/licenses/MIT )
* [`php-urljoin` ](https://github.com/fluffy-critter/php-urljoin ) licensed under the [MIT License ](https://opensource.org/licenses/MIT )
2022-06-09 19:11:27 +03:00
* [`Laravel framework` ](https://github.com/laravel/framework/ ) licensed under the [MIT License ](https://opensource.org/licenses/MIT )
2013-08-08 00:33:21 +04:00
2022-08-07 00:22:50 +03:00
## Rant
2013-08-07 02:21:46 +04:00
*Dear so-called "social" websites.*
2015-12-06 18:32:41 +03:00
Your catchword is "share", but you don't want us to share. You want to keep us within your walled gardens. That's why you've been removing RSS links from webpages, hiding them deep on your website, or removed feeds entirely, replacing it with crippled or demented proprietary API. **FUCK YOU.**
2013-08-07 02:21:46 +04:00
2018-09-16 19:20:35 +03:00
You're not social when you hamper sharing by removing feeds. You're happy to have customers creating content for your ecosystem, but you don't want this content out - a content you do not even own. Google Takeout is just a gimmick. We want our data to flow, we want RSS or Atom feeds.
2013-08-07 02:21:46 +04:00
2018-09-16 19:20:35 +03:00
We want to share with friends, using open protocols: RSS, Atom, XMPP, whatever. Because no one wants to have *your* service with *your* applications using *your* API force-feeding them. Friends must be free to choose whatever software and service they want.
2013-08-07 02:21:46 +04:00
2021-03-10 20:13:41 +03:00
We are rebuilding bridges you have willfully destroyed.
2013-08-08 00:33:21 +04:00
2018-09-16 19:20:35 +03:00
Get your shit together: Put RSS/Atom back in.