
Facebook Code Details "Ordered Friends" - derpenxyne
Right click anywhere on a Facebook page, click “View page source”, Ctrl+F “orderedfriends”, copy the first number below and add it to the end of “facebook.com/”. This makes me wonder what the meaning of these numbers is and why are they referred to as "ordered friends". Ideas?
======
thisismyname34
Thought everyone might be interested in this - I did a little exploring
(because it beats studying for exams). To the left of that list in the source
code, there is a list called "privacyData" and after it is another string of
user IDs, not coincidentally, all my friends (family members) I have blocked
from chatting me or interacting. These ID numbers are listed as
"13656xxxxx":-1, presumably assigning them a value of -1 each.

This suggests to me that the magic algorithm is assigning users a value from
-1 to 1, with the more positive ones more likely to appear in chat. Between
the privacy list and initial chat friends is this string of code:
"ordered_list.available_target":0.85,"ordered_list.top_friends":5,"sidebar.min_friends":7"

This suggests to me that it's (1) searching for friends that have a value
higher than .85, (2) always placing the top 5 friends from your
initialchatfriendslist in your top half chat sidebar, and (3) always keeping
at least 7 friends above the fold in the chat sidebar.

Finally, there's an input for "sound.enabled: true". Interestingly, after I
turned chat sounds off, logged out and logged back in, it had not updated to
"false" yet. This suggests to me that by monitoring when that flips, we can
figure out how often the initialchatfriendslist is updated.

~~~
Kilbourn
Yep, spot on. I had no -1s, then I blocked someone and they showed up.

Interestingly enough, under advanced options, you can also set it so ONLY
certain people show up. I keep a list of girls I'm hitting on and sometimes
only select them to chat with. Imagine my confusion when these were the only
profiles listed under PrivacyData ;)

------
MeowWoem
I don't view my number 3, like at all, even from the start of facebook, but
she is my best friend and I'm on there like.. once every two months but
there's this boy who is number 8 on mine and I view his more than once a day
so he should be in my top 5. My number 2, I don't view that often but I know
he has a huge thing for me, so I believe it is by most times they have viewed
your page. My number one is my best friend and I know he views my page more
than once a day because he told me so. So that is the only way I can think of
how this works.. I'll just add a few more reasons in case you're wondering ~A
boy who has recently started to like me, moved from 40 something to 20
something, and I don't view his page. ~Most people have stayed around the
same, when ever I check, besides a few people ~A boy who I started to hangout
with a lot, moved from 15 to 8. ~My top three are my best friends. ~I don't
chat with my top ten the most, even from the start of facebook. ~my
orderedfriends are not in alphabetical order. MUST BE STALKERS! ONLY
EXPLANATION!

~~~
mrpirkeyman44
I would think that it's based on who views your profile/pictures/friends,
etc... but nothing to do with you viewing their profiles. So I would think.
And I don't think its anything to do with chatting or liking posts.

------
suzi
I tried this today for the first time. I think the list is who views my
profile, in descending order. I have been on fb for 5 years, and I use chat
approx one time/year. So this list is not related to "chat" interactions for
me. I have 400+ friends.

