| 1 |
FeedWordPress |
| 2 |
============= |
| 3 |
|
| 4 |
* Author: [Charles Johnson](http://www.radgeek.com/contact) |
| 5 |
* Version: 0.8 |
| 6 |
* Project URI: <http://projects.radgeek.com/feedwordpress> |
| 7 |
* License: GPL. See License below for copyright jots and tittles. |
| 8 |
|
| 9 |
Introduction |
| 10 |
------------ |
| 11 |
FeedWordPress is an Atom/RSS aggregator for WordPress. It syndicates content |
| 12 |
from newsfeeds that you select; if you syndicate several newsfeeds then you can |
| 13 |
WordPress's posts database and templating engine as the back-end of an |
| 14 |
aggregation ("planet") website. |
| 15 |
|
| 16 |
FeedWordPress is similar in conception to software such as [Planet][]--in fact, |
| 17 |
I started developing it because I needed a more flexible replacement for |
| 18 |
Planet at to run [Feminist Blogs](http://www.feministblogs.org/). Since it |
| 19 |
works on top of WordPress's database and templating system, however, it boasts |
| 20 |
far more flexibility than many other aggregators. It is also designed with ease |
| 21 |
of configuration and use in mind. |
| 22 |
|
| 23 |
You'll need a working installation of [WordPress 1.5][] and FTP or SFTP access |
| 24 |
to your web host. The ability to create cron jobs on your web host would be very |
| 25 |
helpful but it's not absolutely necessary. You *don't* need to tweak any |
| 26 |
plain-text configuration files and you *don't* need shell access to your web |
| 27 |
host to make it work. (Although, I should point out, web hosts that *don't* |
| 28 |
offer shell access are *bad web hosts*.) |
| 29 |
|
| 30 |
[WordPress 1.5]: http://wordpress.org/development/2005/02/strayhorn/ |
| 31 |
[Planet]: http://www.planetplanet.org/ "Planet Planet" |
| 32 |
|
| 33 |
Installation & Requirements |
| 34 |
--------------------------- |
| 35 |
You'll need a website with WordPress 1.5 installed and configured and FTP or |
| 36 |
SFTP access to your web space. You'll probably also want to have either (1) |
| 37 |
the ability to create cron jobs on your web host, or (2) a computer of your |
| 38 |
own that has always-on Internet access. |
| 39 |
|
| 40 |
1. Install `feedwordpress.php` in your WordPress `plugins` directory and |
| 41 |
`update.php` in your WordPress `wp-content` directory. |
| 42 |
|
| 43 |
2. (Optional) Upgrade the copy of MagpieRSS packaged with WordPress by |
| 44 |
installing the new `rss-functions.php` (archived in |
| 45 |
`OPTIONAL/wp-includes`) into your WordPress `wp-includes` directory. |
| 46 |
|
| 47 |
3. Log in to the WordPress Dashboard and activate the FeedWordPress plugin. |
| 48 |
Go to Options --> Syndication to set up initial settings for the |
| 49 |
syndication link category ("Contributors") by default and the RPC secret |
| 50 |
word (blank by default, but you should probably set it to something.) |
| 51 |
|
| 52 |
4. Set up links for syndication from the WordPress Dashboard using |
| 53 |
Links --> Syndicated or Links --> Import. |
| 54 |
|
| 55 |
5. FeedWordPress is now *ready* to feed syndicated content into WordPress. |
| 56 |
In order for it to actually receive that content, either (1) have your |
| 57 |
contributors add WordPress's XML-RPC URI to their blog's list of URIs |
| 58 |
to ping when they update posts, (2) set up a cron job to check in on all |
| 59 |
the feeds on a regular basis, or (3) both. If you do (2), you can either |
| 60 |
set up a job to run `php update-feeds.php` on your web host, or set one |
| 61 |
up on any computer with always-on Internet access to request |
| 62 |
`update-feeds.php` over the web. |
| 63 |
|
| 64 |
If your copy of WordPress is installed at <http://www.zyx.com/blog>, and |
| 65 |
you set the secret word for XML-RPC pings to "foo", then your XML-RPC |
| 66 |
URI will be <http://www.zyx.com/blog/xmlrpc.php>, and the URI to request |
| 67 |
for `update-feeds.php` to update all feeds will be |
| 68 |
<http://www.zyx.com/blog/wp-content/update-feeds.php?shibboleth=foo> |
| 69 |
|
| 70 |
For detailed installation instructions, point your web browser to |
| 71 |
<http://projects.radgeek.com/feedwordpress/install>. |
| 72 |
|
| 73 |
Feed Settings |
| 74 |
------------- |
| 75 |
### Feed Settings ### |
| 76 |
|
| 77 |
Once you have your links configured and regular feed updates scheduled, you can |
| 78 |
mostly leave FeedWordPress to run on its own. If you need to add, remove, or |
| 79 |
change information for any contributors, you can do so from the WordPress |
| 80 |
Dashboard under Links --> Syndicated. If you want to distribute the labor of |
| 81 |
adding, updating, and managing feeds, you can use the WordPress login and access |
| 82 |
privileges system. Users with an access level of 5 or greater can add or modify |
| 83 |
syndicated links, and change syndication options. |
| 84 |
|
| 85 |
All the information for a syndicated feed is managed through the WordPress Links |
| 86 |
database. Feeds in the category to be syndicated (by default, "Contributors") |
| 87 |
use several fields of the standard WordPress Link record: |
| 88 |
|
| 89 |
- The Link URI is used to store a URI to the front page (*not* the feed!) |
| 90 |
of the syndicated website. |
| 91 |
|
| 92 |
- The Link Name is used to store the title of the syndicated website. |
| 93 |
|
| 94 |
- The Short Description is used to store the tagline of the syndicated |
| 95 |
website. |
| 96 |
|
| 97 |
- The RSS URI is used to store the URI for the feed to be syndicated. |
| 98 |
|
| 99 |
- The Link Notes are used to store a collection of manually-encoded and |
| 100 |
automatically-generated settings that apply to this feed. The format of |
| 101 |
settings in Link Notes is: |
| 102 |
|
| 103 |
key1: value1 |
| 104 |
key2: value2 |
| 105 |
key3: value3 |
| 106 |
feed/key1: value1 |
| 107 |
feed/key2: value2 |
| 108 |
|
| 109 |
And so on. Values that are prefixed by 'feed/' are automatically |
| 110 |
generated from feed data every time the feed syndicated by this link is |
| 111 |
checked for updates. Values without the prefix are set manually by the |
| 112 |
user. |
| 113 |
|
| 114 |
Most settings in the Link Notes have no effect on FeedWordPress, but can be |
| 115 |
accessed from templates using the ``get_feed_meta()`` template function in a |
| 116 |
post context. For example, many aggregator sites use a "face" image for each |
| 117 |
feed to visually distinguish posts from different feeds. To implement a face |
| 118 |
feature, you could add a line like this to each feed's Link Notes section: |
| 119 |
|
| 120 |
face: http://www.zyx.com/mugs/ugly |
| 121 |
|
| 122 |
The URI should be changed out for each feed to point to the appropriate image, |
| 123 |
of course. Then, to use the setting from within a template: |
| 124 |
|
| 125 |
// In a post context |
| 126 |
<?php $img = get_feed_meta('face'); if strlen($img) > 0): ?> |
| 127 |
<img src="<?=$img?>" alt="" /> |
| 128 |
<?php endif; ?> |
| 129 |
|
| 130 |
... which will display the image, if any, whose URI is set in the "face" setting |
| 131 |
for the feed that post comes from. If there is no "face" setting for a |
| 132 |
particular feed, ``get_feed_meta()`` will return an empty string and no image |
| 133 |
will be displayed. |
| 134 |
|
| 135 |
Not all feed settings are only for templates. Some affect how FeedWordPress |
| 136 |
processes posts from that feed. Currently, the special settings are: |
| 137 |
|
| 138 |
- `cats:` a colon-separated list of default categories for any post coming |
| 139 |
from this feed. So, for example, a this line in its Notes section: |
| 140 |
|
| 141 |
cats: computers:web |
| 142 |
|
| 143 |
... will make FeedWordPress place any posts syndicated from that feed in |
| 144 |
the "computers" and "web" categories (*in addition to*, not *instead of* |
| 145 |
any categories that are applied to the post in the feed) |
| 146 |
|
| 147 |
- `hardcode name: (yes|no)` |
| 148 |
|
| 149 |
A yes/no setting. By default, FeedWordPress updates the value of the |
| 150 |
Link Name field automatically to reflect the title that is reported by a |
| 151 |
syndicated feed. (So, for example, if one of your contributors changes |
| 152 |
the title of her weblog, the change will be reflected on your |
| 153 |
Contributors list after the next update.) To override that behavior for |
| 154 |
a particular feed (e.g. to force WordPress to use an abbreviated form of |
| 155 |
the site's title for reasons of space), add a line like this to the Link |
| 156 |
Notes section: |
| 157 |
|
| 158 |
hardcode name: yes |
| 159 |
|
| 160 |
If `hardcode name` is absent, or set to a value other than `yes`, |
| 161 |
FeedWordPress will take that as a 'no' and follow the default behavior. |
| 162 |
|
| 163 |
- `post status:` sets the default post status for posts from this feed |
| 164 |
This can be 'publish', 'draft', or 'private'. By default, it is set to |
| 165 |
'publish' (syndicated posts go online immediately). |
| 166 |
|
| 167 |
- `comment status:` sets the default status for comments on posts |
| 168 |
syndicated from this feed. By default, all comments on syndicated posts |
| 169 |
are closed, but you can set it to 'open', 'closed', or 'registered_only' |
| 170 |
for particular feeds. |
| 171 |
|
| 172 |
- `ping status:` sets the default status for receiving TrackBack and |
| 173 |
PingBack pings on posts syndicated from this feed. By default, |
| 174 |
syndicated posts are closed to pings, but you can set this to 'open' or |
| 175 |
'closed' for particular feeds. |
| 176 |
|
| 177 |
Template API |
| 178 |
------------ |
| 179 |
When activated, FeedWordPress makes the following functions available for use by |
| 180 |
themes/templates: |
| 181 |
|
| 182 |
* ``is_syndicated()``: in a post context, returns ``TRUE`` if the post was |
| 183 |
syndicated from another website, or ``FALSE`` if it was originally |
| 184 |
posted here |
| 185 |
|
| 186 |
* ``get_syndication_permalink()``: in a post context, returns the URI of |
| 187 |
the permalink for this post *on the website it was syndicated from* |
| 188 |
|
| 189 |
* ``the_syndication_permalink()``: in a post context, outputs the value |
| 190 |
returned by ``get_syndication_permalink()`` |
| 191 |
|
| 192 |
* ``get_syndication_source_link()``: in a post context, returns the URI of |
| 193 |
the front page (*not* the feed) of the website this post was syndicated |
| 194 |
from |
| 195 |
|
| 196 |
* ``the_syndication_source_link()``: in a post context, outputs the URI |
| 197 |
returned by ``get_syndication_source_link()`` |
| 198 |
|
| 199 |
* ``get_syndication_source()``: in a post context, returns the |
| 200 |
human-readable title of the website that a syndicated post was |
| 201 |
syndicated from |
| 202 |
|
| 203 |
* ``the_syndication_source()``: in a post context, outputs the value |
| 204 |
returned by ``get_syndication_source()`` |
| 205 |
|
| 206 |
* ``get_syndication_feed():`` in a post context, returns the URI of the |
| 207 |
feed (*not* the front page) that this post was syndicated from |
| 208 |
|
| 209 |
* ``the_syndication_feed()``: in a post context, outputs the value |
| 210 |
returned by ``get_syndication_feed()`` |
| 211 |
|
| 212 |
* ``get_feed_meta($key)``: in a post context, returns the value, if any, |
| 213 |
of the feed setting ``$key`` for the feed that this post was syndicated |
| 214 |
from |
| 215 |
|
| 216 |
By default, FeedWordPress also places a filter on the standard functions |
| 217 |
``get_permalink()`` and ``the_permalink()`` that substitutes the URI returned by |
| 218 |
``get_syndication_permalink()`` for the URI generated by WordPress. This means |
| 219 |
that by default the permalinks listed on your website and in your newsfeed will |
| 220 |
link to the location of the posts on the source website, *not* to their location |
| 221 |
on your website. You can switch this behavior on or off at Options --> |
| 222 |
Syndication in the WordPress Dashboard. |
| 223 |
|
| 224 |
License |
| 225 |
------- |
| 226 |
The FeedWordPress plugin is copyright (c) 2005 by Charles Johnson. It uses code |
| 227 |
derived or translated from: |
| 228 |
|
| 229 |
- [wp-rss-aggregate.php][] by [Kellan Elliot-McCrea](kellan@protest.net) |
| 230 |
- [HTTP Navigator 2][] by [Keyvan Minoukadeh](keyvan@k1m.com) |
| 231 |
- [Ultra-Liberal Feed Finder][] by [Mark Pilgrim](mark@diveintomark.org) |
| 232 |
|
| 233 |
according to the terms of the [GNU General Public License][]. |
| 234 |
|
| 235 |
This program is free software; you can redistribute it and/or modify it under |
| 236 |
the terms of the [GNU General Public License][] as published by the Free Software |
| 237 |
Foundation; either version 2 of the License, or (at your option) any later |
| 238 |
version. |
| 239 |
|
| 240 |
This program is distributed in the hope that it will be useful, but WITHOUT ANY |
| 241 |
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 242 |
PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| 243 |
|
| 244 |
[wp-rss-aggregate.php]: http://laughingmeme.org/archives/002203.html |
| 245 |
[HTTP Navigator 2]: http://www.keyvan.net/2004/11/16/http-navigator/ |
| 246 |
[Ultra-Liberal Feed Finder]: http://diveintomark.org/projects/feed_finder/ |
| 247 |
[GNU General Public License]: http://www.gnu.org/copyleft/gpl.html |
| 248 |
|
| 249 |
|