Open HartLarsson opened 8 years ago
@HartLarsson I was wondering if it would make sense to count the number of requests to different services rather than the number of posts returned? That way you could still increment if the request failed and just skip over it, but you would have a reliable number of expected requests.
i'e tried the same fix applied to RSS feed suggested by https://github.com/DrJest here https://github.com/pavelk2/social-feed/pull/171/files/e20ede2011dcb24f1781c1c41f9a59112967403a#r59769682
getPosts: function(json) {
if (json.query.count > 0 ){
// fix rendering if posts_to_load_count is not reached
if (json.query.count < options.rss.limit) posts_to_load_count -= options.rss.limit - json.query.count;
$.each(json.query.results.feed, function(index, element) {
var post = new SocialFeedPost('rss', Feed.rss.utility.unifyPostData(index, element));
post.render();
});
}
},
and works as expected. This could fix every problem or we can redesign as you told the whole rendering engine using your suggested method truncating if the limit is surpassed for every feed source.
Is there a way to use the fix for facebook, twitter etc.?
yes, there is already a pull request. https://github.com/pavelk2/social-feed/pull/173 You can check my repository version too, i've added many advanced features to the RSS part.
@HartLarsson thank you for your help ! :)
am I getting this right, that your pull request fixes only rss feed and #173 fixes the social feeds?
Im having the problem that the Callback isn't fired if there are not enough posts on Facebook - for example i want to pull 10 post but there are only 5..
Please check my repository where i forked the pavel version: https://github.com/HartLarsson/social-feed
Thank you so much! It works!
@HartLarsson That doesn't work for me with the "-render" version (blank screen) and with your updated socialfeed.js I always get
TypeError: json.query.results is null $.each(json.query.results.feed, function(index, element) {
See http://peleke.diphda.uberspace.de/bower_components/social-feed/ (Currently that page looks bad because I tried to use Swiper (as recommended in https://github.com/pavelk2/social-feed/issues/152) for horizontal swiping without success)
there is an error on acces_token of facebook, normally must be "APP_ID|APP_SECRET" while yours seems is composed by the APP_SECRET only RSS 2 feed need to have a limit value > 0
i've tested your TWITTER, RSS & Instagram and all works using my jquery.socialfeed-render.js version:
http://grabilla.com/06709-119fc57d-b0a6-4272-8dbf-0ffbfe4ee3ad.png
facebook "@fniedernolte" MUST BE A FACEBOOK PAGE not a PROFILE PAGE
the function calculatePostsToLoadCount() have some problems because not calculate if a feed is reach the max posts. Due to this limit if for example an RSS feed that have only 4 posts, and the limit is put to 20 the callback() function is never called even if there are no more feed to display.
the SocialFeedPost.prototype must be implented to execute fireCallback() function even if is not satisfied this:
if (loaded_post_count == posts_to_load_count) { fireCallback(); }
this is due to the fact that posts_to_load_count, calculated by calculatePostsToLoadCount() rapresent the MAX feed to display and not the minimum.
if someone have implemented already such a modification please post the fix..
thank you so much