Login to download the latest version of Mint and your favorite Pepper, purchase additional licenses, or post in the Forum. Don't have an account? Create one!

In Partnership with Media Temple

Mint Forum

Using Bird Feeder with Textpattern

ramanan
Minted
Posted on Jan 30, '07 at 07:17 pm

Install the Bird Feeder plugin, and save the feeder directory in the root directory of your web host, as per the plugin’s instructions. From then on, you can just follow what is written here.

You need to modify two files in order for Textpattern to work with Mint 2.0’s Bird Feeder. I know that sucks, but what can you do?

The first file we’ll update is rss.php, in the publish directory. We need to add the following code to the top of the rss function, line 18:

global $Mint;                           
define('BIRDFEED', 'Default (RSS)');
include($_SERVER['DOCUMENT_ROOT'].'/feeder/index.php');

We then need to replace the two code snippets that output the link tag. On line 94, replace:

tag($permlink,'link').n.

with:

tag($BirdFeeder->seed($Title, $permlink, true),'link').n.

And on line 123, replace:

tag(doSpecial($url),'link').n.

with:

tag($BirdFeeder->seed($linkname, $url, true),'link').n.

Hopefully that will get your RSS feed working with Bird Feeder.

Now, for the ATOM feed, we’ll need to update atom.php in the publish directory. As before, place the following at the top of the atom function, line 18:

global $Mint;                           
define('BIRDFEED', 'Feed (ATOM)');
include($_SERVER['DOCUMENT_ROOT'].'/feeder/index.php');

On line 114, replace:

$e['link'] = '<link'.r_relalt.t_texthtml.' href="'.$permlink.'" />';

with:

$e['link'] = '<link'.r_relalt.t_texthtml.' href="'.$BirdFeeder->seed($Title, $permlink, true).'" />';

And on line 160, replace:

$e['link'] = '<link'.r_relalt.t_texthtml.' href="'.$permlink.'" />';

with:

$e['link'] = '<link'.r_relalt.t_texthtml.' href="'.$BirdFeeder->seed($linkname, $url, true).'" />';

Once this is done you’re good to go. I am looking into making this work via a plugin, but for now this works fine.

Sam Brown
Third-Party Pepper Developer
Posted on Jan 31, '07 at 05:43 am

Brilliant! Thanks Ramanan.

sven
Minted
Posted on Jan 31, '07 at 06:00 am

yup, very nice! thank you. it’s working fine. i already filed a plugin request in the textpattern forums: http://forum.textpattern.com/viewtopic.php?id=20889

ramanan
Minted
Posted on Jan 31, '07 at 11:22 am

No problem. Keep me posted if there is an issue. I’ve posted the instructions on my Blog as well, though raising concerns here is probably ideal. As I said I’m looking into making this a plugin, as I have been trying to minimize mucking around with Textpattern source as much as I can.

garethw
Minted
Posted on Jan 31, '07 at 12:23 pm

Hi - thanks for this. I’ve followed the instructions here but it’s not working on my site. Does it matter if my Textpattern installation isn’t in the root of my site?

ramanan
Minted
Posted on Jan 31, '07 at 12:34 pm

It shouldn’t, no. Did you install the pepper and install feeder in the root folder of your webspace?

Thanks for posting Rama!

garethw
Minted
Posted on Feb 07, '07 at 05:09 am

Thanks for getting back - sorry for the delay here. I’ve installed it as you describe but still no joy. I’m going to come back to it later this week and start again - will let you know how I get on. Cheers, Gareth.

ramanan
Minted
Posted on Feb 07, '07 at 10:09 am

If you post more details about what’s going wrong maybe I can help. (Are you getting error messages, is it just not recording anything, etc.)

Brooks
Minted
Posted on Mar 09, '07 at 11:00 pm

Finally got around to adding Bird Feeder to my Pepper collection and, thanks to Ramanan’s directions, the Feeds portion seems to work as expected. I can see the number of times I tested my RSS feed today.

What doesn’t appear to be working is Seeds. My understanding is that pane should list the articles I opened in my browser via my newsreader? That is, I saw the article listed in NetNewsWire and had NNW bring that page up in Safari. Is that correct?

This is with Mint 2.0.4, Bird Feeder 2.0.3 and Textpattern 4.0.4.

The RSS feed is: http://trumpetlamp.com/rss/?section=article

Is my understanding of how Seeds work incorrect? Or, more likely, what might be wrong with my setup?

B.

ramanan
Minted
Posted on Mar 12, '07 at 11:31 am

Your understanding of what Seeds are supposed to do is correct. Its possible no one has clicked through to your site via your feed yet.

