dongzh1988 2013-06-10 13:52
浏览 46
已采纳

使用Oauth通过应用程序凭据从Twitter获取趋势,没有特定的Twitter用户

I'm sorry if this has been asked before but it seems almost all answers on SO are relating to the Twitter API 1.0 and not the newer 1.1 using REST and OAuth.

I need to be able to access the latest twitter trends for specific countries, and for global, so I know our URL (for global in this case) will be:

https://api.twitter.com/1.1/trends/place.json?id=1&exclude=hashtags

... and replacing "1" with location ID's based on Yahoo's WOEID. Pretty straightforward.

Where I'm getting lost is, we want to do this at an application level at a regular interval, for instance get the current trends for Canada every N hours. There wont be a user logged in as this would be a maintenance script called via CRON, so the whole "redirect" process is throwing me off.

How can my application get these trends without requiring specific user authorization to get a "token"?

Or is there a way to create a serialized token from our registered application in twitters API area.... or is this even possible, are we breaking some sort of Terms of Use provision in attempting this?

  • 写回答

1条回答 默认 最新

  • doujiang2812 2013-06-10 15:38
    关注

    Finally came upon what I was looking for, the "Application Only" access is done in quite a different way, I just wasn't searching for the right terms to get what I was looking for, here's the page describing all the steps necessary to get a "Bearer" token which can be used to poll Twitter without any traditional user credentials...

    https://dev.twitter.com/docs/auth/application-only-auth
    

    Hope that helps someone else find it faster.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置