top | item 2897740

Who Does Facebook Think You Are Searching For?

269 points| jkeesh | 14 years ago |thekeesh.com | reply

108 comments

order
[+] kmavm|14 years ago|reply
Hi, my name is Keith Adams, and I worked on Facebook's typeahead. The system has evolved a bit since we launched, but I talked about first_degree.php in the tech talk we did about the typeahead back-end last year:

https://www.facebook.com/video/video.php?v=432864835468

Briefly, first_degree.php returns objects you're directly connected to in the graph, and if there's space a few machine-generated guesses at other good results. We preload these as soon as you focus the "Search" box at the top of the page, in the hopes of having some decent results to show when you start typing. The index field does, as the article inferred, represent our best guess at a ranking function on these first degree objects. The inputs to this ranking function explicitly do not include other users' behavior on the site. I talked a bit about our ranking function in this quora question:

http://www.quora.com/How-does-the-new-Facebook-search-engine...

Edit: To clarify what a lot of people seem to be wondering, visiting someone's profile does not affect the search results of anyone but yourself.

[+] AmericanOP|14 years ago|reply
Keith, I would like a feature to clear my facebook search history/profile view history. I consider it a privacy issue.

The knowledge that anyone who stumbles across my logged-in profile can see who I'm interested in by experimenting in my friend search bar has a chilling effect on the profiles I view. Google and most browsers have a 'clear search history' feature- it would be nice if facebook had the same.

[+] gst|14 years ago|reply
This graph lists people that I do not have "friended" on Facebook, but whose mail address I probably have uploaded via the friend finder in the past.

However, I've removed all imported friend finder contacts on https://www.facebook.com/invite_history.php some weeks ago.

I guess this implies that Facebook does not really remove the imported information, but that it keeps this information and just hides those contacts from you in the friend finder interface.

[+] kshcho|14 years ago|reply
Interesting point - the "friend ranking" numbers are different when I checked Mozilla vs. Chrome.

In Mozilla, the first person ranked was at -6.2650374; on Chrome, it was -7.2581474 (I go back and forth with this person quite a bit). Also, the ranking of some of the people were different.

My guess is something to do with browser cookies or caching - any ideas why this might be the case?

[+] pasbesoin|14 years ago|reply
Keith,

OT, but for the second time this year, someone is newly (just as of today) using one of my secondary Gmail accounts as their FB user ID. They don't appear to have access to the Gmail account -- and I've newly killed any concurrent sessions and then changed its password and security Q/A to be sure. So, I don't know how they're accomplishing this. But that Gmail account received the sign up confirmation messages and is now filling up with friend confirmations.

Any chance you could plug me into someone relevant at FB, as this appears to be a recurring problem without a ready explanation? Email to pasbesoin at that gmail place.

P.S. As best I can determine, my systems are clean, and I've no other problems/compromises that are apparent. There appears to be something borked with the Facebook account creation confirmation process.

[+] coryl|14 years ago|reply
Can other people's interaction on your Facebook user affect their ranking on your list?
[+] modeless|14 years ago|reply
Boy, this would be a great way to hijack Facebook accounts. Just convince a bunch of people to run your bookmarklet on their Facebook profile.
[+] kmavm|14 years ago|reply
Indeed, it is not wise to run third-party bookmarklets while logged into Facebook. This one may be benign, but the next one may not be. If you want to see the JSON we're talking about, just load

https://www.facebook.com/ajax/typeahead/search/first_degree....

with 'userid' replaced with your numeric Facebook account ID.

[+] arjunnarayan|14 years ago|reply
It's javascript. Read the source before running it. The obfuscated gook that's 80% of the script has 0 diffs from jQuery as downloaded at jQuery.com; and the rest of the script is easy to verify in 5 minutes.

It's also a great habit to get into. Reading source code is invaluable in understanding and learning. And it is a skill that can be cultivated just like others. For example, the Prey project is an invaluable piece of software, except it's potentially extremely sensitive. Probably worth reading the source first.

You also start to get very well versed in the "usual way of doing things", especially if it's a language/paradigm you're not programming daily in.

[+] impendia|14 years ago|reply
Out of my top ten, seven are women I have had a crush on at some point. Seems they are on to something...
[+] jefft22|14 years ago|reply
Would it be possible for somebody to create a virus that would grab this file and publish it to people's profiles? I think I'd crawl into a hole and die if my ex girlfriend discovered how highly she ranked...
[+] artvandelay|14 years ago|reply
I've been waiting for the day when something is breached and you can see who's viewed your profile...all hell will break loose
[+] enjo|14 years ago|reply
My wife is ranked really rather low... bad news.
[+] anymoonus|14 years ago|reply
That would require the virus to successfully log in as you, and at that point does it matter?
[+] mrspeaker|14 years ago|reply
This is pretty funny in the ajax code:

    success: function(result) {
        alert('Please try again.');
    },
    error: function(data) {
        var text = data.responseText;
        // ... processes the data here...
    }
