Name:CrazyIvan

Thursday, April 21, 2005

"Facebook Hack" explained

Wow so there have been 44 searches for facebook hack which have returned this site and somebody actually commented on the post asking how it worked. (a week ago. WHOOPS)
First, I should point out that I didn't discover this , TC did and any and all credit should goto him. (Though it is pretty trivial, so don't get too excited).
Second I should apologize that my template didn't wrap the example url properly, sorry I didn't design the template, blame whomever did.
Third, I should point out that "hack" is being used in the sense of a mildly clever trick. And not in any malicious sense(if you thought that read this and then stop listening to the mainstream media when they talk about things they don't understand.) The search looks like any other to the facebook server.
To do this you need the following things
1)a witty search phrase to amuse people
2). the address of the facebook server for the school of the people you want to return as results
3) the facebook profile id's of the people you want to return as results (they must be from the same school, if anyone knows how to get around that let me know.)
finding 1) is up to you
2 is easy
facebook servers are of the name school.facebook.com
school is generally a standard abbreviation of the school, but some of them are weird. You can find them by going to the main facebook page.
3)To get this, you need to be able to view their profile, which mean either a)you are their friend, b)you goto the same school and their permissions allow you to view it (most people have it set to let anyone from the same school see it) or c) You got an aim profile link for them. If no of there's apply, well IT'S A SOCIAL NETWORK PEOPLE, get creative and you'll figure out a way to get it.
Now that you have that you can build the line.
start with the address for the appropriate school's facebook page
(e.g. http://pitt.thefacebook.com).
Now the script you want to use is search.php. The parameters of the script are passed after a ? and are separated by &. First tell it to do a search like this:
search.php?do_search=1
add the ids of the people you want to return as a search result with ids= separated
by commas :
search.php?do_search=1&ids=14201243,14204552
Finally, add(and this is the funny part) add what you want to show up as the search term as part of summary=. Note that if you want more that one word you need to separate it by %20(the space character):
&summary=Searched%20for%20people%20who%20are%20miserable%20and%20alone
now put all those things together with the facebook url and you're done.
My template won't show the whole thing so here's a link. To get the whole address,right click as choose copy link. Then paste it somewhere and edit it as needed. Leave comments with questions.
Edit: whoops forgot the "the" in the example url
Edit 2: apparently there are some problems with this. I might try and figure it out someday.........
-CI

1 Comments:

Anonymous said...

(and when I say anonymous, I really mean Leland Thorpe)

It turns out you don't need to replace the spaces; I think that happens browser-side. For example, http://pitt.thefacebook.com/search.php?do_search=1&ids=14201243&summary=Searched for Everyones Favorite Cripple works.

It shouldn't be too hard to figure out IDs for any arbitrary person. There must be a way to do it.

As for global search... If you do http://cmu.thefacebook.com/global.php?do_search=1&query=leland+thorpe
that seems to do a global search for the name you provide. Apparently the school name at the beginning of the url is important--the search won't work otherwise. It also seems that the school name at the beginning must match the machine you're logging into. Haven't found a workaround for this, yet. Once again, you can leave a space in the url, and your browser switches it to a plus; for example, "leland thorpe" become "leland+thorpe" and the query works. I haven't figured out how to specify a summary, though; I wonder if that's buried in the do_search parameter. Maybe do_search=2 uses a summary or something.

Possible further hacks: It should be trivially easy to generate a script that reads IDs and summaries from a form and redirects the user to the appropriate URL. If you provide a dropdown list of schools, that would work. A similar thing could be done for the global search. The next step would be figuring out how to get IDs for any person--might be a problem since the Parents_Naming_Children hash has lots of collisions. It would also be cool to figure out how to do summaries with a global search. This last part may not be included in facebook's software, but someone with good web skills could probably work around it. Maybe one could munge the facebook results to get the summary you want.

-Leland
lelandthorpe.com

5:54 AM  

Post a Comment

<< Home