我正在尝试编写一个简单的Javascript页面,使用Hello.js发送带有图片的tweet。我使用了这个演示作为起点,但是很多内容并没有得到真正的解释。我的直觉是这样的:
hello.init({
'twitter' : '****'
});它说,这里需要“在OAuth代理服务上注册您的client_id + client_secret”。但我该怎么做?我的应用程序的Twitter页面显示:
https://auth-server.herokuapp.com/的注册要求:
我该把这些设置成什么?引用和域必须在我的代码中匹配吗?client_id和client_secret是使用者还是访问令牌参数?
发布于 2015-02-15 17:08:07
引用是网络名称,如"twitter“、"dropbox”等。
域是您调用的域。它可以与"http://localhost:8080“这样的东西一起工作。
对于Twitter来说,client_id是消费者密钥(API密钥),client_secret是消费者秘密(API秘密)。
一旦完成,您只需在JS代码中添加如下内容:
hello.init({
twitter: '<your Consumer Key>'
}, {});然后,具有以下代码的按钮应该可以工作:
<button onclick="hello( 'twitter' ).login()">Login with Twitter</button>发布于 2015-03-19 19:56:01
我在hello.js和推特上遇到了很多问题,直到我终于发现:
-Within相同的设置,确保您选择“允许应用程序与twitter注册”。
-Your init函数应该如下所示:
hello.init({
twitter : 'xxxxxx'
},{redirect_uri : 'localhost',
oauth_proxy : 'https://auth-server.herokuapp.com',
oauth_version: 'xx' // probably 1.0a with hello.js
});https://stackoverflow.com/questions/27642695
复制相似问题