# Adding fixed content to feeds

**URL:** <https://www.ruby-forum.com/t/adding-fixed-content-to-feeds/94448>\
**Category:** Typo\
**Created:** [May 3, 2006, 7:11pm UTC](https://www.ruby-forum.com/t/adding-fixed-content-to-feeds/94448 "2006-05-03T19:11:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gary\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea5d25/32.png) [@Gary\_S](https://www.ruby-forum.com/u/Gary_S)\
**Post date:** [May 3, 2006, 7:11pm UTC](https://www.ruby-forum.com/t/adding-fixed-content-to-feeds/94448/1 "2006-05-03T19:11:06Z")

</div>

How easy would it be to add fixed text to the end of each post in the  
feed? I don’t mean in the actual post itself, but automagically  
inserted on publish - only in the feed.

This could eventually lead to include advertising in feeds without  
the need to go through feedburner, but for right now it’s a good way  
to add a disclaimer/license to posts.

Scrapers are really annoying me right now.

Gary

---

<div class="post-metadata">

**Author:** ![Gary\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea5d25/32.png) [@Gary\_S](https://www.ruby-forum.com/u/Gary_S)\
**Post date:** [August 3, 2006, 2:22pm UTC](https://www.ruby-forum.com/t/adding-fixed-content-to-feeds/94448/2 "2006-08-03T14:22:07Z")

</div>

Gary S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> How easy would it be to add fixed text to the end of each post in the  
> feed? I don’t mean in the actual post itself, but automagically  
> inserted on publish - only in the feed.

Shouldn’t be too hard (but you’re going to be repeating yourself a  
fair bit if you do it for all possible feed types), just add some  
static content to your app/views/xml/\_\<feed\_type\>\_item\_article.rxml  
templates (I think you should be able to do that in your theme  
directory but I haven’t tried it).

Making it configurable would be rather more work, which I think I want  
to put off until Sam Ruby’s finished his sterling work on getting our  
feeds to be compliant.

---

<div class="post-metadata">

**Author:** ![Gary\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea5d25/32.png) [@Gary\_S](https://www.ruby-forum.com/u/Gary_S)\
**Post date:** [August 3, 2006, 2:22pm UTC](https://www.ruby-forum.com/t/adding-fixed-content-to-feeds/94448/3 "2006-08-03T14:22:57Z")

</div>

On 1 May 2006, at 11:00, Piers C. wrote:

> directory but I haven’t tried it).  
> Dear me you think it would be easy, but it isn’t. I can kill the  
> feed compliance by putting a made up tag in (I can live with that for  
> now). Something along the lines of after each item using

xm.rights “This is the rights to this”

Which of course shows up in the feed source, but not in the actual  
feeds when in a feedreader.

Does anybody actually have more than a clue with this and know what  
tags will be displayed in RSS2.0 and Atom? Or have I missed the  
point and it’s actually a lot easier to put it in some other form?

I really don’t want to have to crawl through specs…

Cheers

Gary

---

<div class="post-metadata">

**Author:** ![Gary\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea5d25/32.png) [@Gary\_S](https://www.ruby-forum.com/u/Gary_S)\
**Post date:** [August 3, 2006, 2:22pm UTC](https://www.ruby-forum.com/t/adding-fixed-content-to-feeds/94448/4 "2006-08-03T14:22:58Z")

</div>

On Wednesday 03 May 2006 08:05, Trejkaz wrote:

> Hmm… there is a Dublin Core metadata tag called exactly that. I don’t  
> know what this ‘xm’ object does with regards to namespaces, but a  
> dc:rights tag with the correct namespace for Dublin Core would be valid,  
> and correct.

(Whoops, oh yeah, except for some reason the Atom group eventually chose  
not  
to reuse Dublin Core even though almost all their element names are  
identical. So over there it’s just with the Atom namespace.)

TX

---

<div class="post-metadata">

**Author:** ![Gary\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea5d25/32.png) [@Gary\_S](https://www.ruby-forum.com/u/Gary_S)\
**Post date:** [August 3, 2006, 2:22pm UTC](https://www.ruby-forum.com/t/adding-fixed-content-to-feeds/94448/5 "2006-08-03T14:22:58Z")

</div>

Gary S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> > static content to your app/views/xml/\_\<feed\_type\>\_item\_article.rxml  
> > templates (I think you should be able to do that in your theme  
> > directory but I haven’t tried it).
> 
> Dear me you think it would be easy, but it isn’t. I can kill the  
> feed compliance by putting a made up tag in (I can live with that  
> for now). Something along the lines of after each item  
> using

Have you tried doing:

xm.content(“type” =\> “text/html”) do  
item.full\_html if this\_blog.show\_extended\_on\_rss  
p(‘This content gets added to the end of every article’)  
end

Which seems like it should work to me.

---

<div class="post-metadata">

**Author:** ![Gary\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea5d25/32.png) [@Gary\_S](https://www.ruby-forum.com/u/Gary_S)\
**Post date:** [August 3, 2006, 2:22pm UTC](https://www.ruby-forum.com/t/adding-fixed-content-to-feeds/94448/6 "2006-08-03T14:22:58Z")

</div>

On Tuesday 02 May 2006 22:21, Gary S. wrote:

> Dear me you think it would be easy, but it isn’t. I can kill the  
> feed compliance by putting a made up tag in (I can live with that for  
> now). Something along the lines of after each item using
> 
> xm.rights “This is the rights to this”

Hmm… there is a Dublin Core metadata tag called exactly that. I don’t  
know  
what this ‘xm’ object does with regards to namespaces, but a dc:rights  
tag  
with the correct namespace for Dublin Core would be valid, and correct.

> Which of course shows up in the feed source, but not in the actual  
> feeds when in a feedreader.

That’s another issue too. I’m betting that even with the metadata tag  
in  
there, feed readers don’t necessarily bother rendering it. Either that,  
or  
I’ve simply never seen anyone use the tag.

TX

---

<div class="post-metadata">

**Author:** ![Gary\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ea5d25/32.png) [@Gary\_S](https://www.ruby-forum.com/u/Gary_S)\
**Post date:** [August 3, 2006, 2:22pm UTC](https://www.ruby-forum.com/t/adding-fixed-content-to-feeds/94448/7 "2006-08-03T14:22:58Z")

</div>

On 3 May 2006, at 08:15, Piers C. wrote:

> xm.content(“type” =\> “text/html”) do  
> item.full\_html if this\_blog.show\_extended\_on\_rss  
> p(‘This content gets added to the end of every article’)  
> end
> 
> Which seems like it should work to me.

No I haven’t. Feedvalidator doesn’t like ‘text/html’ so I was trying  
to avoid it. Might be good for a quick fix, I’ll give that a go when  
I get some stability.

Gary
