Skip to content

Latest commit

 

History

History
89 lines (55 loc) · 2.08 KB

testGitRadio.md

File metadata and controls

89 lines (55 loc) · 2.08 KB

GitRadio

json error

Solved! (dont forget to remove payload= before json.loads())

unquote %7B character

参考transform-url-string-into-normal-string-in-python-20-to-space-etc

  1. python2
import urllib2
print urllib2.unquote("%CE%B1%CE%BB%20")
  1. python3
from urllib.parse import unquote
print(unquote("%CE%B1%CE%BB%20"))

convert bytes to string

参考convert-bytes-to-a-string

b"abcde".decode("utf-8") 

test multi-commits

first commit second commit

test comment to weibo

  1. single comment.py works

test new weibo

finished!

测试发送含图片的微博

参考requests 如何模拟提交 multipart/form-data 的表单

url = 'http://example.com/post'
files = {'file': open('gitradio.png', 'rb')} # 文件 
datat = {'name':'szcfweiya'} # 其他表单
r = requests.post(url, files=files, data=data)

phantimjs截图

  1. 加上参数--ssl-protocol=any,参考PhantomJS failing to open HTTPS site

phantomjs --ssl-protocol=any screenshot.js https://esl.hohoweiya.xyz/notes/ipynb/list/index.html tes.png
  1. 设置背景为白色,参考Tips and Tricks
page.evaluate(function() {
  document.body.bgColor = 'white';
});

自动发送带图微博

done!

短链接转换

应用暂时未通过审核,调用短链转换api时报错

{'error': 'applications over the unaudited use restrictions!', 'error_code': 21321, 'request': '/2/short_url/shorten.json'}

使用新浪API生成短连接找到可用的app_key: '2815391962'

backup

to gitradio.hohoweiya.xyz