tags:

views:

401

answers:

3

Alright, I fear I may be critiqued for this not being so much of a "programming" question, but I'll ask anyway. I don't do to much in web development-type stuff (OO is what I stick with mostly), so I'm not too keen on exactly how all this CSS, Javascript, SQL, etc works.

The problem: My friend has been trying to quit smoking for a while, but as many smokers do, he seems to only make it so far. He recently posted a status update saying if he had the moral support, he could do it. I simple want to create a link to the "Like" button. I then intend to write a script and simple message all his friends with the link. Is this possible?

Any tips in the right direction would be greatly appreciated. An explanation of how to do this would be divine. An explanation of why I can't do this would be met with a scowling acceptance and a thank-you.

For those who don't have a facebook, here are some pastebins. Anything else you need I'll try to supply

Pastebin of a my facebook.com/homepage page source: http://paste.uni.cc/19860

Pastebin of his homepage as I see it page source: http://paste.uni.cc/19860

His update to ctrl+F and see surrounding code: "would quit smoking if he had the moral support."

Thing that looks to me like the css code for the "like" command http://static.ak.fbcdn.net/rsrc.php/z2FUI/l/8fkujrwg/en_US/151675/css/like/like.css

Will this stop him from smoking? Most likely not, but it can't hurt. Worst case he'll just get a laugh and maybe feel a bit more inclined to drop the cigs.

Appreciate it as always.

+1  A: 

Why not write a Facebook application and plug directly into your own profile. You could invite his friends to your application, which would allow them to support your friend's attempt to quit smoking without having to hack together a script that "clicks" the Like link. The hack could easily be considered malicious.

Robert S.
Interesting...this is kind of cool. Do facebook applications have to go through some sort of approval phase? Could this be something I could string together in a couple hours or would it turn into a project?
Chad
rather a project!
tharkun
@tharkun I'm looking at the getting started page for facebook developers and there doesn't appear to be an approval phase. What in particular would be so time consuming?
Chad
I just don't think you'll get it together in a couple of hours but maybe I'm wrong. I checked that page a while ago. They don't speak about approval but I doubt they don't do any checks. But I thought more about the server env you need.
tharkun
+3  A: 

The "Like link" is a Javascript-backed element which invokes an AJAX call to the server. It carries a unique ID which is keyed off both the item being "liked" and the user who pulled down the page (in this case, you) to ensure duplicate "likes" are not accidentally submitted and the UI to become out of sync with the DB; and to ensure you can't "like" something on another user's behalf. The case you are describing is indiscernible from a malicious attempt at doing the same thing.

Can you just send them a message with a link to the friend's page and tell them to "Like" the status themselves?

Rex M
yes, a little bit of enthusiasm can sometimes be more effective than a lot of programming skills! :)
tharkun
A: 

If Facebook Dev was as well documented as, say, PHP or other languages, you could do this in a couple hours... instead you would spend at least that much time just searching google and what little docs there are on Facebook's site. I have one app up and running and another in development and I have probably spent 4/1 hours searching for documentation vs. programming.

Michael