Facebook API friends work and education recent changes - facebook

Looking at Bright website, I'm trying to figure out how they achieve their Latest Activity pane. Basically, sign in with Facebook on their website gave me all my friends work recent changes, ordered by date. Take a look here to see what I mean:
This is what I've done at this time so far:
Used friends_work_history permission and retrieve work field like /me/friends?fields=name,work with Graph API. While that gives me friends work history as well as their current position, I still can't obtain the date of the latest change of their current work employer.
Looking into the feed object (also using Graph API) as well as the stream object (using this time FQL) of my friends, to see if I could filter work changes. Still no luck. I just can't find any story or activity related to their work.
Now, correct me if I'm wrong, but it seems to me that's rather impossible to obtain such friends work changes with date. In the best world, what we would like to achieve is, when a user uses our website for the first time, and sign in using Facebook, we would like to show them such "Latest Activity" as you can see from the image from Bright.
If that's really not possible, we will forget the idea of seeing an history of the lastest work updates among friends, and we will focus of taking a "snapshot" of the present, and work from there. We could try either:
Using our own tracking system, which will basically consist of pooling the Facebook Graph API at some time during the day to see if we could find any changes in the work history of user's friends.
OR
Maybe use the Real-time Updates service of Facebook https://developers.facebook.com/docs/reference/api/realtime/, which could maybe allow us to track these kind of changes. But the more I think about it, the more I guess it will not work since it will not allow us to track changes on friends work field.
Anyway, maybe someone was able to solve that problem? Thanks in advance!

You should be able to get at this using FQL. I can't find a friend who changed jobs recently, so I can't validate what this should be.
Using something like this:
SELECT post_id, message, type, attribution, description,description_tags FROM stream
WHERE source_id IN (SELECT uid1 FROM friend WHERE uid2 = me()) AND
strpos(description,"added a job") > 0
Should get you those posts. My guess is that these have a unique type value, where you can filter these more efficiently.
Don't forget that the stream table is hobbled to return only the last 30 days worth of posts. You'll need to execute multiple queries to get at any significant history.

Related

How to get facebook friend count and post count?

I tried with graph api explorer to get user count. It work perfectly.
But how to get the total post count using API.
Is there any way to get the user count and post count of a a user using userId?
There is no field or endpoint to get a user’s post count.
(Getting the user’s permission to read their posts, and then paginate through all of them & do the count yourself, might sound possible in theory, but in reality that probably won’t work. You’ll run into the API request limits quickly, plus there’s likely always gonna be some posts your app can’t “see” because of some obscure constellation of privacy settings. Also, from my experience, the API tends to get kinda unreliable, the further you try to go back in time.)

Use Facebook Graph API to Remove Friend Connections

I have a question about weather something is or is not possible with Facebook's API.
Can a server side script have access to a users account and remove a tag associated with another person? Or remove photos that has a particular friend in it (obviously only if the person has been tagged)?
For instance maybe I want to remove all connections I have with another person, can the Facebook API graph allow me to do so if I specify the individual?
I am not looking for how to do so, I am first trying to find out if this is even possible. I have been pouring over documentation but it is something that I do not completely understand and I will not be the one writing code.
Any help or direction will be great, thanks!
No you can't unfriend a person through the API. Even deleting photos is impossible, unless the app created the photos in the first place. There are numerous other threads on SO about this, as well as forums posts about people that have struggled with problems in the recent past. You can't even delete a tag of a photo through the API even though DELETE methods exist in the documentation and indicate that it should work. When making the calls people receive oauth error results, and there is probably still a pending bug report about this behavior, but no expectation that FB plans to fix it anytime soon.
In general they are happy to let you add a lot of content, but they don't want to let you remove it -- and that goes double for the API.

Strategy for efficiently keeping Facebook friend information up to date (that scales)

I've created an application that imports all of your friends and their data. I cache this data and use the cached data when rendering the app so I'm not forced to import from facebook with every load.
I'm hoping that someone can give me a solid strategy for efficiently keeping friend information on my end up to date (or at least up to date within 24 hours)--real-time updates just tells me if the friends collection/object has changed for a user, not which friends, or what pieces of data.
I could, of course, just re-import every users friend data every day, but that seems like a bit of overkill.
I want to be able to:
Check if a new friend has been added (and then import the new friend)
Check if any friends have been removed
Check if any friends have updated their information, along with what information it was that was updated (and then go get the updated information)
Note: The app has thousands of users, and millions of cached friends, so brute forcing it will not scale well
Does anyone have any good information about an effective way of keeping a users friends information up to date without constantly pinging FB to re-import every friend?
Would also be interested in any 3rd party SaaS options for this.
I recently tried to get actually information about user's friends, and I found only one solution - get full data about all friends every time. I do it on client-side in JS, and send result to our server.

facebook api which notifies the unfriend

I am working on some project that needs that when ever a friend of mine unfriends me from his list I gets notified so that I update the list of my friend list, one way of doing it is I can schedule a cron job and that will update my friend list once or twice in a day in my project, but that is not going to be real time, I searched the internet but did not finds any thing in fact may be I am struggling with some different keywords and may be that particular thing is termed differently, please shed some light since I am new in facebook api thing I am struggling with the internet false posts as well.
Thanks in advance
Ankur
As in #Igy's comment, what you are asking for is exactly what Facebook is highlighting as a "Prohibited Functionality":
Revealing Friend Removals
You must not include features or functionality that disregards or circumvents Facebook product
limitations. For example, you must not notify a user if someone
removes the user as a friend because Facebook does not publish this
information to users

Get the date when two users became friends in php

It's possible to get the date when two users first interacted on Facebook? For example: in a comment, photo tags, wall post, etc. I need this for a FB app since isn't possible to get the date when two users became friends.
Any idea of I can get this done?
I'm thinking in merging a lot of fql queries but don't figured how to do this yet. If I want this for all my friends, isn't gonna be too slow?
It is possible now to extract dates from which you became friends with another user on Facebook. Try it via the API Explorer Tool: https://developers.facebook.com/tools/explorer/?method=GET&path=UID%2Fposts%3Flimit%3D25%26until%3D1342599743
No, unfortunately it is not possible with the API for existing friendships.
But you should be able to use the Real-time updates (https://developers.facebook.com/docs/api/realtime) to be notified when they become friends with someone. Currently the documentation say they support the friends user connection.