Friendster is an early social networking site. It's estimated that Friendster has over 115 million registered users. Founded in 2002, Friendster allowed the posting of blogs, photos, shoutouts/comments, and "widgets" of varying quality (not dissimilar to Facebook applications). It is considered one of the earlier social media networks (although it has numerous predecessors dating back for years) and distinguished itself by allowing such "rich media" additions to a user's account. After an initially high ranking and rating in the charts, Friendster's slow decline in hotness ensured an ever-growing chance of being deleted, and on April 25th, 2011, Friendster announced that most of the user-generated content on the site would be removed on May 31st, 2011. Literally terabytes of user-generated content is in danger of being wiped out, and Archive Team has made it a priority to grab as much of Friendster as possible. A unix-based script (called BFF, or Best Friends Forever) has been created and Archive Team is asking for anyone with unix and 100gb of disk space to get involved in the project.

Jonathan Abrams, the original co-founder of Friendster, has wiped his hands of the whole situation, and is mostly frustrated with Friendster's past. [1]

Because Friendster is based on numeric IDs (as opposed to usernames), it is possible to assign "chunks" to Archive Team volunteers. Please read up about the tools below, and if you have an interest in helping, join us at #foreveralone on EFnet and help us save Friendster.

DNS change

On Monday, June 27, friendster switched DNS servers, pointing at their new site. However, the old site and data remain available on the old servers, if you know where to look.

NOTE: It is strongly recommended that you use a local caching DNS server, such as dnscache, dnsmasq, or bind. This reduces the DNS load on your internet connection, allows DNS lookups to resolve faster, and reduces load on the remote server.

dnscache

If you're using the dnscache server from the djbdns package, you can do the following to forward your friendster-related requests (assuming your dnscache configuration is in /etc/dnscache):

Then reload/restart bind. Do a lookup of friendster.com and you should get 209.11.168.113.

hacky simple way

NOTE: This is NOT recommended. It will forward ALL of your DNS lookups to this server, for EVERY request. (linux does not cache results on the local machine by default.)

Add "nameserver 50.17.127.246" to the top of your /etc/resolv.conf file. This will send all lookups to that server first. This server does so recursive requests as well, so you could use it directly if you wanted. (it would potentially slow down all name lookups, however). The better way is to do one of the above. (by default, linux does not cache dns results on the local machine. you may want to install dnscache, change the root/servers/@ file to list your ISP dns servers (or your own local server), and point resolv.conf at 127.0.0.1).

Be aware that with this hacky method, the change could be overwritten the next time your DHCP updates. (You might be able to add the line to a new file named "/etc/resolve.conf.head" to get around this. You might also be able to configure your DHCP client to ignore the servers it got from the DHCP, or place another server before or after it. Another option, in Linuxes that support it, is to "sudo chattr +i /etc/resolv.conf")

Do a lookup of friendster.com. You should get 209.11.168.113.

Tools

friendster-scrape-profile

You need a Friendster account to use this script. (Note: if you are creating an account, mailinator email addresses are blocked) Add your login details to a file username.txt and a password.txt and save those in the directory of the download script.

Run with a numeric profile id of a Friendster user: ./friendster-scrape-profile PROFILE_ID

Currently downloads:

the main profile page (profiles.friendster.com/$PROFILE_ID)

the user's profile image from that page

the list of public albums (www.friendster.com/viewalbums.php?uid=$PROFILE_ID)

each of the album pages (www.friendster.com/viewphotos.php?a=$id&uid=$PROFILE_ID)

the original photos from each album

the list of friends (www.friendster.com/fans.php?uid=$PROFILE_ID)

the shoutoutstream (www.friendster.com/shoutoutstream.php?uid=$PROFILE_ID) and the associated comments

Automating the process

