码迷,mamicode.com
首页 > 其他好文 > 详细

短链接生成原理

时间:2014-12-23 19:21:56      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:

import requests
import json
import hashlib
url = http://a.qbao.com/short
param={"longUrl":r"http://m.qianbao666.com/api/v30/share4Client/share?type=3&prizeMoney=1,5765"}
r = requests.post(url,data=param)
print r.text



{"ok":true,"longUrl":"http://m.qianbao666.com/api/v30/share4Client/share?type=3\u0026prizeMoney=1,5765","shortUrl":"http://a.qbao.com/Pg"}


http get 
http://a.qbao.com/Pg

<a href="http://m.qianbao666.com/api/v30/share4Client/share?type=3\u0026prizeMoney=1,5765">Moved Permanently</a>.

 

短链接生成原理

标签:

原文地址:http://www.cnblogs.com/huangjianan/p/4180686.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!