entry.puiblishedDate gives "undefined" error message

66 views
Skip to first unread message

Jaideep Reddy

unread,
Dec 26, 2013, 4:29:11 PM12/26/13
to google-ajax...@googlegroups.com
When I use entry.puiblishedDate getting "undefined" error message, can you please help if there is any other way to get the date of the article published
 
<script type="text/javascript">
        google.load("feeds", "1");
              
        function OnLoad() {                                               
            var query = 'Century 21';
            google.feeds.findFeeds(query, findDone);
        } 
       
        function findDone(result) {   
             if (!result.error) {
                var content = document.getElementById('content');
                var html = '';
                for (var i = 0; i < result.entries.length; i++) {                   
                    var entry = result.entries[i];
                    html += '<p><a href="' + entry.link + '" style=display:block;color:Blue;width:900px;font-size=small target=_blank>' + entry.title + entry.publishedDate + '</a></p>';
                }
                content.innerHTML = html;
            }
        }
        google.setOnLoadCallback(OnLoad);
    </script>

Jeremy Geerdes

unread,
Dec 26, 2013, 6:14:22 PM12/26/13
to google-ajax...@googlegroups.com
I think you're missing a step. You use the findFeeds function, which will return an array of feeds that you can then fetch to get entries. But you're skipping the part where you load a feed.

You need to reconfigure your findFeeds call so that it calls a function that will work through the array of feeds returned and load them each in turn using google.feeds.load.

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/e6678766-e08b-4efd-bb97-b052119188ce%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!

Jaideep Reddy

unread,
Dec 26, 2013, 10:13:58 PM12/26/13
to google-ajax...@googlegroups.com
Thanks for your response, I did use the findFeeds call as below
google.feeds.findFeeds(query, findDone);

Jeremy Geerdes

unread,
Dec 26, 2013, 10:31:23 PM12/26/13
to google-ajax...@googlegroups.com

Yes, I see that. As I said, findFeed does a search for feeds matching your criteria. It returns feed URLs, not feed entries. You need to iterate through the feed URLs it returns and use google.feeds.load to actually load the feed.

Jg

On Dec 26, 2013 9:14 PM, "Jaideep Reddy" <jai...@gmail.com> wrote:
Thanks for your response, I did use the findFeeds call as below
google.feeds.findFeeds(query, findDone);

--
--
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

JR

unread,
Dec 27, 2013, 2:31:56 PM12/27/13
to google-ajax...@googlegroups.com
I really appreciate your help, not able to get this to work.
Can you please provide me some sample code for this so that I can get the publishedDate.

JR

unread,
Dec 31, 2013, 7:58:50 AM12/31/13
to google-ajax...@googlegroups.com
Here is my complete code I am using, can you please suggest the changes I need to make inorder to get the publishedDate for each Url.
Reply all
Reply to author
Forward
0 new messages