query posts by my facebook application - facebook

I have a facebook app that posts messages on user's wall. Is there a way for me to query all the posts created by all users using my app (for a certain time period)?
I don't want to query just the posts made by my app for a specific user but all the wall posts made by my application.
Thanks.

You can use the stream table. It has an app_id field.
Down side is it is limited to the last 30 days or last 50 posts.
http://developers.facebook.com/docs/reference/fql/stream/

Related

Is there a way to count the number of times each individual Facebook Friend has liked your Facebook posts?

Iam trying get the number of times each individual liked my particular post.
It seems that it is possible to get the overall like count of a page.
But I dont need the overall like count. I want in specific data of a user who liked my posts.
I tried these links
How can I get fan page likes count using graph api?
Getting the Facebook like/share count for a given URL
How to get Facebook likes count for a Facebook page?
I am just writing the answer which is mentioned in the comment. Because that's the answer.
No, that is not really possible. Each of your friends would have to
sign in to your app and grant it permission to read their likes, and
you would need to have valid individual user tokens available for all
of them each time you want to request this data, because “A User or
Page can only query their own likes. Other Users' or Pages' likes are
unavailable due to privacy concerns.”
developers.facebook.com/docs/graph-api/reference/v3.3/object/

Fetching activity feeds of all the users together in a request

I have a facebook application which posts on users activity feed as soon as the user uses my website. I am also trying to show the activity of users' friend on my website. For this , I am fetching back the feeds being posted by my application on facebook for his friends.
However, the problem is , in the first request , I am getting the list of all the friends of the respective user who have installed my application. Once, I get this list, I am able to get his friends, however, only one at a time.
So, if a user has 50 of his friends using my website, it will take 50 request to show him his friends activity. Is there a way in facebook open graph to fetch the list of all feeds of all friends together, or, using least number of requests ?
Please suggest some ways to do the same.
If you are using FQL to grab the data, you can use WHERE uid IN (…,…,…) to select data for more than one user at once.
And with FQL you can do multi-queries, or using the API you can do batch requests; to reduce the number of HTTP requests necessary to get the data.

Performance boost needed - app users fanpage likes check

I have performance issues with my facebook app.
I need to check, if app users friends like an fanpage. But problem is: time.
One query to graph /fanpage_id/members/userId needs ~200ms (my test user have 4 friends, time was 977ms). Customer want at last one check per 24hours(app cache remove event on global.asax works well) for all users BUT.. lets say 500 users and every user have 500 friends * 200ms .. its a lot of time and queries to facebook graph.
Any ideas how improve it ?
Have you tried batch requests?
You should be able to reduce the time by using the ?fields= &fields= parameter and only requesting the id's of friends and id's of like objects.
when you request friends /me/friends?fields=id
http://developers.facebook.com/tools/explorer/?method=GET&path=me%2Ffriends%3Ffields%3Did
foreach id:
when you request likes /id/likes?fields=id
http://developers.facebook.com/tools/explorer/?method=GET&path=me%2Flikes%3Ffields%3Did

limit posts to wall on fb app

I have an fb app connected with my website. it will trigger a post to fb user's wall when he completes a search on my site. Is there anyway to have a limit on the number of posts to the wall? say 1 post per day or 3 posts per week?
Take a look at the Graph API documentation. Basically, Facebook will send you a Graph object for each of the users that log in. You can just keep a table in your DB that maps users to a counter for how many posts you've made to their wall, which you always check before posting to make sure it's not over the limit. When the time period is up, you can just reset the counter.
Here is some example code that will show how to access the Graph object: http://www.devshed.com/c/a/PHP/Facebook-PHP-API-Applications-Working-with-User-Data/

Facebook api get all the messages from a user in a fan page

I need to get all the messages posted by a user in a facebook fan page. (wall posts and also possible comments to other posts).
Is there an easy way to do that?
Right now i might have to get all the posts from a page, filter by user and do the same with comments but if the page has 3k posts and tons of comments that will be very slow.
I think this might be possible with fql but i cant find how to do it?
this documentation from facebook will show you how to query the posts from the users wall - http://developers.facebook.com/docs/reference/fql/stream/
note: The stream table is limited to the last 30 days or 50 posts, whichever is greater.
that takes care of the huge amount of comments!