Why is success error and error success?
[+] albertsun|14 years ago|reply
I think because the request is asking for content type JSON but the Facebook response comes back as javascript with a for (;;); at the beginning. The content types don't match so jQuery invokes the error callback.
[+] pclark|14 years ago|reply
Looked at mine. First thought: whoa, I hope no one else ever sees this

Facebook you scary.

[+] tuhin|14 years ago|reply
My list is all random. The first entry is my girlfriend, the next though is a random girl from college whose profile I have hardly visited more than say 4-5 times ever on Facebook. Same for others down the list.

So is it something were people are apparently assuming that it is onto something because they can see those 2 names they do not want anyone to know about among the 10 being in the top or is the result for everyone actually correct?

In the case of the latter how is it so random for me? I have Michael Arrington on the top 15 and I swear I do not stalk his profile.

[+] 46284|14 years ago|reply
My roommate is infatuated with this girl he's known since HS. I just ran it on his laptop and she's at -68. Everybody else is above -4.

Can anybody beat that?

[+] seagaia|14 years ago|reply
1. This is very cool 2. This is very scary. Someone hacking me then posting the top 10? Social disaster
[+] jrockway|14 years ago|reply
Why? I don't use Facebook, but visiting people's profiles on social sites doesn't mean much on the other ones. Most of the people I look at on Twitter or Google+ have done something so brazenly spammish that I have to go to their profile to find the "report spam" link or whatever. These people aren't my friends, they're just people that spam me that I want to go away.

Hardly a social disaster.

[+] AdamTReineke|14 years ago|reply
Here's how the top 209 people in the list rank for me (the whole list was too long for me to bother cleaning up at 1:30am). 22 people had rankings of less than zero. http://i.imgur.com/WqcKF.png
[+] user24|14 years ago|reply
Here's a graph of my entire list, annotated with "I don't know this person" and "This person is invited to my wedding".

http://i.imgur.com/zd2Ts.png

Top ten:

1) best man

2) random person who lives in my apartment blocked who I stalked once to get their mail to them

3) Wife-to-be

4) Her sister

5) Good friend of mine from Uni

6) Me

7) Place my wife-to-be volunteers at

8) Another friend from uni

9) Wife-to-be's best friend

10) Someone I know online but not IRL.

[+] kirillzubovsky|14 years ago|reply
Tried browsing through the javascript to see if you're screwing with me somehow ... got too lazy 1/3 way through and decided to trust that as a member of HN community you wouldn't (probably a terrible idea). But yea, the script works ... all too well.
[+] jonah|14 years ago|reply
You can always just use the inspector in your browser to view the original JSON and run it through JSLINT to make it readable. No external script needed. ;)
[+] fecaldog|14 years ago|reply
I might be one of the few here who has a facebook account with 0 friends and never really use it. So the results are very interesting as they contain people who I know but do not interact with. Some of them must be from profile searches I have performed but I cannot explain the others. I am inclined to believe they must be incorporating 'other users behavior on the site'.
[+] mleonhard|14 years ago|reply
If you have folks with non-ASCII names, here's a Python three-liner to convert the output of first_degree.php to a text file:

    with open("first_degree.php.txt", "w") as f:
     for e in json.loads(open("first_degree.php.json","rb").read().replace("for (;;);",""))["payload"]["entries"]:
      f.write(("%s %r\n" % (e['text'],-e['index'])).encode('utf-8'))
[+] markmccraw|14 years ago|reply
I'm curious whether these numbers factor in people who are looking for you/interacting with your profile. My list has some people I don't recognize as well people who I definitely have not clicked anything of recently, which is why it might.
[+] markmccraw|14 years ago|reply
Well I changed my privacy settings to visible to all, made a dummy account and click raped my profile and my dummy account didn't show up. I'll add the accounts as friends and then make note of the number, then do clicking from the dummy and see if it changes. There could be some privacy implications behind the initial coolness of this.

Also, if you make an account and do nothing your value for yourself is 0.939565, which I guess is some sort of baseline of 0 interaction? Although I don't understand how they are modeling your interaction with yourself, tbh.

