CodeIgniter Forums
[Solved] RSS Feed For This Fourm - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: General (https://forum.codeigniter.com/forum-1.html)
+--- Forum: Lounge (https://forum.codeigniter.com/forum-3.html)
+--- Thread: [Solved] RSS Feed For This Fourm (/thread-64100.html)



[Solved] RSS Feed For This Fourm - wolfgang1983 - 01-14-2016

Hi.

I am trying to find out how in the rss feed part of this forum how I could get the date it for each post i have a example here Codepen Example

But where it says undefined it should say the date of it posted.

Here is the full view Codepen Full View

Any suggestions how to get date of post for rss?


PHP Code:
$(document).ready(function() {
 
 url 'http://forum.codeigniter.com/syndication.php?limit=15 ';
 
 $.ajax({
 
   type"GET",
 
   urldocument.location.protocol '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=1000&callback=?&q=' encodeURIComponent(url),
 
   dataType'json',
 
   error: function() {
 
     alert('Unable to load feed, Incorrect path or invalid feed');
 
   },
 
   success: function(xml) {
 
     var postlist xml.responseData.feed.entries;
 
     var html '<ul class="list-unstyled">';
 
     $.each(postlist, function(idxdata) {
 
       html += '<li>';
 
       html += '<a href="' data.link '" target="_blank">';
 
       html += '<h3 class="rss_feed_title">' data.title '</h3>';
 
       html += '</a>';
 
       html += '<small>' data.date '</small>';
 
       html += '</li>';
 
       return idx 4;
 
     });

 
     html += '</ul>';
 
     $(".rss_feed").append(html);
 
   }
 
 });
}); 



RE: RSS Feed For This Fourm - sv3tli0 - 01-14-2016

At your JS just put
Code:
data.publishedDate
instead of
Code:
data.date
.
You may need to parse it before outputing (to format it in a little bit more clear format).


RE: RSS Feed For This Fourm - wolfgang1983 - 01-14-2016

(01-14-2016, 04:41 AM)sv3tli0 Wrote: At your JS just put
Code:
data.publishedDate
instead of
Code:
data.date
.
You may need to parse it before outputing (to format it in a little bit more clear format).

Thanks for tip