Heim  >  Artikel  >  Backend-Entwicklung  >  我想写一个自动发微博程序,但是模拟授权的代码不太会写

我想写一个自动发微博程序,但是模拟授权的代码不太会写

WBOY
WBOYOriginal
2016-06-23 14:05:521041Durchsuche

用过新浪微博API的应该知道,在调用API发微博时需要获取access_token,而这个token需要在https://api.weibo.com/oauth2/authorize这个页面登录进行授权获取code,因为token是有过期时间的,所以保险起见得每次定时发微博时都模拟登录授权一次,这里的代码我不太想得出怎么写,求点播(用PHP)


回复讨论(解决方案)

我的网站有一个自动发微博的,才写好,是将我的淘宝客商品或论坛贴子自动发到微博里去,你看看是不是你需要的

http://www.abis.com.cn/plugin.php?id=abis_weibo:index_portal
欢迎和和交流。我的QQ:9411526


不过在发淘宝客的时候,一不留神发了几百条,我的微博被新浪K了,:(

sina有php的例子,直接下载就能用。或者看源码分析流程。

这个你在授权的时候会拿到token的过期时间,判断下就行。可以参考官方给的sdk,写的很清楚明白

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn