Comments (5)
请问现在接口还可以用么
from weibo.
接口可以用,不过需要修改一下。 我又整改的接口。
文字可以正常发微博,图片只能发一张,发布多张图片的问题我没解决。
from weibo.
能否贴几段示例代码?我使用一直提示没有权限。你的微博开发者认证了没?谢谢
from weibo.
需要微博开发者认证的。我写了一个自动采取东方财经信息的。 其中的weibo2是我自己改了一下。
-- coding: utf-8 --
import requests
import time
from bs4 import BeautifulSoup
from weibo2 import Client
API_KEY = '3633482137'
API_SECRET = 'd137be69157b6014cdf39d0e0fc11d66'
REDIRECT_URI = 'https://api.weibo.com/oauth2/default.html'
c = Client(API_KEY, API_SECRET, REDIRECT_URI, username='*****', password='*******')
#获取东方财富的实时新闻
#soup.find(id='livenews-list').find('livenews-media')
ids = []
count = 0
while True:
dongfang = requests.get('http://kuaixun.eastmoney.com/')
#print dongfang.text
soup = BeautifulSoup(dongfang.text, "lxml")
for item in soup.find(id='livenews-list').children:
id = item.get('id')
if not id in ids:
starttime = item.find(class_ = 'time').text
mediatitle = item.find(class_ = 'media-title').text
href = item.find('a',href=True)
hrefcont = ""
if not href is None:
hrefcont = u" " + href['href']
if count != 0:
weibotext = starttime + " " + mediatitle + " " + hrefcont
if weibotext > 139:
weibotext = starttime + mediatitle[0:135-len(hrefcont)] + hrefcont
c.post('statuses/share', status=weibotext)
#print weibotext
ids.append(id)
count = count + 1
if count == 30000:
count = 1
time.sleep(10)
from weibo.
TypeError: 'HttpObject' object is not callable
在用Client.post()的时候出现这个报错,为什么?已经认证了
from weibo.
Related Issues (15)
- hey,表扬一下 HOT 1
- 报错 TypeError: session() takes no arguments (1 given) HOT 3
- 是否支持新浪的几个特殊部署的接口? HOT 6
- uid
- 新浪微博的sdk有点问题 HOT 1
- documentation issue HOT 2
- 安装的时出现UnicodeError HOT 2
- requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed HOT 1
- 真的问题大 HOT 1
- 如何不用通过浏览器请求获取到code HOT 1
- what is rediract_uri send? HOT 1
- 由于 Weibo SDK 升级, 这个项目的代码已经不能发微博了. HOT 1
- 是不是無法拿到指定用戶的最新動態了?
- 状态中必须包含安全链接,如何避免?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weibo.