A tool to create RSS feeds of pages in MediaWiki categories.
php-curl
- Clone from GitHub to a web-accessible location:
git clone https://github.com/samwilson/mediawiki-feeds.git
- Install dependencies:
composer install --no-dev
- Create the
var
directory, and make it writeable by the web server and CLI users - [Optional] Modify the
$defaults
array inconfig.php
If installing on Wikimedia Toolforge,
set the $cdn
variable in config.php
to 'toolforge'
.
Browse to mediawiki-feeds/index.html
and fill in the form.
Pages in the category and all subcategories will be items in the feed.
You can prevent the feed from being cached by passing the nocache
URL parameter (with any or no value).
Note that there is a public deployment of this tool on WMFlabs: https://tools.wmflabs.org/mediawiki-feeds/
The first <time>
element found on the page will be used for the publication date.
The contents of an element with a itemprop="description"
attribute will be used for the description,
or else just the first 400 characters of the page.
If you want to produce feeds of categories that have a large number of members,
the web-request may time out. In this case, use cli.php
to populate the cache
(e.g. from a cron job):
php cli.php --category=Category:Blog_posts --url=https://en.wikiversity.org/w/ --numItems=10 --title="Other title" --verbose
The CLI always rebuilds the cache (because that's what it's for; it's up to you to not call it too often).
To find out the name of the cache file (e.g. to serve the RSS file directly), pass the verbose
flag.
- Update from GitHub:
git pull origin master
- Update dependencies:
composer install
Please report any issues via GitHub https://github.com/samwilson/mediawiki-feeds/issues or by contacting User:Samwilson.