«

»

Aug 12

Code for Facebook Homepage posted on the Net

facebooklogo.jpgWow – via TechCrunch – someone has posted the source code for Facebook’s home page on blogspot! Nik Cubrilovic, who wrote the post on TechCrunch, says that:

While there is no certain way to verify if the code is actually from Facebook, by taking a quick look through the code and by double-checking some paths that have been referenced, we can say with some certainty that this seems to be both real and also a recent version of the main Facebook page.

Reading through it myself, one thing I find particulary interesting about it, the source for what everyone wants OUT of Facebook – the Feed.

include_once $_SERVER['PHP_ROOT'].’/lib/feed/newsfeed.php’

// lib/display/feed.php has to be declared here for scope issues.
// This keeps display/feed.php cleaner and easier to understand.
include_once $_SERVER['PHP_ROOT'].’/lib/display/feed.php’;

At least it would seem that that is the code that is building the feed.

Also, this appears to be calling the calculation for the “Event Rank” to determine whether items show up in the mini-feed:

feedback_get_event_weights($user, true);

I also find these comments interesting:

// We special case the network not recognized error here, because affil_retval_msg is retarded.
events_check_future_events($user); // make sure big tunas haven’t moved around

Programmers often put comments in their code that are notes explaining the reasons for certain choices etc, we will also sometimes use variable names that are humorous or goofy – if you’re making up variable names all day, it’s sometimes hard to be original or come up with something that makes sense.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>