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

WBOY
Release: 2016-06-23 14:05:52
Original
1041 people have browsed it

用过新浪微博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,写的很清楚明白

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!