Welcome Guest, Not a member yet? Register   Sign In
[Solved] RSS Feed For This Fourm
#1

(This post was last modified: 01-20-2016, 12:52 AM by wolfgang1983.)

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);
 
   }
 
 });
}); 
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply
#2

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).
Best VPS Hosting : Digital Ocean
Reply
#3

(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
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB