向 Twitter 发布消息后的回调

发布于 2024-12-05 17:04:20 字数 277 浏览 1 评论 0原文

我通过链接向推特发布消息: http://twitter.com/intent/tweet?source=webclient&text=Hello

我感兴趣的是,在发布消息后是否可以重定向到某个网址?例如,Facebook 在 URL 中添加了“redirect_uri”参数。消息发布到墙上后,用户将被重定向到此 URL。

I am posting messgae to twiter via link:
http://twitter.com/intent/tweet?source=webclient&text=Hello

I am interested in if it is possible to be redirected to some url after posting message? For example Facebook has "redirect_uri" parameter added to the URL. User is redirected to this URL after the meesage is posted on the wall.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

看透却不说透 2024-12-12 17:04:21

您可以使用 Web Intents 的事件绑定在发推后重定向到 URL。

window.twttr = (function (d,s,id) {
  var t, js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
  js.src="https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);
  return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
}(document, "script", "twitter-wjs"));
twttr.ready(function (twttr) {
twttr.events.bind('tweet', function (event) { //redirect to your url  } );
});

以下链接可能会有所帮助:

https://dev.twitter.com/docs/intents/events#事件

https://dev.twitter.com/discussions/671

You can use events binding for Web Intents to redirect to a url after tweeting.

window.twttr = (function (d,s,id) {
  var t, js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
  js.src="https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);
  return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
}(document, "script", "twitter-wjs"));
twttr.ready(function (twttr) {
twttr.events.bind('tweet', function (event) { //redirect to your url  } );
});

Following links might help :

https://dev.twitter.com/docs/intents/events#events

https://dev.twitter.com/discussions/671

故事↓在人 2024-12-12 17:04:21

根据 文档,推文 Web 意图没有允许用户在发布推文后返回您的网站。

我见过的大多数网站都会在弹出窗口中呈现网络意图,而不是让用户离开他们的网站。

According to the documentation, the tweet web intent does not have a parameter that allows the user to return to your website after the tweet is posted.

Most websites that I've seen present the web intent in a popup instead of sending the user away from their site.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文