Skip to main content

python implement of weibo picture bed.

Project description

简介

基于 Python 的新浪微博图床实现。

安装

pip install pyweibo-picbed

使用

示例1:

>>> from pyweibo_picbed import weibo_picbed
# 在剪切板没有截图的情况下
>>> weibo_picbed.upload_screenshot_to_weibo()
(False, 'no imgs in clipboard!')

# 手动截图且截图保存在剪切板后
>>> weibo_picbed.upload_screenshot_to_weibo()
(True, 'http://ww2.sinaimg.cn/large/aac28c44gy1ge5bq4tzzej30u00l4aei.jpg')

示例2:

from pyweibo_picbed import weibo_picbed
state, msg = weibo_picbed.upload_screenshot_to_weibo()
if state:       # 截图成功
    print(weibo_picbed.get_html_type_img_url(msg))
    print(weibo_picbed.get_markdown_type_img_url(msg))
else:           # 获得错误信息
    print("error: %s" % msg)
'''
<img src="http://ww2.sinaimg.cn/large/aac28c44gy1ge5bq4tzzej20u00l4aei.jpg"/>'
<img src="http://wx3.sinaimg.cn/large/aac28c44gy1ge5c1yqu4cj20u00l4q3c.j
pg"/>
![img](http://wx3.sinaimg.cn/large/aac28c44gy1ge5c1yqu4cj20u00l4q3c.jpg)
'''

参考

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyweibo_picbed-0.3.0.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file pyweibo_picbed-0.3.0.tar.gz.

File metadata

  • Download URL: pyweibo_picbed-0.3.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.2

File hashes

Hashes for pyweibo_picbed-0.3.0.tar.gz
Algorithm Hash digest
SHA256 32ed75475f683a8afa17bbdc8d834c137cb7732aabd507e7fde97fa09607dd17
MD5 e4af965750003a9412044912f1e4ae55
BLAKE2b-256 3bd96577a3f468ac86482d8b1e4bc6c93bf647c3cbada1d61d36ec092e452e81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page