Forum: Typo Adding fixed content to feeds

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Gary S. (Guest)
on 2006-05-03 21:11
(Received via mailing list)
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
Piers C. (Guest)
on 2006-08-03 16:22
(Received via mailing list)
Gary S. <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.
Gary S. (Guest)
on 2006-08-03 16:22
(Received via mailing list)
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 <rights> 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
Trejkaz (Guest)
on 2006-08-03 16:22
(Received via mailing list)
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 <rights> 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
Trejkaz (Guest)
on 2006-08-03 16:22
(Received via mailing list)
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 <rights> with the Atom namespace.)

TX
Piers C. (Guest)
on 2006-08-03 16:22
(Received via mailing list)
Gary S. <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 <rights> 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.
Gary S. (Guest)
on 2006-08-03 16:22
(Received via mailing list)
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
This topic is locked and can not be replied to.