Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-05-24 05:18:05

cjoh
New Member
Registered: 2004-05-23
Posts: 5

RSS Parser/Aggregator for Textpattern

I wrote a simple Txp plugin that will take an RSS URL, fetch the RSS feed, cache it, and display the site’s headlines in <li> format.

In order to use it you will need the lastRSS RSS parser, which you can find here:

http://lastrss.webdot.cz/

You can pick up the tarball here for the plugin:

http://clayjohnson.typepad.com//bsd_fetch_headlines.tar.gz

This was a thirty minute job, and I’m new to textpattern, so I suspect that perhaps I have duplicated someone elses efforts, however it was a fun excersize nonetheless. That being said, I’d have preferred to keep the design out of this plugin, and instead, have another attr, which is a textpattern form. How would one go about using textpattern’s forms to apply to content like this?

Any advice, feedback, suggestions, whatever is appreciated.

Last edited by cjoh (2004-05-24 05:35:12)

Offline

#2 2004-05-24 14:52:05

Zaccix
New Member
From: London, UK
Registered: 2004-03-14
Posts: 8

Re: RSS Parser/Aggregator for Textpattern

Cool, I’m gonna use this on my new site. :)

Just had to change something though. On the line that outputs each list item containing <code><a href=$item[link]></code>, I added escaped quote marks to end up with <code><a href=\\”$item[link]\\”></code>, so the page would validate. Also found I needed to add <code><ul></ul></code> tags around the plugin’s txp tag.

Thanks for the plugin! :)

Last edited by Zaccix (2004-05-24 14:52:58)

Offline

#3 2004-05-24 15:11:49

Echo5ive
New Member
From: Stockholm, Sweden
Registered: 2004-03-14
Posts: 7
Website

Re: RSS Parser/Aggregator for Textpattern

Does it use Magpie?

I wrote a quick plugin that grabs an RSS feed using Magpie. Very easy.

edit: oh, it says in your entry what it uses. I’ll have a look at LastRSS.

Last edited by Echo5ive (2004-05-24 15:12:47)


VC200 member!

Offline

#4 2004-05-24 15:17:04

cjoh
New Member
Registered: 2004-05-23
Posts: 5

Re: RSS Parser/Aggregator for Textpattern

I used LastRSS because of Rss2.0 compatibility. Magpie was not compatible with RSS2, last I checked.

Offline

#5 2004-05-24 21:31:01

Macubu
Member
From: Milano, Italia
Registered: 2004-04-13
Posts: 58
Website

Re: RSS Parser/Aggregator for Textpattern

<strike>Ehm… how exactly do you use it on a Txp page? Is there a special tag for this plugin? Sorry if this is a dumb question…</strike>
Do I not have a pair of eyes? Of course there was a readme file… Sorry guys.

Last edited by Macubu (2004-05-24 21:41:22)

Offline

#6 2004-05-24 22:30:46

Macubu
Member
From: Milano, Italia
Registered: 2004-04-13
Posts: 58
Website

Re: RSS Parser/Aggregator for Textpattern

Well, I tried, and to me it only shows this:

Warning: bsd_fetch_headlines(/textpattern/lastRSS.php): failed to open stream: No such file or directory in /tmp/pluginszI61N6 on line 78

Warning: bsd_fetch_headlines(): Failed opening ‘/textpattern/lastRSS.php’ for inclusion (include_path=’.:/usr/local/lib/php’) in /tmp/pluginszI61N6 on line 78

Fatal error: Cannot instantiate non-existent class: lastrss in /tmp/pluginszI61N6 on line 79

I’m asking myself: can it be an error on my behalf writing the correct path to the file and folder of the RSS parser? But I don’t even know where this tmp folder is, or what it is…

Offline

#7 2004-05-24 22:44:05

cjoh
New Member
Registered: 2004-05-23
Posts: 5

Re: RSS Parser/Aggregator for Textpattern

don’t be concerned with /tmp/pluginsz… That’s textpattern— it takes the plugins and writes them to a file and includes them at runtime. Not the most scalable way to do things, but not a bad decision.

Did you download the lastRSS parser and did you set the lastRSS argument in the txp:bsd_fetch_headlines tag?

That’s what seems to be missing.

—Clay

Offline

#8 2004-06-04 01:30:25

tmacwrig
Archived Plugin Author
Registered: 2004-03-06
Posts: 204
Website

Re: RSS Parser/Aggregator for Textpattern

magpie is now compatible with rss 2.0

Offline

#9 2004-06-04 17:18:14

jbrew
Member
From: Imperial Beach, California
Registered: 2004-03-04
Posts: 78
Website

Re: RSS Parser/Aggregator for Textpattern

Warning: bsd_fetch_headlines(): stream does not support seeking in /tmp/pluginsUP6CUe on line 577

Fatal error: Cannot instantiate non-existent class: lastrss in /tmp/pluginsUP6CUe on line 578

Um, not sure why this is happening, but any help would be much appreciated.


To even the least of these…

Offline

#10 2004-06-04 18:51:04

asarbogast
Member
From: Arcata, CA
Registered: 2004-05-21
Posts: 33
Website

Re: RSS Parser/Aggregator for Textpattern

Thanks for this— it’s just what I’ve been looking for.

Is there any way to limit the number of characters of $item[title] that display, so that long titles can be truncated, with “…” at the end so readers know that the title continues?

Thanks for the plugin! :)

Andrea

Offline

#11 2004-06-04 18:59:00

jbrew
Member
From: Imperial Beach, California
Registered: 2004-03-04
Posts: 78
Website

Re: RSS Parser/Aggregator for Textpattern

Nevermind – I needed more explicit pathing to get to the lastrss.php file.

Thanks for this plugin.


To even the least of these…

Offline

#12 2004-06-04 20:08:08

schussat
Plugin Author
Registered: 2004-02-24
Posts: 101
Website

Re: RSS Parser/Aggregator for Textpattern

Asarbogast-

This is a bit of php code that I use to do just what you’re looking for. I’m not using this particular plugin, but the code should still work with just a small bit of tweaking.

/* How to make a nice trim of text without breaking words in the middle :*/

$maxTextLenght=20;
$aspace=" ";
if(strlen($title) > $maxTextLenght ) {
$title = substr(trim($title),0,$maxTextLenght);
$title = substr($title,0,strlen($title)-strpos(strrev($title),$aspace));
$title = $title.'...';
}

(Yeah, I know I misspelled “length”… I never quite got around to fixing that. Odd how, rather than fix it, I just kept spelling it incorrectly.) I hope this does the trick for you.

Last edited by schussat (2004-06-04 20:11:09)


-Alan

Offline

Board footer

Powered by FluxBB