Your feed is empty right now. That’s probably why you aren’t seeing any seed hits right now.

Brooks
Minted
Posted on Mar 12, '07 at 01:42 pm

I have been having nothing but problems with my feeds on TextPattern. One visit my news reader shows the feed having content, the next…nothing. The site has content, updated as of last night, but, today, the feeds are empty.

Even when my feed had content, the Seeds pane remained empty.

I’m in the process of moving to WordPress to see if feeds there work, but I’m running into problems importing my posts from my TextPattern database.

Any thoughts on how to make the Bird Feeder work with the ajw_comments_feed plugin?

In the RSS code, the line

tag($permlink,'link').n.

is in the plugin file, but the line

tag(doSpecial($url),'link').n.

is not. Likewise, in the ATOM code, the line

$e['link'] = '<link'.r_relalt.t_texthtml.' href="'.$permlink.'" />';

only appears once.

By replacing the lines that do appear, and redefining the BIRDFEED constant after the lines:

include txpath.'/publish/rss.php'; and include txpath.'/publish/atom.php';

the feeds stops working (bad), but the numbers in the Feeds pane do appear to increment correctly (good). Mint also does not recognize them as independent from the standard Textpatterns article feeds (bad), so it would appear that redefining the BIRDFEED constant is insufficient.

My PHP hackery skills pretty much end here, so any help would be greatly appreciated.

ramanan
Minted
Posted on Mar 19, '07 at 11:20 am

tag(doSpecial($url),'link').n. is unimportant; it’s used to format Textpattern Links. If you define the BIRDFEED constant with a unique name, and do the rest of the work outlined above, I don’t see why things wouldn’t work. What errors are you getting exactly from your comment feed?

Phineas
Minted
Posted on Apr 26, '07 at 05:10 pm

Can someone tell me if it is necessary that Mint and Textpattern be running from the same database for this to work? I installed them at different times and used different DBs, and I’m getting errors.

I get an error saying “Fatal error: Call to a member function on a non-object in /textpattern/publish/atom.php on line 118”

I have followed the instructions (however my paths vary). Mint is running on a separate database.

atom.php:18 $e[‘link’] = ‘seed($Title, $permlink, true).’” />’;

—and how to define separate IDs for separate feeds? I mean: They are all running of the same .php file with appended parameters. I have four main feeds (for different sections), but all are generated trough the same file.

ramanan
Minted
Posted on May 14, '07 at 02:07 pm

Seed is a member function of the $BirdFeeder object. You need to call it as I have done above, $BirdFeeder->seed(…..).

You might be able to have the DEFINE call use the value of the $s variable (which I think stores the section name) when generating the value of BIRDFEED.

jez
Minted
Posted on Aug 30, '07 at 02:11 pm

Hey all,

Sorry to bring this topic back! Ramanan, your instructions are great so thanks very much for putting them up. But when making the changes to the Atom feed (in TXP 4.0.5) the line:

$e['link'] = '<link'.r_relalt.t_texthtml.' href="'.$permlink.'" />';

..doesn’t seem to exist. I made all of the other changes and saved the file, and I don’t appear to be getting any errors.. is this a problem?

Cheers, Jez.

philipj
Minted
Posted on Oct 22, '07 at 01:20 pm

This doesn’t appear to work for me anymore since updating to 4.0.5, is anyone else having this problem?

philipj
Minted
Posted on Oct 24, '07 at 09:55 am

A bit more info: my atom and rss feeds display zero articles. This is true whether I copy over the 4.0.4 atom.php and rss.php files, or if I modify the new 4.0.5 versions (which do have some differences, but they aren’t significant from what I could tell).

Am I the only one having this problem? :)

I just sitting here with TXP 4.0.6 and had manage to change “rss.php” exactly as it’s told above. But then I come to “atom.php” I realised the problem Jez wrote above - the nonexisting line “$e[‘link’] = ”;” (and this is the same with TXP 4.0.5) instead I found the line “$e[‘link’] = ”;” at line 164 (not 160) and replaced that with the Birdfeed line in the manual above.

Have I done right?

I did the same with TXP 4.0.5 and it seems to work, I think.

ramanan
Minted
Posted on Feb 11, '08 at 04:17 pm

I’ll update my instructions when I get home for 4.0.6. They should be similar.

Brilliant. I’ve just installed Mint w/ Bird Feeder on my TXP 4.0.6 blog and it’s picking up feed clicks. Seeds still aren’t working, though. Any advice on how to get that aspect of the service going?

You must be logged in to reply. Login above or create an account