Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 07:10 am EST

Geeklog Forums

Links in RSS Feeds


Status: offline

merlik

Forum User
Newbie
Registered: 05/30/05
Posts: 9
Location:Hawaii
Does anyone know how when I create a story that is html formatted with links, how I can get those links to show up in the RSS feed as well. I put a link into the actual story and it shows up as a link on the home page but when I view the story with something like bloglines the link just appears as text. Thanks for your help and I am sorry if this was already posted. I did a search but couldn't find it.
~Chewing on the fingers of life.~
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
That depends on the feed format. Not sure if RSS even supports HTML in feeds. It may work in Atom ...

bye, Dirk
 Quote

Status: offline

merlik

Forum User
Newbie
Registered: 05/30/05
Posts: 9
Location:Hawaii
I have tried it in Atom and RSS2 and neither showed up as a link.
~Chewing on the fingers of life.~
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Yeah, looks like the Atom feed writer strips out HTML.

bye, Dirk
 Quote

Status: offline

merlik

Forum User
Newbie
Registered: 05/30/05
Posts: 9
Location:Hawaii
I guess I can hope for it not to when Geeklog2 comes out or is there anything I can do?
~Chewing on the fingers of life.~
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
All that's required is a feed writer class that doesn't strip the HTML. Feel free to provide one ...

Geeklog 1.3.12 will have a new subsystem for feeds, but I don't know if it strips HTML or not.

bye, Dirk
 Quote

Status: offline

merlik

Forum User
Newbie
Registered: 05/30/05
Posts: 9
Location:Hawaii
How hard would it be to make a plugin for geeklog that creates it's own feed with basically the same options that are avaialble now but adding more functionality like maybe letting you choose whether it strips the links or not or to automatically add an enclosure to it if the link is to an mp3 for a podcasting solution.
~Chewing on the fingers of life.~
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Technically, it's not a plugin but only a new feed writer class. Those are rather small and it shouldn't be hard to write one that does what you want.

In fact, I wrote an Atom feed writer class some time ago that did export stories in whatever mode they were posted (HTML or plain text). But that was against an older (now obsolete) Atom specification.

bye, Dirk
 Quote

Status: offline

merlik

Forum User
Newbie
Registered: 05/30/05
Posts: 9
Location:Hawaii
Ok, I will just have to see about taking this into my own hands. Is there a good resource anywhere to learn how to write plugins for geeklog and such? This would be completely new to me but I can be a quick learner at times lol, and I would love to help out the geeklog community because it is my favorite CMS. I messed with Mambo, Drupal and one other I can't remember before deciding on geeklog.
~Chewing on the fingers of life.~
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Again, this is not a plugin - only a feed writer class.

Have a look at the existing classes (including the ones you already downloaded) and at system/lib-syndication.php, which is the code that calls these classes.

As I said, I'm not sure if RSS supports HTML in feeds at all (or when it does, which version of RSS would support it), so you'd have to do some research on this. I know that Atom allows this, so you could start over at www.atomenabled.org if you want to go the Atom route.

Happy hacking.

bye, Dirk
 Quote

Status: offline

merlik

Forum User
Newbie
Registered: 05/30/05
Posts: 9
Location:Hawaii
Thanks much, time to get to work, though I am stuck out at sea right now and prolly won't get much done until I get back to port.
~Chewing on the fingers of life.~
 Quote

Status: offline

merlik

Forum User
Newbie
Registered: 05/30/05
Posts: 9
Location:Hawaii
w00t! It was actually easier than I thought. All I really did was edit 1 line in the atom.feed.class.php.
I had to change
Text Formatted Code
$storytext = trim (strip_tags ($text));
 

to

Text Formatted Code
$storytext = trim ($text);
 

I have heard that that leaves some kind of security vulnerability but I am not sure how, sorry for my lack of PHP knowledge.
~Chewing on the fingers of life.~
 Quote

Status: offline

THEMike

Forum User
Moderator
Registered: 07/25/03
Posts: 141
Location:Sheffield, UK
You should be safe with that, as geeklog has fully filtered the content that comes IN to the system to make sure the HTML in your stories is fine. However, people aggregating any feed with HTML need to be careful to ensure any HTML in the inbound feed isn't full of exploitative HTML.

I think that the 1.3.12 stuff also does a full strip of the html. RSS 2.0 supports an "encoded" directive to allow HTML. But I think I stuck with stripping the HTML. Perhaps it shouldn't strip links, and perhaps it should turn img's into links. (I hate when feeds I watch put images in...)
 Quote

Status: offline

merlik

Forum User
Newbie
Registered: 05/30/05
Posts: 9
Location:Hawaii
Ok, thanks much for the info. I use bloglines to aggregate my feeds so I never really worry to much about it, but if it changes again in 1.3.12, I can always edit it again seeing as it wasn't that hard. I am also going to try to learn more about the new Atom 1.0 when it comes out and see about making a class for it.
~Chewing on the fingers of life.~
 Quote

All times are EST. The time is now 07:10 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content