Page 1 of 1

BBCOde for an RSS feed

Posted: Sun Mar 04, 2012 6:46 am
by haggisv
Is there a BBCode to display an RSS feed inside a post or annoucement?

Yes I have searched, but these words are so common, I could not find one.

Re: BBCOde for an RSS feed

Posted: Mon Mar 05, 2012 12:01 am
by Pony99CA
You'll need to be more specific. Do you actually want the feed displayed (with or without formatting?) or just an RSS icon that links to an RSS feed? If the former, the Custom BBCodes topic had somebody post recently about displaying XML in a post.

Steve

Re: BBCOde for an RSS feed

Posted: Mon Mar 05, 2012 12:32 am
by haggisv
I wish to display an external feed within a post on the forum. I would prefer just to display the list of links, not the header. I plan to use it with somethng like the ACP annoucement MOD to display the latest 'news' (using a news feed from another site).

Re: BBCOde for an RSS feed

Posted: Mon Mar 05, 2012 10:43 pm
by haggisv
Anyone?

Re: BBCOde for an RSS feed

Posted: Tue Mar 06, 2012 10:55 am
by Mick
How are you intending using Announcement Centre in a post?

Re: BBCOde for an RSS feed

Posted: Tue Mar 06, 2012 12:32 pm
by haggisv
I'm not... but if I can display an RSS feed in a post, I can also display it in the box used for the Annoucement Centre.

Re: BBCOde for an RSS feed

Posted: Tue Mar 06, 2012 12:54 pm
by Mick
Have a look at http://feed2js.org, you can generate a script for your RSS feed there which you should then be able to make a BBCode from.

Edit: This seems to work, I generated the script using the above and the BBC News website.

BBCode usage:

Code: Select all

[feed][/feed]
(or whatever you want to call it)

HTML replacement:

Code: Select all

<script language="JavaScript" src="http://feed2js.org//feed2js.php?src=http%3A%2F%2Ffeeds.bbci.co.uk%2Fnews%2Frss.xml&chan=y&num=2&desc=1&utf=y"  charset="UTF-8" type="text/javascript"></script>

<noscript>
<a href="http://feed2js.org//feed2js.php?src=http%3A%2F%2Ffeeds.bbci.co.uk%2Fnews%2Frss.xml&chan=y&num=2&desc=1&utf=y&html=y">View RSS feed</a>
</noscript>

Re: BBCOde for an RSS feed

Posted: Tue Mar 06, 2012 10:30 pm
by haggisv
Awesome, thank you Mick, I'll give that a go!

EDIT: Works like a charm!!!

Re: BBCOde for an RSS feed

Posted: Wed Mar 07, 2012 12:56 am
by haggisv
I spoke too soon....It seemed to work perfectly to get the initial feed, but it does not update the feed on subsequent reloads of the page... it seems to retain the initial list of the feed....

it also does not seem to pass the URL of each line in the feed, but instead passes the URL of the post that contains the feed.

Re: BBCOde for an RSS feed

Posted: Wed Mar 07, 2012 3:03 am
by Pony99CA
Maybe you should go back to the beginning and tell us what you're trying to accomplish (specifically) and why. Personally, if I want to see an RSS feed, I open an RSS reader on my PC or tablet. Why would I want to view one in a post on your board?

Is it your own feed and you don't want to expose the URL or something? (And, if that's the case, why have a feed at all? Why not just put the feed posts in a topic as phpBB posts?)

Steve

Re: BBCOde for an RSS feed

Posted: Wed Mar 07, 2012 4:00 am
by haggisv
ideally what I would like is discussed in this thread:
http://www.phpbb.com/community/viewtopi ... &t=2151821

Basically it's a scolling News feed in a box using the forum style. If scrolling is not possible, a static feed of News related to the forum topic would still be useful, which is what I'm trying to accomplish in this thread. With the right BBCode and the ACP annoucement Mod, this should be possible.

Re: BBCOde for an RSS feed

Posted: Wed Mar 07, 2012 7:56 am
by Mick
Does the feed you want to use work as you want it to in a normal RSS reader? The reason I ask is I used a similar generated script on one of my boards by pasting it in to a template and it worked fine, it auto updated etc.

Re: BBCOde for an RSS feed

Posted: Wed Mar 07, 2012 11:13 pm
by haggisv
Strangely enough it started working after a while... perhaps it's just slow to update. Some of the other bits don't seem to work properly though. Like when you allow HTML you get descriptions regardless of the setting, and when you disallow HTML all the links point to the thread where you're posting. I could not get just a list of clickable links with no description.