【问题标题】:How can I send a Twitter direct message from a Google Chrome extension?如何从 Google Chrome 扩展程序发送 Twitter 直接消息?
【发布时间】:2013-07-29 08:45:38
【问题描述】:

我想从我的 Google Chrome 扩展程序的后台页面发送直接消息。

我阅读了 twitter 文档,但似乎没有一个简单的解决方案。

以前有人这样做过吗?到目前为止,我已尝试使用此 API https://dev.twitter.com/docs/api/1.1/post/direct_messages/new 使用 AJAX 调用发送消息,但出现错误 400。

$.ajax({
  type: "POST",
  url: "https://api.twitter.com/1.1/direct_messages/new.json",
  data: {'text': 'Hello World', 'screen_name':'John'}
}).done(function( res) {
    console.log(res);
});

【问题讨论】:

    标签: javascript jquery google-chrome-extension twitter


    【解决方案1】:

    Twitter REST API v1.1 需要身份验证

    有一个有用的库列表here你可以使用

    this is a really useful Twitter proxy script,只需将令牌和访问密钥替换为您的应用程序的令牌和访问密钥,并将所有请求路由到它 - 但是我没有将它用于 POST 请求

    【讨论】:

      猜你喜欢
      • 2012-08-16
      • 1970-01-01
      • 2021-11-22
      • 1970-01-01
      • 2023-03-22
      • 1970-01-01
      • 1970-01-01
      • 2011-05-08
      • 2012-07-10
      相关资源
      最近更新 更多