Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs使用OAuth访问最新tweet_Angularjs_Twitter_Oauth - Fatal编程技术网

Angularjs使用OAuth访问最新tweet

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和twitter设置身份验证时遇到了很多麻烦 到目前为止,我已经按照OAuth.io网站上的所有说明设置了一个twitter开发帐户和我的OAuth.io帐户 然而,当我尝试实现他们建议使用的代码时,我得到一个非常快速的弹出窗口,然后它立即关闭

      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并返回该信息