AppleScript and Facebook

Hey, does anyone know of any resources I can peruse to help me write Applescripts for doing stuff on Facebook?

I’d like to be able to login on through cURL, get info, and then copy and paste it into a text editor. Just want to save me a lot of time beforehand if logging onto facebook isn’t possible through cURL. Anyone know?

Your issue isn’t going to be hitting the various pages - that’s trivial. The issue is going to be capturing the cookies that are returned from the login form processor and including those in subsequent requests to the site.

Curl handles this via the -c and -b switches - -c tells curl to save any cookies into a specified file and -b tells curl to read that file and include the cookie contents on subsequent hits.

So now all you have to work out is how to submit the appropriate form parameters to login. A look at the login page should help along with either the -d (data) or -F (form) switches in curl to include the relevant data.

allright, I’m able to login now onto facebook using curl. but I can’t figure out how to do anything after that. lets say I want to search for friends, I have to load a new url and have cURL remember the cookies and password from the previous command. Any ideas?

Here’s what I have

do shell script "curl -v -k -d email='" & facebookUsername & "' -d pass='" & facebookPassword & "' -d login=Login -L '' -A 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20090824 Firefox/3.5.3 GTB5' --cookie-jar /fb_cookies.txt"

wipes dust off post

It’s impossible. :stuck_out_tongue:

This can be done fairly easily with iMacros.