Feed Reader Centralv1-beta4

Feeds

Adding a Feed

On the top menu bar, click the Feeds link, then click the Add Feed button. In the field that is displayed, enter the URL for the feed. Then click the Save button; if all goes well, the application will subscribe to the feed and pull in all its current items.

If you do not have the feed’s direct link, you can enter the URL for the site that hosts the feed. In most cases, the application should be able to find it and subscribe to it.

Editing a Feed’s URL

If the feed to which you are subscribed has moved, you can edit the URL of the feed. In this case, the application will confirm that the new feed exists and will synchronize with its items. Depending on how the feed was moved, this may result in items reappearing as new; however, bookmarked items will not be removed, and older items will not be removed until they would otherwise have been pruned.

Deleting a Feed

On the Feeds page, below each feed’s title, there is a Delete link at the end of the line. Once that is clicked, you will be prompted to confirm that you really mean to delete this feed; if you confirm the deletion, the feed and all its items (including bookmarked items) will be deleted.

Refreshing Feeds

Feeds are pulled when their subscriptions are added; however, a one-time pull of feeds does not keep us up to date on future posts. From within the application, feeds can be updated manually; there is also a way to set up a job to regularly refresh feeds.

Manual Refresh

Next to the “Your Unread Items” heading on the main page, there is a link labeled Refresh All Feeds. Clicking this link will reload the main page once the feeds have been refreshed. Depending on the number and size of feeds, this may take a bit of time; each feed is refreshed individually.

Automatic Refresh Job (Linux / Mac)

The refresh utility script will perform this refresh from the CLI. As it runs, it will list the feeds as it processes them, and if it encounters any errors, that is noted as well. This process can be automated via cron on Linux or Mac systems. This is most easily implemented by writing a small shell script to provide some environment settings, then telling cron to run that script.

#!/bin/bash
exec 1> >(logger -t feed-reader-central) 2>&1
cd /path/to/frc
php-cli util/refresh.php all

Save this (frc-refresh.sh might be a good name) and be sure it is executable (chmod +x ./frc-refresh.sh). Before we put it in crontab, though, let’s understand what each line does:

Finally, we are ready to add this to our crontab. Enter crontab -e to edit the file, then add a row at the bottom that looks like this:

0 */6 * * *  /path/to/job/frc-refresh.sh

The items before the path specify when it should run. This example will run at the top of the hour every six hours. Crontab schedules can be tricky to create; a full treatment is outside the scope of this documentation. However, this site lets you put values in each position and it translates that to words; this lets you see if what you put is what you meant.

This should not require many resources; the majority of its time will be spent waiting for the websites to return their feeds so it can process them. However, if you want it to yield to everything else happening on the server, add nice -n 1 (with a trailing space) before the path to the script.