(This is all unix-only; it won't work in Windows.)
1. Create a Friendster account
2. Download the script; name it 'bff.sh'.
3. In the directory that you put the bff.sh, make a username.txt file that has your Friendster e-mail address as the text in it
4. In the directory that you put the bff.sh, make a password.txt file that has your Friendster password as the text in it.
5. Choose your profile range.
6. Edit that section to say what range you'll do.
7. On the command line, type (with your range replacing the '#'s.):

$ for i in {#..#}; do bash bff.sh $i; done

or even better

$ ./bff-thread.sh # #

which will allow you to stop at any time by touching the STOP file.

Advanced: multiple instances

Requirements

Now you might notice it's relatively slow. My average is 115 profiles per hour. The bottleneck is mainly network requests, so running multiple instances can increase your download speed nearly linearly. BUT we're not sure whether it's safe to use the same cookies.txt file for all the instances (which it will do by default). Luckily you can easily avoid this using an extra optional parameter of bff.sh. Just add the name of the cookie file you want it to create and use right after the profile ID, for instance: "bff.sh 4012089 cookie3.txt". Use a different cookie file for each instance.

Manually

The full, modified command would then be (replacing the #'s with your range or the cookie number, where applicable):

$ for i in {#..#}; do bash bff.sh $i cookie#.txt; done

chunky.sh

This is the latest and most sophisticated way to automate this is to run chunky.sh. It breaks the range up into chunks of a thousand profiles, and runs as many of these chunks concurrently as you request. This means that if some chunks contain smaller profiles and therefore download more quickly you don't end up with fewer concurrent downloads than you wanted.

$ ./chunky.sh <start> <end> <threads>

Multiple Instances of chunky.sh

In order to always be downloading at maximum capacity, we're experimenting with an updated chunky.sh that is aware of all BFF download processes on the machine, not just its own. That means that you can start a new range of profiles and the new chunky.sh will patiently wait until it sees an open download slot to take. It hasn't seen a whole lot of testing yet, so use at your own risk and report any problems or possible improvements in #forerveralone. Syntax is the same as the original chunky.sh. View it here or download it here.

snook.sh

The original automated solution was snook.sh. This script takes the start and end of a range and a number of download threads to run and launches that many instances of bff.sh at once. It automatically logs the output to individual log files and creates separate cookies files for them. This script was originally written by underscore; you may have his link to pastebin on the irc channel. I've fixed several bugs, including one very serious one. If you used the version from pastebin, you'll need to start over because it downloaded the wrong profiles (keep what you downloaded, it'll merely overlap with someone else.) If you need to stop the downloads cleanly, simply $ touch STOP.

invoker.pl and summary.pl

Another option is this perl script which does a similar job. It's not thorougly tested yet, but it's pretty simple. It takes the starting ID, the number of IDs per process, the number of processes, then creates a shell script which launches them. It has the bonus of being able to be stopped by using $ touch STOP, and it logs every finished ID from every instance to one file for monitoring. This script will give a quick summary of that file to monitor the processes' progress. (And with touch STOP and the summary file, that means easy management over SSH! Woo!)

XML friend lists

Also on the wiki: a script that uses the Friendster API to download friends lists. This has the advantage that you can get the ids of all friends of a user as one XML file, which is a lot faster than the bff method. See getfriends.sh on Github.

Troubleshooting

If you get an error like bff.sh: line 26: $'\r': command not found, you will need to convert the script to use UNIX-style line endings:

$ dos2unix bff.sh

or if you somehow find yourself without the dos2unix command, do this:

$ sed "s/\r//" bff.sh > bff-fixed.sh
$ mv bff-fixed.sh bff.sh

Site Organization

Content on Friendster seems to be primarily organized by the id number of the users, which were sequentially assigned starting at 1. This will make it fairly easy for wget to scrape the site and for us to break it up into convenient work units. The main components we need to scrape are the profile pages, photo albums and blogs, but there may be others. More research is needed

Profiles

Urls of the form 'http://profiles.friendster.com/<userid>'. Many pictures on these pages are hosted on urls that look like 'http://photos-p.friendster.com/photos/<lk>/<ji>/nnnnnijkl/<imageid>.jpg', but these folders aren't browsable directly. Profiles will not be easy to scrape with wget.

Photo Albums

A user's photo albums are at urls that look like 'http://www.friendster.com/viewalbums.php?uid=<userid>' with individual albums at 'http://www.friendster.com/viewphotos.php?a=<album id>&uid=<userid>'. It appears that the individual photo pages use javascript to load the images, so they will be very hard to scrape.

On the individual album pages, the photo thumbnails are stored under similar paths as the main images.
i.e. if the album thumb is at http://photos-p.friendster.com/photos/<lk>/<ji>/nnnnnijkl/<imageid>m.jpg, just drop the final 'm' to get the main photo (or replace it with a 't' to get an even tinier version).

Blogs

Blogs are hosted by a wordpress install, typically at (somename).blog.friendster.com for the actual blog pages, with images hosted on (somename).blogs.friendster.com, where that name is the same, and picked by the user.

We recommend claiming 100k at a time, because that keeps things neat and tidy, both in this table and on your computer. However, it seems that the number of photographs per profile increased quite a bit during the early years, so the later profiles are much larger than the older ones. Feel free to claim a smaller block if it'll help. 100GB should hold about 50,000 ids and only take a couple of days to download.

Proposal: sampling

It is growing increasingly likely that we won't get it all by the 31st. Given that, perhaps we should be sampling new ranges from across the total index, in order to capture a better picture of what Friendster was like across its history.

Here are eleven proposed ranges to start, ranked by priority:

Start

End

Priority

20,000,000

20,099,999

5

30,000,000

30,099,999

9

40,000,000

40,099,999

3

50,000,000

50,099,999

6

60,000,000

60,099,999

10

70,000,000

70,099,999

2

80,000,000

80,099,999

7

90,000,000

90,099,999

11

100,000,000

100,099,999

4

110,000,000

110,099,999

8

124,100,000

124,138,261

1

...and here they are sorted by priority. If you want to do one of these ranges, you would still add an entry for it in the main table above.

Start

End

Priority

124,100,000

124,138,261

1

claimed

70,000,000

70,099,999

2

claimed

40,000,000

40,099,999

3

claimed

100,000,000

100,099,999

4

claimed

20,000,000

20,099,999

5

claimed

50,000,000

50,099,999

6

claimed

80,000,000

80,099,999

7

claimed

110,000,000

110,099,999

8

claimed

30,000,000

30,099,999

9

claimed

60,000,000

60,099,999

10

claimed

90,000,000

90,099,999

11

claimed

Proposal: download some groups

It might be interesting to download at least part of the Friendster groups. The bigger groups often have forums, photos and announcements. This table lists the number of groups with 100 members or more. If you are interested, claim a category.

Note: it seems that Friendster's group browser is now broken, which means that it can't be used to find more large groups from the larger categories. The incomplete id lists for these categories are in the Github repository.

Profiles with more than one shoutout page, retrieved with bff.sh < v12

Only first page of shoutoutstream

Redownload profiles that have a file shoutout_2.html

Groups retrieved with bgf.sh < v4

Missing bulletins

Run fix-bgf-bulletins.sh to redownload

Running on Mac OS X

Summary: To run on Mac OS X 10.5 (Leopard), 10.6 (Snow Leopard), or 10.6 Server, you need to install wget, bash 4.0+, and a more recent expr.

Description: In MacPorts, this can be done through installing packages wget, bash, and coreutils (for gexpr), then changeing the top lines in all .sh files from the ArchiveTeam-friendster-scrape git package to !#/opt/local/bin/bash , and replacing all instances of 'expr' with 'gexpr'. Then run chunky.sh as normal on a range and declare victory.

Problem Details: All this is done to work around these three problems:

More on the missing image problem

We've just discovered the versions of bff.sh that we've been using don't grab the right things on some systems. Specifically, we know that older versions of grep (i.e. 2.5.4) don't match some urls as intended. To test whether your files have been downloading correctly, run ./bff.sh 115288. If you end up with one .jpg instead of 8 (here is what you should end up with), you need to upgrade your version of bff.sh before continuing. The current version solves the issue. We're figuring out what to do about the already-downloaded stuff.

More on the shoutout page problem

There was an error in the section downloading the shoutoutstream pages, (bff.sh versions < 12). For profiles with more than one shoutoutstream page, the first page was downloaded several times. shoutout_1.html, shoutout_2.html etc. all contained the first page of messages. This problem was fixed in the version 12 of the script.

This only affects profiles with more than one shoutout page. This is a small percentage of the profiles (7 out of the 50,000 profiles in my collection). They can be found by looking for shoutout_2.html. Remove the profiles that have this file and run the script again.

Blogs with bad links

Some blogs have bad links that expand into an infinite tree. The latest version of bff.sh ameliorates this problem by limiting recursion depth to 20, but in some cases that can still be too much.

CEO's "Friendster re-launching" message

Date: Fri, 1 Jul 2011 06:28:28 -0700 (PDT)

Dear fellow Friendster members,
As many of you may know, Friendster announced that it is re-launching itself as
a social gaming portal and launched a beta version of the new Friendster a
couple of weeks ago. The beta version was well received. I am pleased to
announce that the new Friendster is going live thereby enabling all our users to
login to the new Friendster using your existing Friendster username and
password.
Friendster has touched the lives of many. Since MOL, the company I founded
acquired Friendster in early last year; many people have come up to me to tell
me how Friendster has changed their lives. Many have told me that they have
found their life partners over Friendster. Just last week, a successful Internet
entrepreneur in Singapore told me that her success was triggered by promoting
her business on Friendster. Friendster pioneered social networking and ignited
the social media industry that has created billion dollar companies such as
Facebook and Twitter, companies that may not have existed in their present form
if not for Friendster's early innovation.
Today, Friendster is in a unique position to take advantage on the growth of
social gaming. Through its relationship with MOL, which has a 10 year history in
working with gaming companies, Friendster has both the experience and track
record to make innovations in this space.
Today, as Friendster reinvents itself as a social gaming destination that
enables its users to create multiple avatars, play games and enjoy rewards; I
hope that all of you will wish us luck and continue to support us in our new
reincarnation. The new Friendster is not perfect and we will continue to add new
games and features such as localization and rewards over the next few months.
Our team is working hard on adding these features and welcomes your suggestions
and comments on how we can better serve your needs as a social gaming and
entertainment destination.
I would like to take this opportunity to thank all of you for your support and
hope that all of you will enjoy the new Friendster as Friendster continues to
innovate to serve and entertain you better.
Yours truly,
Ganesh Kumar Bangah
Chief Executive Officer
ceo@friendster.com

New friendster answer about old data

In the New Friendster's help pages, there is a question about data from the old friendster. Here is the question and answer:

4.9. Where did the photos, blogs, comments, testimonials and all the other content in my old Friendster profile go?

As part of the reformat of the site, we had to remove some of the content of your profile including the photo albums, blogs and most parts of the profile like the "more about " info, comments and the testimonials.