编程取消标记FB照片使用Javascript [英] Programmatically Untag FB Photos with Javascript

查看:185
本文介绍了编程取消标记FB照片使用Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经花了过去一小时劈砍而去这个:我想写一个Javscript程序以编程方式从Facebook上的照片取消标记自己。一旦它的工作原理,我将运行在Firebug控制台,并取消标记自己来自Facebook的照片(有没有办法通过GUI来做到这一点)。

I've spent the past hour hacking away at this: I want to write a Javscript routine to programatically untag myself from photos on Facebook. Once it works, I'll run it in the Firebug console and untag myself from all Facebook photos (there's no way to do this through the GUI).

我想看看你们有一些建议,让我对我的旅程。

I wanted to see if you guys had some advice to get me on my journey.

我有几个方法,在脑海,但还没有碰到过远相处得还。我已经试过了AJAX方法通过创建一个新的HTML请求,并将其指向remove_tag URL,它看起来是这样的:

I have a few methods in mind but haven't come too far along quite yet. I've tried an AJAX approach by creating a new HTML request and pointing it to the remove_tag URL, which looks something like this:

/ajax/photo_tagging_ajax.php?pid=(PICTURE_ID)&id=(PICTURE_OWNER_ID)&subject=(SOMETHING)&name=(YOUR+NAME)&action=remove

/ajax/photo_tagging_ajax.php?pid=(PICTURE_ID)&id=(PICTURE_OWNER_ID)&subject=(SOMETHING)&name=(YOUR+NAME)&action=remove

毫无疑问,这不工作(还)。我一直在检查萤火虫的HTTP响应,它比一个完全不同的,当我真正取消标记的图片。它甚至不是发送POST请求。

Not surprisingly, this doesn't work (yet). I've been checking the HTTP response in Firebug and it's quite different than the one when I actually untag a picture. It's not even sending a POST request.

只是为了澄清,我也试着在删除标签主播做的getElementById,然后做一个document.location switcharoo,但不起作用。我也不能在上面做了。点击()。

Just to clarify, I've also tried doing a getElementById on the "remove tag" anchor, and then doing a document.location switcharoo, but that doesn't work. I also can't do a .click() on it.

请问这甚至有可能还是我在做梦? (这几乎是凌晨4点)

Will this even be possible or am I dreaming? (it's almost 4AM)

推荐答案

由于我不知道你是否拿起我的更新版本HN:

Since I'm not sure if you picked up my updated version at HN:

  var loc = window.location.href.split('?')[1].split('#')[0].split('&');
  var qs = {};
  $jq.each(loc, function(ix, el) {
   var m = el.split('='), k = m[0], v = m[1];
   qs[k] = v;
  });

  var args = {
    pid: qs.pid, // photo ID
    id: qs.id, // photo owner ID
    subject: Env.user, // user ID to remove
    name: '', // not checked
    action: 'remove',
    __a: 1,
    fb_dtsg: Env.fb_dtsg,
    post_form_id: Env.post_form_id,
    post_form_id_source: 'AsyncRequest'
  };

  $jq.post('/ajax/photo_tagging_ajax.php', args);

这篇关于编程取消标记FB照片使用Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