Live data from Hacker News

Using Javascript to Programmatically Untag Facebook Photos?

stackoverflow.com

1–10 of 11 posts

Re: Using Javascript to Programmatically Untag Facebook Photos?

#2
Using Firebug, FireQuery, jQuery no conflict as $jq, from inside a photo page (http://www.facebook.com/photo.php?pid=xxx&id=y) :

  var loc = window.location.href.match(/pid=(\d+)&id=(\d+)/);
  
  var args = {
  	pid: loc[1], // photo ID
  	id: loc[2], // request sender id? photo owner id? not sure, haven't tested, but my user ID worked when trying to remove someone from a photo in my album
  	subject: loc[2], // user ID to remove
  	name: '', // not checked
  	action: 'remove',
  	__a: 1,
  	fb_dtsg: $jq('input[name="fb_dtsg"]').val(),
  	post_form_id: $jq('#post_form_id').val(),
  	post_form_id_source: 'AsyncRequest'
  };
  
  $jq.post('/ajax/photo_tagging_ajax.php', args);
  
It doesn't update the UI. The fb_dtsg and post_form_id are required and seem to be anti-CSRF tokens. Haven't experimented enough to know if they can be reused multiple times.

Re: Using Javascript to Programmatically Untag Facebook Photos?

#3
post #2

Using Firebug, FireQuery, jQuery no conflict as $jq, from inside a photo page ( http://www.facebook.com/photo.php?pid=xxx&id=y ) : var loc = window.location.href.match(/pid=(\d+)&id=(\d+)/); var args = { pid: loc[1], // photo ID id: loc[2], // request sender id? photo owner id? not sure, haven't tested, but my user ID worked when trying to remove someone from a photo in my album subject: loc[2], // user ID to remove…

http://stackoverflow.com/questions/2855288/programmatically-...

I hope this is OK.. I'll delete it if you want. I just have such low Stack Overflow karma and you didn't seem to care.

Re: Using Javascript to Programmatically Untag Facebook Photos?

#4
post #2

Using Firebug, FireQuery, jQuery no conflict as $jq, from inside a photo page ( http://www.facebook.com/photo.php?pid=xxx&id=y ) : var loc = window.location.href.match(/pid=(\d+)&id=(\d+)/); var args = { pid: loc[1], // photo ID id: loc[2], // request sender id? photo owner id? not sure, haven't tested, but my user ID worked when trying to remove someone from a photo in my album subject: loc[2], // user ID to remove…

http://stackoverflow.com/questions/2855288/programmatically-... I hope this is OK.. I'll delete it if you want. I just have such low Stack Overflow karma and you didn't seem to care.

Nah, I don't mind. Hope it helps.

Re: Using Javascript to Programmatically Untag Facebook Photos?

#5
post #2

Using Firebug, FireQuery, jQuery no conflict as $jq, from inside a photo page ( http://www.facebook.com/photo.php?pid=xxx&id=y ) : var loc = window.location.href.match(/pid=(\d+)&id=(\d+)/); var args = { pid: loc[1], // photo ID id: loc[2], // request sender id? photo owner id? not sure, haven't tested, but my user ID worked when trying to remove someone from a photo in my album subject: loc[2], // user ID to remove…

http://stackoverflow.com/questions/2855288/programmatically-... I hope this is OK.. I'll delete it if you want. I just have such low Stack Overflow karma and you didn't seem to care.

[deleted]

Re: Using Javascript to Programmatically Untag Facebook Photos?

#6
post #2

Using Firebug, FireQuery, jQuery no conflict as $jq, from inside a photo page ( http://www.facebook.com/photo.php?pid=xxx&id=y ) : var loc = window.location.href.match(/pid=(\d+)&id=(\d+)/); var args = { pid: loc[1], // photo ID id: loc[2], // request sender id? photo owner id? not sure, haven't tested, but my user ID worked when trying to remove someone from a photo in my album subject: loc[2], // user ID to remove…

that only does the current photo though, right?

Re: Using Javascript to Programmatically Untag Facebook Photos?

#7
post #6
post #2

Using Firebug, FireQuery, jQuery no conflict as $jq, from inside a photo page ( http://www.facebook.com/photo.php?pid=xxx&id=y ) : var loc = window.location.href.match(/pid=(\d+)&id=(\d+)/); var args = { pid: loc[1], // photo ID id: loc[2], // request sender id? photo owner id? not sure, haven't tested, but my user ID worked when trying to remove someone from a photo in my album subject: loc[2], // user ID to remove…

that only does the current photo though, right?

Yeah, that was the context in which the OP was trying to do it. And they're using auth tokens, which, if they're at all competent, cannot be reused to automate it. I'll see what can be done to improve it when I get back home.

Re: Using Javascript to Programmatically Untag Facebook Photos?

#8
By the same token, has anyone noticed how difficult it has become to remove friends? Removing them requires opening each profile one-by-one and looking for a small link at the bottom of the left-most column. Even producing a master list of friends in FB is nearly impossible.

Re: Using Javascript to Programmatically Untag Facebook Photos?

#9
One thing I would love (though Facebook's privacy will NEVER get this lax) would be a script to download and archive everything I've ever been involved with -- every comments thread, every wall correspondence, every private message. This would actually help me towards closing my account (or at least stripping it of all my substantive information and content).

I barely use Facebook anymore: its primary utility for me is mostly to receive and disseminate Event information [1]. But there's still a whole lot of content I'd like to save. Some of the most personally significant correspondences I've ever had are in my Messages Inbox. I'm sure a wider record of my activity from back when Facebook was a major part of my life and my friends' lives will be something to treasure when I'm older (though much of it could have been lost in others' content purges). In fact, I guarantee that in 5-10 years, if you can offer somebody back their old information, especially if you can serve it up in a contemporary interface, you will make a fortune, privacy be damned.

---

[1] Its secondary utility is to mindlessly dump links every once in a while, and its tertiary utility is to troll the shit out of people I shouldn't even have on there in the first place (from back in the early, exuberant days, when people added everybody they said two words to at a party).

Re: Using Javascript to Programmatically Untag Facebook Photos?

#10
post #2

Using Firebug, FireQuery, jQuery no conflict as $jq, from inside a photo page ( http://www.facebook.com/photo.php?pid=xxx&id=y ) : var loc = window.location.href.match(/pid=(\d+)&id=(\d+)/); var args = { pid: loc[1], // photo ID id: loc[2], // request sender id? photo owner id? not sure, haven't tested, but my user ID worked when trying to remove someone from a photo in my album subject: loc[2], // user ID to remove…

DCoder, I posted the original question on Stack-O. It's sending a request and getting 200 OK but is not actually removing the tag. Have you gotten it to actually work?
Post reply on HN