My #1 & #2 are my daughters with whom interact often and both ways. Next #3 is
a friend whom I rarely view, but she often comments and likes my stuff, so I
know she views me. #4 is my brother whom I do view often. #5 is literally an
old almost-married-him boyfriend with whom I have occassionally messaged in
the past about reunion stuff, but nothing except messaging and I only view his
wall 2ce/year. #6 & #7 are nice people who kinda bore me but for some reason I
fascinate them, (sounds arrogant but that's the short explanation), so it
totally makes sense they view me; I never view them. The next 10 or so include
some people I view and interact with, but also an equal number of people I
rarely eventhink about.

------
thisismyname34
IMO, it's not about about being related to chat messages or not related. It's
definitely related. The #1 on my list has moved up to that spot recently,
while our chatting has increased and interactions have decreased. There is
some formula that we don't know and likely won't ever know. My guess would
either be by what percentage of our messages/likes/interactions go to certain
people or giving different actions relative weights (e.g. 50 chat messages = a
post on someone's wall) and then that list is ranked according to some raw
score.

I maintain, as I said below, that the users are assigned values from -1 to 1
with our various interactions factoring into that. The jackpot question people
seem to want to answer is whether it's a one-sided statistic or two-sided.

~~~
Apothem
According to some research, it seems it only takes into account who would be
viewing your profile. People I've tested this with say they would check
someone's profile non-stop daily but would have them on that list all the way
down to #10 or so.

I think a problem is also trying to create a reference for this. Like how
often they view it or how much is needed to get to the top spot. How many
times does the top person interact with our profile? Because realistically, it
could be anything without a reference.

Also, did you get any more info on when it updates?

~~~
thisismyname34
I've been keeping an eye on the sound thing and it has not changed. However,
in hindsight I think I looked at the wrong section of code for what I thought
I was looking for. In another section, there is this string:

"<li class="uiMenuItem uiMenuItemCheckbox uiSelectorOption" data-label="Chat
Sounds"><a class="itemAnchor" role="menuitemcheckbox" tabindex="0" href="#"
aria-checked="false">"

That corresponds to the setting Chat Sounds in the menu with the gear on the
chat sidebar. Mine is turned off currently, but I will turn it on and refresh
the page source to see if it changes.

------
kayeya
I don't know if the list shows who your bigger stalker is, but rather more
like who you interact with frequently. Not sure how it's ordered but it makes
sense and shouldn't come as much surprise, since it's basically your buddy
list on chat.

Technically, it has to do with the chat sidebar and who's in your buddy list.
It's within the bracketed section of code entitled, "ChatConfigInitialData."
Also, the little piece of code next to that list is
"require"[["ChatSidebar","init"

I signed out of chat and the list of people grayed out on my offline chat list
were all the top users. Just food for thought.

------
owenfi
Interesting list.

Looks pretty clear to me that it is sorted by "most interactions with"
descending for some value of "interaction" and probably on some recent time
window. (I know I send lots of messages to my podcast cohost and brother via
facebook and they are my first two respectively.)

Facebook frequently recommends I add Adam (cohost) as a "Close Friend" (which
is internal, not some app) whereas my brother already is, so that feature
seems to be derived off this list.

~~~
derpenxyne
Facebook uses an algorithm called Edgerank, to rank your friends by how much
you interact with them, in order to give you better search results and filter
your News Feed. The code appears to reveal one part of Facebook's EdgeRank. It
seems like they order it based on who you interact with, whose profile you
look at and who you have recently become friends with.

~~~
katantonio
I dont think this is based on interactions. My top person is my boyfriend, and
he rarely comments/likes on my profile, but he does check it everyday.

www.katantonio.com

~~~
ricardo_a
but do you chat a lot on the facebook with him?

~~~
goldstar32
going to reply to this thread bc i had the same result. boyfriend with whom i
never interact on fb, and he's first on the list - i keep my chat disabled. my
second is my best friend whose profile i never visit, incidentally - we do
interact. the third was a man who i briefly flirted with but he was (and still
is) taken- we also never interact. i'm inclined to believe that the numbers
are in fact friends who check my profile, in order of frequency. the algorithm
must also update this information every so often. FWIW, i wish this
information weren't out there. we say we want it...

~~~
thisismyname34
Are you in a relationship with him on FB? It seems almost unanimous that
people who report their significant other have them at #1, regardless of the
level of interaction with them. I'm guessing that relationships and family
members listed on Facebook are always at the top. Which makes sense
intuitively if the endgame is predicting who FB thinks you will want to chat
with.

------
rozap
Wrote a selenium thing to go through the list for me. My list wasn't
particularly surprising - it's just the same people that show up on the news
feed. I highly doubt it's influenced much by how much they visit your profile.
It's just who facebook thinks your "best" friends are, based on a number of
factors.

------
lalalalulu
I guess these are stalkers. My #1 is my mom, which I rarely view her profile.
My 3rd is my best friend, but I only visited hers thrice in my lifetime. The
5th, not to mention, i view his profile everyday.... So.... yes, these are
stalkers....

------
guypersonman
it definitely has to be based on profile views or something else, more than
interactions, because a few of my people i never interact with on facebook and
almost never view their profile. but they all do have crushes on me.

------
damepet
When I do this, the ordered friends cannot be found in the source page. Could
it be that Facebook took this out of their source page once people were doing
it? If it makes any difference I am using a MAC

~~~
goldstar32
"InitialChatFriendsList" seems to have replaced "OrderedFriends", though the
list of profiles has remained the same. I imagine Facebook wanted to put to
rest all the speculation re: profile viewers, though I'm inclined to believe
that's at least 80% of what it is. FYI, I keep my chat disabled. So how are
they calculating who am I most likely to chat with in that case?

------
anajuliaaquinoo
[http://www.facebook.com/index.php?stype=lo&amp;lh=Ac_MAQ...](http://www.facebook.com/index.php?stype=lo&amp;lh=Ac_MAQTXxLvN0Xl2&amp;aik=D3NA19LYPhjwMacBmY9x3w)

------
suzi
Question - do you think NON-friends who view my wall etc could appear on this
list, or is it just friends?

------
ehbahd
I can't seem to do this on my mac? Can anyone help?

------
aliriver
What's the number you're supposed to copy?

~~~
katantonio
Check out my instructions: katantonio.com

------
ehbahd
figured it out; it must be done on either google chrome or firefox

