Post update! I have been away from this blog for quite a while now; sometimes things turn in a way you wouln’t expect… Since this post seems to still be pretty active, I’m planning an update to include some explanation,more context and feedbacks. Please be patient and thanks for your suggestions:)
I’ve finally decided to post another no-brainer JQuery plugin: a simple news box fed by an RSS feed. You can see an example on our project’s home page. I had found the idea on the JQuery mailing list but loving plugins (although not really good at it) I decided to wrap it up a bit.
The result is quite simple: just place a div somewhere and initialize it with a feed URL:
<script language="JavaScript" type="text/javascript"> $('#rightcolumn').feedreader({ targeturl: 'http://blogs.atalayasec.org/atalaya/?feed=rss2' }); </script> ... <div id="rightcolumn"> </div>
There are two other configuration options available; how many posts to put in the news box and the length of the text to be displayed for each item. A complete initialization would be then like the following:
$('#rightcolumn').feedreader({ targeturl: 'http://blogs.atalayasec.org/atalaya/?feed=rss2', items: 3, descLength: 15 });
The code is pretty rough (and not really js-style) but functional. In case it’s useful to someone.
But where is the feedreader function declared?
Hi Feuer
mmh, maybe it’s not that clear, you are right…
The script is at
http://atalayasec.org/js/feedreader.js
hope this helps
F
[...] Dev Journal » Blog Archive » JQuery RSS feed reader plugin $(‘#rightcolumn‘).feedreader({ targeturl: ‘http://blogs.atalayasec.org/atalaya/?feed=rss2‘, items: 3, descLength: 15 }); (tags: jquery rss plugin feeds xml) [...]
Hi!
I wanted to try, but does not work. I’m completely new to jQuery, please help. Is this correct:
$("#rightcolumn").feedreader({
targeturl: "http://localhost/jQueryTest/rss.xml"
});
asd
oh, stripped html.
looks like as it doesnt work with remote URLs. Jean-Francois Hovinne does use a primitive “proxy” (ie. a php script that reads in the given feed URL) with his jFeed feed aggregator to avoid these problems.
cu, w0lf.
Well, no, unless you setup the appropriate privileges in the browser to make it work… Obviously if you add a server side component (as a proxy) you can avoid this problem, but then the general cross-domain XHR security guidelines apply.
Btw, thanks for the link, I didn’t know of Jean’s solution.
Francesco
great plug in , new release have more future , i have been working in this as well.
And I liked, will be looking at your site.
for use plugin with external links
function loadExternalRssDomaine(){
header(’Content-Type: text-xml’);
print file_get_contents(’http://blogs.atalayasec.org/atalaya/?feed=rss2′);
}
great plugin
where should i put this?
function loadExternalRssDomaine(){
header(’Content-Type: text-xml’);
print file_get_contents(’http://blogs.atalayasec.org/atalaya/?feed=rss2′);
}
it’s a PHP function that retrieves the rss feed server-side, so that XSS constraints no longer apply.
This means that the RSS contents are already there when JQuery kicks in, so you don’t need to use $.get() but simply parse it with the same function that comes with the plugin:)
hope this helps
F
bug with Safari, RSS does not appear
div remains empty
I’m either retarded, or this doesn’t work. I’ve uploaded the feedreader.js file to my site, placed the appropriate javascript into head of my page, pointed it to my rss feed (I’ve tried it with both rss and atom), and nothing happens… I’m staring at a blank content box.
late reply…mmh I’ll give a look at this, and thanks for the external link tip;)
Eric, could you post the link to your site (or send it by email) so I can give a look? Also, is the feed you are trying to access published on the same domain?
Thank you for the plug in. It looks really nice and compact.
I had some issues though.For some reasons, the feedreader.js cant read the tag.. Its reading the other tags like , , but wouldnt read the tag. However, if the change the tag to something else like and modify the feedreader.js, its reading the ..
These are the feeds that i tried with..(I copied the xml onto my local machine)
http://blogs.atalayasec.org/atalaya/?feed=rss2
http://rss.cnn.com/rss/cnn_topstories.rss
I am using FireFox 3.0.6..
Oh no.. It stripped my xml tags.. Here is my comment again..
Thank you for the plug in. It looks really nice and compact.
I had some issues though.For some reasons, the feedreader.js cant read the link tag.. Its reading the other tags like title, description, but wouldnt read the link tag. However, if the change the tag to something else like blabla and modify the feedreader.js, its reading the blabla tag..
These are the feeds that i tried with..(I copied the xml onto my local machine)
http://blogs.atalayasec.org/atalaya/?feed=rss2
http://rss.cnn.com/rss/cnn_topstories.rss
I am using FireFox 3.0.6..
Hi there
I’m not sure I get what you mean, but the plugin gets the element within each- contained in the feed. This should work, given that the main page on http://atalayasec.org is displaying the item’s link correctly.
Could you post an URL with your code? let me know
F
I would like to see the inscription “to be continied”:-D
What is the licensing on this? Open? Can I change it?
I would like to see the inscription “to be continied”:-D
Thanks!
could you show how the external link script posted by gtraxx works?
I’m not sure how to get it going..
Thanks,
David
So, will this work if I want to display an RSS feed from another domain?
I don’t understand what gtraxx means and how I should use his/her function.
Any help would be appreciated
thanks
Russell
Very useful, really easy to use! Thank you so much.
Hm that sounds good but I would like to know more details.
Your news is a cool stuff man, keep it going.
Я не тороплюсь домой
Как глупо все и несерьезно
Я слишком больна тобой
Позволь позабыть обо всем
Я не тороплюсь домой
Темно за окном – значит поздно
Небо роняет звезды как слезы
Stunning blog and good article. High 5 for u man !
Hi there.. I’m battling to get this to work.
I added the Script to the header, and the Div tag to the Body..
But it stays blank…
Nothing loads on Website.. How can I fix this.? PLS HELP
http://www.ghdesign.org/test/
i’ve tested it out, online too…
Hi there, and sorry for the late reply…
from what I see in the link you provide it seems to be working now. Happy for that!
Hey!! YEAH!! it went really well!!