[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

display more topics from rss feed using google ajax feed

Posted on 2009-05-02
6
Medium Priority
?
702 Views
Last Modified: 2013-11-18
How can I display more topics in my google ajax rss reader located here http://buttonbeats.com/googlerss.html

I looked at the google instructions to do it located here http://www.google.com/uds/solutions/dynamicfeed/reference.html#_numresults

and that said to use the code below to define the number of topics.  But im not sure where to insert the code snippet.  

<script type="text/javascript">
  var options = {
    numResults : 8
  }
  new GFdynamicFeedControl(feed, "feedControl", options);
</script>



and below is the code  that displays the rss feed.  
<!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 Feed API - AJAX Slide Show Sample</title>
  <script src="http://www.google.com/jsapi/?key=YOUR-KEY"
    type="text/javascript"></script>
  <script src="http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.js"
    type="text/javascript"></script>
 
  <style type="text/css">
    @import url("http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.css");
 
    #feedControl { 
      margin-top : 20px;
      margin-left: auto;
      margin-right: auto;
      width : 440px;
      font-size: 16px;
      color: #9CADD0;
    }
  </style>
  <script type="text/javascript">
    function load() {
      var feed ="http://rss.people.com/web/people/rss/topheadlines/index.xml";
      new GFdynamicFeedControl(feed, "feedControl");
 
    }
    google.load("feeds", "1");
    google.setOnLoadCallback(load);
  </script>
</head>
 
<body>
  <div id="body">
    <div id="feedControl">Loading...</div>
  </div>
</body>
</html>

Open in new window

0
Comment
Question by:ForLoop5
  • 4
  • 2
6 Comments
 
LVL 1

Author Comment

by:ForLoop5
ID: 24286814
Also do  you know how I can display multiple feeds on the same page ?
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 24287561
Try this - I put some whitespace around the changes.  HTH, ~Ray
<!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 Feed API - AJAX Slide Show Sample</title>
  <script src="http://www.google.com/jsapi/?key=YOUR KEY HERE"
    type="text/javascript"></script>
  <script src="http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.js"
    type="text/javascript"></script>
 
  <style type="text/css">
    @import url("http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.css");
 
    #feedControl {
      margin-top : 20px;
      margin-left: auto;
      margin-right: auto;
      width : 440px;
      font-size: 16px;
      color: #9CADD0;
    }
  </style>
 
 
 
<script type="text/javascript">
function load() {
      var feed ="http://rss.people.com/web/people/rss/topheadlines/index.xml";
      var options = { numResults : 8 }
      new GFdynamicFeedControl(feed, "feedControl", options);
 
}
 
 
 
google.load("feeds", "1");
google.setOnLoadCallback(load);
</script>
</head>
 
<body>
  <div id="body">
    <div id="feedControl">Loading...</div>
  </div>
</body>
</html>

Open in new window

0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 24287572
On the question of multiple feeds, I expect it can be done, but I do not know how without some experimentation.  I think that is really a separate question, but if you want to give me another feed to experiment with, perhaps I can make two appear on the same page.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 24287616
Have a look at this.  It seems to be able to place two feeds on the same page.

Best regards, ~Ray
<!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 Feed API - AJAX Slide Show Sample</title>
  <script src="http://www.google.com/jsapi/?key=GOOGLE_API_KEY"
    type="text/javascript"></script>
  <script src="http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.js"
    type="text/javascript"></script>
 
  <style type="text/css">
    @import url("http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.css");
 
    #feedControl {
      margin-top : 20px;
      margin-left: auto;
      margin-right: auto;
      width : 440px;
      font-size: 16px;
      color: #9CADD0;
    }
 
 
 
    #feedControl2 {
      margin-top : 20px;
      margin-left: auto;
      margin-right: auto;
      width : 600px;
      font-size: 22px;
      color: #orange;
    }
 
  </style>
 
 
 
<script type="text/javascript">
function load() {
      var feed  = "http://rss.people.com/web/people/rss/topheadlines/index.xml";
      var feed2 = "http://www.ntcicfunds.com/news/rss_feed.xml";
 
      var options = { numResults : 8 }
      new GFdynamicFeedControl(feed,  "feedControl",  options);
      new GFdynamicFeedControl(feed2, "feedControl2");
}
 
 
google.load("feeds", "1");
google.setOnLoadCallback(load);
</script>
</head>
 
<body>
  <div id="body">
    <div id="feedControl">Loading...</div>
    <div id="feedControl2">Loading...</div>
  </div>
</body>
</html>

Open in new window

0
 
LVL 1

Author Closing Comment

by:ForLoop5
ID: 31577201
worked great.  Thank you.  
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 24300094
You're welcome, and thanks for the points - it's a great question! ~Ray
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses
Course of the Month17 days, 18 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question