2009-09-03. I was looking at the code again after briefly discussing a similar project with Tommy, and realized that Facebook can still do pictures the way I had it set up before. The code needed some altering but is generally functional again. It could use some more cleaning. Revised Link at the bottom or Here.
I started a little script awhile ago as a means of spidering photos for Facebook. I might refer to it as FS, Facebook Spider, or perhaps FSP, Facebook Spider for Photos. It is written in Python.
Since I originally assembled the script, Facebook has changed its layout a decent amount, but with some tweaking the script still works.
The program is far from perfect and serves as much as a proof of concept for my own self as anything else. It is single threaded and searches through photos in order, similar to how a human would look through them, which is important because Facebook at times has ended the connection, which I can only assume to be by trying to do too much in too little time. Additionally, the searching might be more efficient if it were done using regular expressions, but should be functional how it is. At least, until Facebook reworks its site again just to throw things slightly off.
It functions by logging in as an end user and therefore only has access to the same photos that that user would be able to access.Its use is relatively simple and interactive — just login as it prompts and enter the person you wish to search for, or 0 if you just wish to search for yourself and 1 to exit.
I do not plan on releasing binaries, just the source which will be released under GPL V2.0. I hope that someone else just finds this as an interesting project and maybe thinks of interesting add ons or neat tricks and let me know 🙂
Here is the source
5 thoughts on “Facebook Spider”
Apparently facebook has changed something about how the photo page is displayed, I edited the script so that it finds the picture correctly starting at line 126:
picPage = picResponse.read()
# print “picURL: ” + picUrl
picPage = picPage[picPage.find(‘id=”myphotolink”><img src=”‘):]
picPage = picPage[picPage.find(“http://photos”):]
picPage = picPage[:picPage.find(‘”‘)]
# print “picPage: ” + picPage
Ah, it appears that if you have the developer package or perhaps other applications for facebook that the script might not work properly. (I don’t have any..)
Good eye Tommy for figuring that out. I updated the linked source.
Hi Sean The link to your source code for Facebook Spider doesn’t work anymore!
Adam, glad you’re interested. This code is several years out of date (an eternity by Facebook’s standards). Though I know of no reason a similar approach couldn’t be taken today.
You might be interested in Tommy’s similar project: https://code.google.com/p/photograbber/
However, I have made the links work again, thanks for pointing out that it wasn’t before!