[+] wtracy|14 years ago|reply
The bottom half of my list consists entirely of people who I didn't recognize at all. All but one of the ones I looked at have at least one mutual friend with me. (Now I'm curious whether Facebook generates some of these entries just by crawling my social graph?)

Also, can anyone share what range of numbers they're seeing? At the very top of my list is one negative number. Beyond that, the top half of my list ranges between 0.1 and 1.0. The last half of the list ranges from 1.0 to 1.2.

[+] follownicholas|14 years ago|reply
I also thought that other people's interactions with me are a part of the algorithm for this same reason. However, the reply by Keith Adams seems to suggest that is not the case, and that they are just "machine generated guesses" which weigh into the algorithm.
[+] jefft22|14 years ago|reply
Part of the algorithm may involve them trying to predict who you will want to add as a friend. People that attended the same events as you, people who have recently added your friends as friends, stuff like that.
[+] AVeljko|14 years ago|reply
I am wondering this too, there are many people in that list which I am not friends with and have only visited their profile once, yet they have a higher score than some of my really close friends.
[+] mikeklaas|14 years ago|reply
The score is probably a measure of mutual information (or some other kind of log prob). That's what usually produces scores distributed like this.
[+] follownicholas|14 years ago|reply
I'm not a frequent Facebook user but I log in at least once a day. The first person on my list is a girl I am dating who is about a -2. I am the second person on my list also at about -2. About 30 more people have a negative number. The remaining people (about 500) are all a positive number. I don't even know who many of the people are at the bottom of my list.

It is interesting to note however that my brother is a frequent Facebook user and his first person on his list ranks at about a -26, and EVERY SINGLE person in his graph is assigned a negative number. Despite this, he still doesn't know who a lot of the people are on the bottom of his list.

Other things I noticed: - Some people that I barely even know but just became friends with are ranking highly on my list. I imagine this is because I probably viewed a bunch of their pictures after being friends, combined with the fact that I don't often view profiles of people I am friends with.

- Some of my more recently added friends have the same exact value.

I wonder how much information could be extracted about the algorithm by creating a dummy community of people and connecting them together, then recording the results. I imagine much of the algorithm could be reverse engineered by this if anybody were up to the task. I will probably work on it if nobody else does and publish my findings.

EDIT: Explained what I was trying to say better, fixed grammar.

[+] NnamdiJr|14 years ago|reply
I think it's a bit funny that with a score of -0.3 I am #2 on my own list (#1 being a girl who's profile I checkout a bit too often), I'm stalking myself??

That said, I've always thought it was strange how FB comes up with the people not only in search but also the ten friends list on the left in profiles, the chat list on the right, and 'people you may know'. I've done a few tests w/ friends regarding the topic, and pretty much what everyone here has guessed seems to be true. There's a very good chance FB factors in people who are looking for you/interacting with your profile (unreciprocated), but of course they won't admit that..

I don't think it's such a big deal in either case. The top Chinese Facebook-like SNS site, http://renren.com/, shows everyone the most recent 9 visitors on a page, and its often used (by would-be stalkers) as a way to overtly show interest "hey, i'm checking you out" kinda deal, or for couples to let each other know they are attentive. Otherwise, its just friends keeping tabs on each other. I'll admit, at first I was weirded out by it, but now it seems almost normal.

I'm probably way out of the norm here, but I honestly wouldn't mind having this in FB.

[+] pharrington|14 years ago|reply
Pretty much exactly what I was going to say about this (I'm #3 on my list). I just posted the article and my top 10 on my wall, tagging everyone in it. Curious as to what the non HN crowd thinks.
[+] erikb|14 years ago|reply
That is really strange to me. Maybe I don't stalk enough or something, but often when I look up a friend (someone who is actually in my friend list and I communicate often with) it seems to be impossible for Facebook to find this guy and I have to go directly to the friendlist search to get this person's profile. Always (or so often that I don't remember the exceptions, which is in usability terms "always") when I use the normal search bar I get people I don't know, have not even indirect relations with or be in any way interested in. Sometimes the names don't even consist of the words I was putting in the search bar. That's why I really wonder why people can think of facebook's people search as something cool or "stealable".
[+] svsaraf|14 years ago|reply
As some have mentioned, doing a couple of tests with dummy accounts seems to indicate that a friend visiting your page can influence your first_degree.php, which would explain why there are a few people who you never stalk who happen to be on your list.
[+] follownicholas|14 years ago|reply
That's a possibility. The post that Keith Adams made however refutes this, but it is still possible that he is wrong/mistaken or that the first_degree.php was changed after he left Facebook.