codecamp

抓包云南日报的app来自己做一个

charles抓包获取api

初始化

http://cms.wxyd.yunnan.cn/index.php?m=initialization

获取栏目(post)

http://cms.wxyd.yunnan.cn/index.php?m=news&a=get_category

headers:

content-type: application/x-www-form-urlencoded

body:

mod=bobao&app_name=wxyd&

response: {

"status": 1,

"msg": "栏目获取成功",

"categories": [

{

"id": "93",

"name": "头条",

"listorder": "93",

"subscribe_flag": true

},

{

"id": "116",

"name": "要闻",

"listorder": "116",

"subscribe_flag": true

},

{

"id": "7",

"name": "深读",

"listorder": "258",

"subscribe_flag": true

},

{

"id": "96",

"name": "新谈",

"listorder": "259",

"subscribe_flag": true

},

{

"id": "102",

"name": "周边",

"listorder": "260",

"subscribe_flag": true

},

{

"id": "117",

"name": "视界",

"listorder": "261",

"subscribe_flag": false

},

{

"id": "98",

"name": "家园",

"listorder": "262",

"subscribe_flag": true

},

{

"id": "97",

"name": "民族",

"listorder": "263",

"subscribe_flag": false

},

{

"id": "103",

"name": "旅游",

"listorder": "264",

"subscribe_flag": false

},

{

"id": "99",

"name": "花潮",

"listorder": "265",

"subscribe_flag": false

}

]

}

toplist

http://cms.wxyd.yunnan.cn/index.php?m=news&a=get_top_list

body

category_id=93&app_name=wxyd&

response { "id": "43766", "top": "1", "title": "2017云南省人社系统服务农民工电子手册", "time": "2017-03-23 19:34:52", "timestamp": "1490268892", "thumbnail": "http:\/\/wxyd.yunnan.cn\/uploadfile\/s2\/2017\/0324\/20170324022334919.jpg", "summary": "", "source": null, "comment_id": "wxyd-93-43766", "comments_count": "0", "detail_url": "http:\/\/h5.wxyd.yunnan.cn\/2017\/nmgsc\/index.html", "listorder": "44002.0100000", "special_id": "", "tag": "0" }

getlist

http://cms.wxyd.yunnan.cn/index.php?m=news&a=get_list

body

since_id=0&category_id=116&app_name=wxyd&count=20&

more

category_id=116&app_name=wxyd&count=20&max_id=43984.0&

register

http://wxyd.yunnan.cn/yydapi.jsp?m=account&a=register

body

safe_question {"你最喜欢的颜色":"yellow","你的家乡在哪":"大理"}
email 245010735@qq.com
password 98641e30ace18a76f07bd7e5fbf7cd6c
uid lee

{ "status": 1, "msg": "\u6ce8\u518c\u6210\u529f" } { "status": 1, "token": "3436ee2ca8428a142949e086d1cc495a", "readerid": 129781, "msg": "\u767b\u9646\u6210\u529f" }

userinfo

http://wxyd.yunnan.cn/yydapi.jsp?m=account&a=authenticate

body

token=3436ee2ca8428a142949e086d1cc495a&device_id=215b8758-952e-3380-84e2-90635a90ee95&

Android app部分

retrofit+mvp+rxjava+rxcache

viewpager+recycleview显示新闻列表界面

webview显示新闻详情页面

获取新闻列表

@FormUrlEncoded@POST("?m=news&a=get_list")Observable<HttpResult<List<NewsListDto>>> getNewsList(@FieldMap HashMap<String,Object> dto);

用到的开源项目

compile 'com.github.bumptech.glide:glide:3.7.0' compile project(path: ':lcrapiddeveloplibrary') compile 'com.android.support:cardview-v7:23.4.0' compile 'com.android.support:recyclerview-v7:23.4.0' compile 'com.netflix.feign:feign-gson:8.17.0' compile 'io.reactivex:rxandroid:1.2.1' compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4' compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4' compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta4' compile 'com.github.VictorAlbertos.RxCache:core:1.4.6' compile 'com.zhy:okhttputils:2.6.2' compile 'com.youth.banner:banner:1.4.9'  //banner1最新版本

运行效果如图和官方的对比

温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }