Mystified by Google Feed API, can you explain?

73 views
Skip to first unread message

SingularityUtopia

unread,
Jun 15, 2013, 7:58:47 AM6/15/13
to google-ajax...@googlegroups.com
I am mystified by the Google Feed API instructions.

For example here http://code.google.com/apis/ajax/playground/#dynamic_feed_control_-_vertical the way to set the number of results is numResults : 8, according to http://www.google.com/uds/solutions/dynamicfeed/reference.html but here https://developers.google.com/feed/v1/devguide the method to set number of entries is .setNumEntries(num) - so what is the difference between entries and results? The code in the playground regarding "numResults : 8" will not function with .setNumEntries(8), so how does the code in the playground (http://code.google.com/apis/ajax/playground/#dynamic_feed_control_-_vertical) differ from the code here: https://developers.google.com/feed/v1/devguide?


What I want to do is use the code regarding the vertical stacking, which is listed in the playground:



function OnLoad() {
  var feeds = [
    {
      title: 'People',
      url: 'http://rss.people.com/web/people/rss/topheadlines/index.xml'
    },
    {
      title: 'E-Online',
      url: 'http://www.eonline.com/syndication/feeds/rssfeeds/topstories.xml'
    },
    {
      title: 'TMZ',
      url: 'http://www.tmz.com/rss.xml'
    }
  ];

  var options = {
    stacked : true,
    horizontal : false,
    title : "Hollywood News"
  };

  new GFdynamicFeedControl(feeds, 'content', options);
  document.getElementById('content').style.width = "500px";
}

google.setOnLoadCallback(OnLoad);
 

...but I don't know who to insert that in the document: http://www.google.com/uds/solutions/dynamicfeed/reference.html#hello-world


Furthermore the code http://www.google.com/uds/solutions/dynamicfeed/reference.html#hello-world listed for this page http://www.google.com/uds/solutions/dynamicfeed/helloworld.html seems to differ from the actual page rendered because in the code only one feed url is listed but in the rendered page there are three feeds.



Jeremy Geerdes

unread,
Jun 15, 2013, 9:38:56 AM6/15/13
to google-ajax...@googlegroups.com
First of all, you need to understand that you're looking at documentation for two different (related, but different) things. The Dynamic Feed Control (GFDFC) is a control application built on top of the Feeds API. When you're using the Feeds API directly, you would use .setNumEntries(num). However, when you're using the GFDFC, you need to use the results property in the options object.

To insert a GFDFC into your document, you need to insert the JavaScript code that you pasted into your post into a script element on your page. You also need to make sure that there is a div element with the id content somewhere on the page (wherever you want the control to appear).

You're right in that the code provided in the sample on the documentation page and in the actual Hello, World demonstration are different. You can view source on the Hello, World demonstration to see what they did there.

I would be remiss at this point if I did not point out that the GFDFC is no longer actively supported by Google. As you may have noticed, the documentation has been partially dismantled. Most (if not all) of the links to the documentation from Google properties have been removed. Please understand that this does not mean that the control will be disabled anytime soon, but I think I would be reluctant to use it on any new pages or applications I developed.

Finally, if you're not able to get your page working, you will want to post a link to your page, working or not, rather than just to the documentation. That way, we can see what you're doing and offer specific advice to get you up and running.

jg

--
--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax...@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-searc...@googlegroups.com
To view this message on the web, visit
https://groups.google.com/d/msgid/google-ajax-search-api/44ce24ed-bc3e-44ca-a45f-4e6ae53eaeb7%40googlegroups.com
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-ajax-searc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!
Message has been deleted

SingularityUtopia

unread,
Jun 16, 2013, 2:01:20 AM6/16/13
to google-ajax...@googlegroups.com
Considering "GFDFC is no longer actively supported by Google" I wonder how I convert a feed written based on GFDFC to something not dependent on it? Would it be easy to do, where would I start? Is it merely a matter of writing my on CCS styling?

To view this message on the web, visit
https://groups.google.com/d/msgid/google-ajax-search-api/44ce24ed-bc3e-44ca-a45f-4e6ae53eaeb7%40googlegroups.com
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-ajax-search-api+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages