Gossamer Forum
Quote Reply
RSS feed plugin request
Hi,

is there any possibility or consideration of a plugin that allows news feeds to be delivered depending on category selected, i.e my categories drill down to towns in the UK, it would be useful to display local weather and news.

Been looking at various RSS feeds and BBC seems to provide news for local regions. I have also seen several sites displaying weather in a town but I think this might be eaiser with a plugin rather than code each category page.

Happy to contribute towards development of something along these lines.

many thanks
Kevin

Cheers
KevM
Quote Reply
Re: [KevM] RSS feed plugin request In reply to
Hi KevM,

Andy Newby at http://Ultranerds.com created one called BBC_News. It can be used to get news feed into your directory.

I also created a similar one with some more feature like replacing word or phrase, limit the number of news to be displayed.

Hope that helps.

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] RSS feed plugin request In reply to
Thanks for the reply Dat,

I had a look at several threads and Andy's plug in but it seemed a bit general, I am looking for a way of feeding news based on the category selected (and weather too) but maybe this is a bit too hard at the moment and can only be hand coded on each category page.

Many thanks again though,

Kev

Cheers
KevM
Quote Reply
Re: [KevM] RSS feed plugin request In reply to
I'm using various feeds in my categories (example). I don't put the feeds into the GLinks-database, and the connecting is done via Feed2JS, i.e., a dynamic/cached feed-to-javascript converter. I then put the category name into the URL-string this javascript is calling. Of course, you need to use a ffed service that allows for this, but most do.
Quote Reply
Re: [KevM] RSS feed plugin request In reply to
Can you give me an example feed - I'm pretty sure this should be possible with a simple global rather than a plugin. I'm using several xml feeds on my site to dynamically grab data as the page is loaded.
Quote Reply
Re: [afinlr] RSS feed plugin request In reply to
Hi afinlr,

as an example the bbc news feed for essex is
http://newsrss.bbc.co.uk/...ngland/essex/rss.xml

weather for chelmsford in essex
http://uk.weather.yahoo.com/...KXX0031/index_c.html
or
http://weather.pipex.com/...st/0,13339,3,00.html

My aim is to personalise the regional categories, I am very green to RSS feeds but it seems like a logical step although the more I think about it the harder I think this actually is.

It triggered from a local info site that displayed some local news and weather, I suspect via BBC feeds but that was the point I could not get past, just how to generically capture the info, every time the directory is rebuilt the pages change so staic html coding in my mind isn't the best approach.

Would welcome input or ideas.
Many thanks for your help,
Kevin

Cheers
KevM
Quote Reply
Re: [KevM] RSS feed plugin request In reply to
Here's an example to get you going:

sub {
use XML::Simple qw(:strict);
my $Request = "http://newsrss.bbc.co.uk/...ngland/essex/rss.xml";
my $response = get($Request);
die "Request failed\n" unless defined($response);
my $ref=XMLin($response,forcearray => [qw()],keyattr=>[]);
return {News_Hash=>$ref->{channel}};
}

Then in your templates you should be able to use something like

<%globalname%>
<%loop News_Hash.item%>
<%title%>: <%description%>
<%endloop%>

Last edited by:

afinlr: Mar 15, 2006, 12:16 PM
Quote Reply
Re: [afinlr] RSS feed plugin request In reply to
SmileThanks afinlr, I'll give this a go. From this I should be able to extend it a bit further.
cheers
Kevin

Cheers
KevM
Quote Reply
Re: [KevM] RSS feed plugin request In reply to
I did it in:
http://civil.construaprende.com/-Paises/index.html

You can clic on different countries, and the feeds are newspapers news from each country

I did it in the following way:

I use Carp rss, for the feeds:
http://www.geckotribe.com/rss/carp/
Using the javascript option:
http://carp.docs.geckotribe.com/examples/js.php

Now, for the categories, I made a copy of
category.html
and renamed it
cat-example.html

Then, in cat-example.html:
Find:
<%if Category_Template and Category_Template ne 'category.html'%>
change:
<%if Category_Template and Category_Template ne 'cat-example.html'%>


And then log in to your gossamer links,
and browse to the "Example" Category, clic on EDIT
and write in CATEGORY TEMPLATE
cat-example.html


That's all

Last edited by:

tenoch: Apr 15, 2006, 1:41 AM