Skip to main content

简介

基于 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)
'''

参考

Release files for pyweibo-picbed 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyweibo-picbed 0.3.0
File Size Uploaded
pyweibo_picbed-0.3.0.tar.gz 3.7 kB Details

Release files / pyweibo_picbed-0.3.0.tar.gz

Download URL pyweibo_picbed-0.3.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
32ed75475f683a8afa17bbdc8d834c137cb7732aabd507e7fde97fa09607dd17
BLAKE2b-256 checksum
How to use checksums
3bd96577a3f468ac86482d8b1e4bc6c93bf647c3cbada1d61d36ec092e452e81
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page