Closed pavelk2 closed 8 years ago
I've fixed the callback functionality for this in a fork. https://github.com/graphical-iain/social-feed
I did however remove support for Google+, Vk and Blogspot, since I didn't need them.
Hi
I get error: FB is not defined.
Any solution?
@seegermattijs, Can you post your init code?
Just tested your code and got this:
jquery.socialfeed.js:245 Uncaught ReferenceError: FB is not defined
Oh, sorry about that. I forgot to mention in my description that since I updated the code to use Open Graph v2, you'll need to include the Fb SDK init script before you call the plugin:
<script src="//connect.facebook.net/en_US/sdk.js"></script>
Thanks, errors are gone now but it seems like the facebook posts aren't loaded?
That might be because of a fb bug that's currently happening. What kind of posts are you trying to get?
I tried with 'dolomiti' and '@primaverasoundfestivals'. Would like to get posts from a Facebook page.
I think that's the same bug that I was encountering. I just uploaded an updated version that accounts for the bug, I thought it was just temporary, so I didn't bother uploading the fix. Try that.
Too bad, Facebook posts still not appearing.
The script is currently working on my projects, so it might be something in your init. I just tried 'primaverasoundfestivals' in my script and it worked fine. However 'dolomiti' is a user, so you'd have to have a different set of permissions to access that user's posts. Verify that your access_token is correct and has correct permissions to access that user's posts.
Thanks a lot!
It works now! Facebooks posts also show posts of users who tagged the facebook account. Is there a way to only show posts of the page?
this is a different topic: please check here https://github.com/pavelk2/social-feed/issues/55
I changed my moderation function to following function:
moderation: function(content){
return (content.social_network == "facebook") ? content.author_name == "primaverasoundfestivals" : true;
return (content.text) ? content.text.indexOf('fuck') == -1 : true;
},
Unfortunately facebook posts aren't showing at all, maybe because the version of @graphical-iain is a bit different?
Try this function: https://gist.github.com/pavelk2/46d9d744c30d9aa81b3d
Facebook posts of users still showing with that function
Cool, so no you only need to fillter the author. before that you were doing:
return (content.social_network == "facebook") ? content.author_name == "primaverasoundfestivals" : true; while in fact i guess that in your case you should do: return (content.social_network == "facebook") ? content.author_name == "Primavera Sound Festival" : true;
Let me know if it does work for you.
On Fri, Mar 6, 2015 at 10:26 AM seegermattijs notifications@github.com wrote:
Facebook posts of users still showing with that function
— Reply to this email directly or view it on GitHub https://github.com/pavelk2/social-feed/issues/32#issuecomment-77529869.
Awesome! That works great. Thanks a lot!
Hi @pavelk2 and @graphical-iain One more question, My script gets 3 FB posts at the moment. With your script it leaves out every post which is not posted by the page itself, which is ok.
But if the most recent posts by coincidence are three posts by random people about the page, it shows nothing because your if statement leaves them out.
The counter stops at 3 but I still don't have posts from the page itself. How can I fix this?
The way social-feed currently works: the limits you define are injected into the requests to social-networks - so social-feed request from the facebook only the latest 3 posts. Then social-feed filters them - in your case all of the posts do not pass the moderation function, which means that social-feed has nothing to show.
Hi @seegermattijs @pavelk2, I have the same problem to showing my facebook feed. Can you say me where I need to add this function:
and them where I need to add this change: return (content.social_network == "facebook") ? content.author_name == "primaverasoundfestivals" : true; while in fact i guess that in your case you should do: return (content.social_network == "facebook") ? content.author_name == "Primavera Sound Festival" : true;
thank you
hi @bettyorganero i don't understand how you installed the socialfeed script. Why you need to tweak https://gist.github.com/pavelk2/46d9d744c30d9aa81b3d.js that is not part of the plugin??
Hi @HartLarsson thanks for your answer. I installed social-feed.js and I try to visualize my facebook feed but it not work. I read this chat and @pavelk2 done a solution for this problem but I don't understand where I need to made this change:
@pavelk2: Try this function: https://gist.github.com/pavelk2/46d9d744c30d9aa81b3d
I tried this but also it does not work :
return (content.social_network == "facebook") ? content.author_name ==
"primaverasoundfestivals" : true;
while in fact i guess that in your case you should do:
return (content.social_network == "facebook") ? content.author_name ==
"Primavera Sound Festival" : true;
Do you have any information about How social-feed.js works with Facebook? Thank you!
$('.social-feed-container').socialfeed({
// FACEBOOK
facebook:{
accounts: ['@teslamotors','!teslamotors'], //Array: Specify a list of accounts from which to pull wall posts
limit: 2, //Integer: max number of posts to load
access_token: 'YOUR_FACEBOOK_ACCESS_TOKEN' //String: "APP_ID|APP_SECRET"
},
// GENERAL SETTINGS
length:400, //Integer: For posts with text longer than this length, show an ellipsis.
show_media:true, //Boolean: if false, doesn't display any post images
media_min_width: 300, //Integer: Only get posts with images larger than this value
update_period: 5000, //Integer: Number of seconds before social-feed will attempt to load new posts.
template: "bower_components/social-feed/template.html",
date_format: "ll", //String: Display format of the date attribute (see http://momentjs.com/docs/#/displaying/format/)
date_locale: "en", //String: The locale of the date (see: http://momentjs.com/docs/#/i18n/changing-locale/)
moderation: function(content) { //Function: if returns false, template will have class hidden
return (content.text) ? content.text.indexOf('fuck') == -1 : true;
},
callback: function() { //Function: This is a callback function which is evoked when all the posts are collected and displayed
console.log("All posts collected!");
}
});
i post the general example you find in the read.me with only facebook just to show you where is the callback function and the Moderation function Pavel have post before. Please use your code in the right way (inside callback or moderation functions)
why you need a callback or moderation? for visualization only you dont' need any of these function so you can remove them from the configuration
@HartLarsson thanks for your time but the original code like the general example from read.me, don't work with Facebook. With twitter is ok but I need to work with Facebook. My APP_ID|APP_SECRET are right and I don't have a feed visualisegtion.
for me works, if you have created your app_id and secret key. works aout of the box. please if you use crome press f12 and check if you have some javascript error in console
If there are no any messages for some account - callback function will not be triggered