Angularjs使用OAuth访问最新tweet
我正在尝试在我当前的应用程序中,在名称旁边添加一条用户最近的推文。然而,我在使用OAuth和twitter设置身份验证时遇到了很多麻烦 到目前为止,我已经按照OAuth.io网站上的所有说明设置了一个twitter开发帐户和我的OAuth.io帐户 然而,当我尝试实现他们建议使用的代码时,我得到一个非常快速的弹出窗口,然后它立即关闭Angularjs使用OAuth访问最新tweet,angularjs,twitter,oauth,Angularjs,Twitter,Oauth,我正在尝试在我当前的应用程序中,在名称旁边添加一条用户最近的推文。然而,我在使用OAuth和twitter设置身份验证时遇到了很多麻烦 到目前为止,我已经按照OAuth.io网站上的所有说明设置了一个twitter开发帐户和我的OAuth.io帐户 然而,当我尝试实现他们建议使用的代码时,我得到一个非常快速的弹出窗口,然后它立即关闭 OAuth.initialize('SYd6rvZZTLQT-oJxWOeNctFuUyA'); //Using popup OAuth.popup('
OAuth.initialize('SYd6rvZZTLQT-oJxWOeNctFuUyA');
//Using popup
OAuth.popup('twitter', function(error, result) {
//handle error with errorconsole.log
result.get('/1.1/account/verify_credentials.json')
(" " + JSON.stringify(result, null, 2));
//use result.access_token in your API request
(" " + JSON.stringify(error, null, 2));
});
有什么建议吗
理想情况下,我只需要使用这个jsfiddle
但是由于它使用了把手,我迷路了。我很傻,而且搞砸了
$scope.twitter = function (){
OAuth.initialize('SYd6rvZZTLQT-oJxWOeNctFuUyA');
//Using popup (option 1)
OAuth.popup('twitter', function(error, result) {
//handle error with errorconsole.log
// result.get('/1.1/account/verify_credentials.json')
(" " + JSON.stringify(result, null, 2));
//use result.access_token in your API request
(" " + JSON.stringify(error, null, 2));
if (error) return alert(error);
});}
工作正常,但我现在很难理解如何获取个人twitter帐户的最新推文。如何查询twitter api并返回该信息