1 公網映射(注意有1.x和2.0版本,注意咱們須要的是1.x)java
http://dorole.com/1233/ github
http://tonybai.com/tag/%E5%BE%AE%E4%BF%A1/json
下載exe和cfg,執行如下命令dom
注:其中的example爲二級域名名稱,若是已被註冊,能夠其餘任意名稱url
ngrok -config ngrok.cfg -subdomain example 8080
接收用戶圖片,直接獲取PicUrl便可,無須經過MediaId獲取spa
map = {HashMap@3944} size = 7.net
0 = {HashMap$Node@3960} "MediaId" -> "tB8aDuA3Pk8FVhgmEvXbAdOrUGGVEm5L0uhtEJcxwQrNNs3tMDHRviWz6BGXSgxO"code
1 = {HashMap$Node@3961} "CreateTime" -> "1443294782"blog
2 = {HashMap$Node@3962} "ToUserName" -> "gh_9010a401c4d7"
3 = {HashMap$Node@3963} "FromUserName" -> "oY6-GwMcj5AVMgG3uaekyRFtnWF4"
4 = {HashMap$Node@3964} "MsgType" -> "image"
5 = {HashMap$Node@3965} "PicUrl" -> "http://mmbiz.qpic.cn/mmbiz/QGKdW6THOpuUdbyEoSSHfQHtRQRHtY5M3GEvY2SP97S0zzU9U0GqAmRyWbibKly5iaIZg165fDYxwsCZtL3tsRqQ/0"
6 = {HashMap$Node@3966} "MsgId" -> "6198903887386049577"
解析json問題
http://blog.csdn.net/jiafu1115/article/details/6933930
net.sf.json.JSONException: java.lang.NoSuchMethodException: com.cisco.learning.Mm.<init>()
=>類必須有無參構造器
延時問題
包括接口url等等,配置後都不能立刻生效,因此不用慌張,幾分鐘等待後便可
Plan A:
tunnel.mobi服務已down,使用ngrok.com
http://blog.csdn.net/liuxiyangyang/article/details/22922265/
Plan B:
搭建本身的ngrok服務
http://tonybai.com/2015/03/14/selfhost-ngrok-service/
1 雲雀雲alauda.cn上安裝ubantu
2 安裝git
sudo apt-get install git
Plan C:
Plan D:
簡單,只是有如下限制:
1.需使用https訪問
2.端口默認爲80
pagekite http://pagekite.net/
1.Download and install Python 2.7
2.Download pagekite.py to your Desktop
3.Run the program!