pavelk2 / social-feed

JavaScript plugin that shows a user feed from the most popular social networks
http://pavelk2.github.io/social-feed-example/
MIT License
962 stars 304 forks source link

Count all requests disregard of their status for callback #144

Open shadle10 opened 8 years ago

shadle10 commented 8 years ago

Hi! First off, I absolutely love your plugin and really appreciate having the ability to reuse it - it has really helped me out. Second, I'm not able to get the callback function (from the options) to fire. This is happening on http://pavelk2.github.io/social-feed/ as well as my local version - the "all posts are collected" log message that should be displayed once all posts have been procured isn't. Thanks!

Webarkitekt commented 8 years ago

CB is fired when all the post are loaded. If not, then the CB is never call. I tried and it works nicely for me. Give me an example please

shadle10 commented 8 years ago

For example, on pavelk2.github.io/social-feed, the callback function has this line: console.log('all posts are collected'). But 'all posts are collected' is never visible in the console. Is it an issue with the number of posts that you set in the social networks?

Webarkitekt commented 8 years ago

Yes it's probably because google api return an error, than the posts are not counted

Webarkitekt commented 8 years ago

@pavelk2 I think we should found a solution to add the posts to the total count loaded in both case, if the network api return an error or not.

HartLarsson commented 8 years ago

the problem on http://pavelk2.github.io/social-feed/ is that is using the google api that are not working anymore (nned a new api key probably).

shadle10 commented 8 years ago

Thanks for the quick response :)

olliekav commented 8 years ago

It's no longer working for Twitter either, my set up...

$('.tweets').socialfeed({
    twitter:{
      accounts: ['@kyan', '#webmeetguildford'],
      limit: 4,
      consumer_key: 'key',
      consumer_secret: 'secret'
    },
    template_html:
      '<div class="gallery-cell tweetsCol twitter-post"> \
        <img class="tweetsImg" src="{{=it.author_picture}}"/> \
        <p class="tweetsTxt">{{=it.text}}</p> \
      </div>',
    callback: function() {                          //Function: This is a callback function which is evoked when all the posts are collected and displayed
      console.log("All posts collected!");
    }
  });