homepage Welcome to WebmasterWorld Guest from 54.226.180.223
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

    
help with code for posting rss to my website
need help with code for posting rss to my website
koblogging




msg:3897821
 3:37 pm on Apr 22, 2009 (gmt 0)
I was hoping someone could help me with figuring out how to post rss to my website. I want to post news headlines from Google news, cnn, yahoo etc about jobs etc to my website. I found this code which does a nice job, but I would like more posts - it only adds 4 posts from the rss how do I change that number? any ideas?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google AJAX Search API Sample</title>
<script src="http://www.google.com/jsapi?key=ABQIAAAA1XbMiDxx_BTCY2_F................"></script>
<script type="text/javascript">
/*
* How to use the Feed Control to grab, parse and display feeds.
*/

google.load("feeds", "1");

function OnLoad() {
// Create a feed control
var feedControl = new google.feeds.FeedControl();

// Add two feeds.
feedControl.addFeed("http://news.google.com/news?pz=1&ned=us&hl=en&q=jobs&output=rss", "Google");
feedControl.addFeed("http://rss.cnn.com/rss/money_latest.rss", "CNN");

// Draw it.
feedControl.draw(document.getElementById("content"));
}

google.setOnLoadCallback(OnLoad);
</script>
</head>
<body style="font-family: Arial;border: 0 none;">
<div id="content">Loading...</div>
</body>
</html>

 

piatkow




msg:3897914
 5:31 pm on Apr 22, 2009 (gmt 0)

Any configuration of the display would be done through Google not on the page. I don't use them myself so I don't know what they give you.

bill




msg:3898296
 5:23 am on Apr 23, 2009 (gmt 0)

Welcome to WebmasterWorld koblogging.

That code appears to be from the Google AJAX Search API Developer's Guide [code.google.com]. You would want to read through their documentation to get a better idea of the elements that can be manipulated.

If you'd like another way to get feeds on your site we have a classic post: Short guide to include RSS on your website [webmasterworld.com] that uses Magpie to do much the same.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved