Giter Club home page Giter Club logo

Comments (5)

sun1279 avatar sun1279 commented on July 19, 2024

请问现在接口还可以用么

from weibo.

tonghouqi avatar tonghouqi commented on July 19, 2024

接口可以用,不过需要修改一下。 我又整改的接口。
文字可以正常发微博,图片只能发一张,发布多张图片的问题我没解决。

from weibo.

sun1279 avatar sun1279 commented on July 19, 2024

能否贴几段示例代码?我使用一直提示没有权限。你的微博开发者认证了没?谢谢

from weibo.

tonghouqi avatar tonghouqi commented on July 19, 2024

需要微博开发者认证的。我写了一个自动采取东方财经信息的。 其中的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.

imcda avatar imcda commented on July 19, 2024

TypeError: 'HttpObject' object is not callable

在用Client.post()的时候出现这个报错,为什么?已经认证了

from weibo.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.