CodeIgniter Forums

Full Version: [Solved] RSS Feed For This Fourm
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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);
 
   }
 
 });
}); 
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).
(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