How to Increase RSS Feeds Using Google Dynamic Feed Control

Currently, the channels show four news items. How to increase it so that it contains more than 4 news? I tried:

var feed.setNumEntries(20); after var feed ="http://feeds.bbci.co.uk/news/uk/rss.xml"; 

But it does not work

 <!doctype html> <html> <head> <meta charset="utf-8"> <title>World Travel online</title> <link href="styles/main.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="https://www.google.com/jsapi"></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 : 10px; margin-left: auto; margin-right: auto; width : 400px; font-size: 12px; color: #9CADD0; } </style> <script type="text/javascript"> function load() { var feed ="http://feeds.bbci.co.uk/news/uk/rss.xml"; new GFdynamicFeedControl(feed, "feedControl"); } google.load("feeds", "1"); google.setOnLoadCallback(load); </script> <div id="body"> <div id="feedControl">Loading...</div> </div> 
+4
source share
1 answer

Try the following:

 function load() { var feed ="http://feeds.bbci.co.uk/news/uk/rss.xml"; new GFdynamicFeedControl(feed, "feedControl", {numResults:8}); } google.load("feeds", "1"); google.setOnLoadCallback(load); 

Example: jsFiddle

This thread assumes a lack of documentation because GFdynamicFeedControl no longer under active development. Instead, they recommend using the Google Feed API .

Regardless, I found the answer in the JS source code . Also note that in addition to passing numResults, you can set a set of parameters:

 this.options = { numResults : GFdynamicFeedControl.DEFAULT_NUM_RESULTS, feedCycleTime : GFdynamicFeedControl.DEFAULT_FEED_CYCLE_TIME, linkTarget : google.feeds.LINK_TARGET_BLANK, displayTime : GFdynamicFeedControl.DEFAULT_DISPLAY_TIME, transitionTime : GFdynamicFeedControl.DEFAULT_TRANSISTION_TIME, transitionStep : GFdynamicFeedControl.DEFAULT_TRANSISTION_STEP, fadeOutTime: GFdynamicFeedControl.DEFAULT_FADEOUT_TIME, scrollOnFadeOut : true, pauseOnHover : true, hoverTime : GFdynamicFeedControl.DEFAULT_HOVER_TIME, autoCleanup : true, transitionCallback : null, feedTransitionCallback : null, feedLoadCallback : null, collapseable : false, sortByDate : false, horizontal : false, stacked : false, title : null }; 
+3
source

Source: https://habr.com/ru/post/1481281/


All Articles