I'm trying to recreate a Facebook page tab application similar to this one: https://www.facebook.com/andrewchristian/app_118098318208381
Up to now, using FQL, I plan on fetching user data (if the user liked/commented on a post) and display a list with an order based on their activity. It will be a cron running once or twice a day. The only thing I'm missing is a way to know if the user has shared any of the page's posts.
I've been digging around in the FQL tables (the link is for the stream table) for any clues but I cannot find anything to work with. Has anyone done something similar? Any other ideas on how I can fetch such information? This has to work as "per user", I'm not not interested in the total count of shares on a post.
P.S.: If there is something that counts a user's total likes/comments/shares on a Facebook Page, I'd really like to know about that as it would make my life much easier, I'm open to any suggestion!
Thanks in advance!
Related
Imagine I want to store in my database the facebook posts from a user/page for getting them and manipulate them simplier.
I will make a php script that will be launch every day for each user/page who will get the posts I don't already have in my database and insert them.
Now, on my front website, you can log in, and see your posts.
Now, you go on facebook, and modify one of your post.
Now you come again on my website, and obviously, you don't see the modification you did on facebook, because this modification is on facebook database and not in mine, and your posts a retrived from my Database.
Theorically, one of the solution will be that facebook has a "log" table for posts, where i can find something like "this posts has be updated" so i can update my table. Something like that exist ?
If not i have a second solution, at each posts send from my server to my website, update it automatically with facebook database (getById the post on fb an update it in my db) and after that send the posts to my website. But this will be a mess and a lot of request for nothing.
So how can i do this ? Someone have already tried this ? Or only directly manage the posts from facebook database ?
Thanks =)
Facebook has a mechanism to send updates to you, called webhooks.
https://developers.facebook.com/docs/graph-api/webhooks
You can subscribe to several fields for users or pages, among them the feed.
You’ll have to check if it delivers updates to already existing posts as well - but I think it should, would make little sense if it didn’t.
My client has a Facebook page which has his latest posts and shows the reviews people have added.
I want to grab these from Facebook, and output them on his website all styled up nicely with my own markup and styles.
I have had this running in JavaScript with the access token pasted in the JS which is obviously not the way to go, and the token will expire. Now im trying to do the same with PHP. I've read & watched more clips than I care to mention, and I cant get my head around one particular part. Every demonstration i've read or watched requires the website user to login to facebook before this data is returned.
I cant expect ever user who goes on the site to do that. Am I missing something? I just want get the data and display it. No Adding, No Deleting, No Updating. Just display the same information on his website.
Sorry if am asking something stupid here, i'm a novice and for all my efforts I am struggling to understand. I kind of need it in laymans terms so to speak.
Thanks in advance.
I want to update a no_comments row in a database exactly when a facebook comment on my site is made. I would like to do the same thing for likes as well.
I can imagine setting up a cron job that uses the graph API to periodically retrieve the number of comments and likes and update the database but for a large number of objects that are associated with comments the lag introduced is undesirable.
I am not looking for someone to "code a solution" for me...rather can someone point me in the right direction: is it possible to use AJAX to somehow update the database at the point when a comment is made or a like is done?
I can see how one can use the click event for the like button but it's not fool proof...
All help is appreciated!
Assuming you are using Oauth and have a facebook application then I would consult the facebook API docs for events or triggers. If a method exists it will be in the API docs.
Your description of your "site" is vague so it is hard to understand what your site or how it connects to facebook.
Edit:
I wish people would explain down votes. I can't fix it if I don't know what the issue was.
I followed my own advice and searched for this "facebook run script when like is clicked" on Google and found this: enter link description here This is almost the same question except it deals with "like" buttons rather than comments.
You can generate "events" like I had previously suggested. So further consultation of the FB API may be the most fruitful way of finding out if there are events around "comments" as well as "likes".
Maybe the OP knows this, but there are several APIs (last time I checked) to facebook including Javascript methods that could be used in an Ajax manner. However, without further details of their website implementation there is no way to tell.
I'm working on a small project which will basically do some Facebook stuff and pulls the new daily like for client's pages into my database so I could show them my own charts with their page statistics. Now first of all, I have made a cURL request running with a cron-job and scraping their Total Likes every day using the simple graph-api URL.
The problem is with New Daily Likes / Daily unlikes because, based on my little research, there is no way to access these without having a valid access_token and doing today total - yesterday total is not exactly correct, because it will confuse the new likes with the people who disliked this and it will be a total mess.
I don't want to force my clients to go to Facebook and get an access token to access the insights for 2 reasons: 1) I want it to be totally non-technical so they will not need to mess too much with tokens and stuff outside of my panel. 2) I bet some of them will have problems with storing their access tokens in my database.
How do I do that so they will only need to give me the ID of their page (that's how it currently works and I don't want to change it)?
Basically, there are 2 ways to get Likes information, one is to query public information, like:
http://graph.facebook.com/cocacola
And the other one is to query for page insights information, for which you need access tokens with right permissions.
If you don't want your clients to install your Facebook application with permissions (and with that, give you access token), your only option is to query public information.
As you've noticed, that gives you a problem, since each day "likes" gain is "mashed up" from users adding likes and removing likes, and thus, you dont have precise information about how many users liked and disliked every day. One way would be to query the information, lets say per hour, or even 5 minutes, and store that information. Then, by simple math, you can see how many users liked and disliked the page. It is still not totaly precise, but its alot more valid than "daily information".
I have a question about twitter counting. Everything is so blury about this.
Simply:
I have website with dynamic pages, button for tweet, people go to page, press tweet, it shows on they twitter, count on my page increase. but I need also on my backend to call to twitter and ask them how many shares i have already and count with that.
It is concept for voting. People by sharing to facebook and twitter are voting for the website, so i need to take those votes and count them together. Please dont recommend me scripts like "sharecount" i tried and it has a lot of issues, and its not reliable.
I can get easily likes from facebook but i dont seems to get how to get the number of shares from twitter.
Also if anyone can help me, is there a way to get shares from unique users ? I noticed that if i tweet the site 50 times, the counter is 50. I would like it to count 50 tweets from 1 user as 1.
Thanks for help!
See the private API method http://urls.api.twitter.com/1/urls/count.json?url=