一、分析:
新榜地址:这里写链接内容
接口发现:
http://www.newrank.cn/xdnphb/data/weixinuser/searchWeixinDataByCondition
请求方式:post
表单数据:
- filter:
- hasDeal:false
- keyName:汽车
- order:NRI
- nonce:8f44b75a9
- xyz:aa2e01f7325d0fedc897a0a1f

新榜指数(all): - filter=&order=NRI&nonce=8f44b75a9&xyz=aa2e01f7325d0fedc897a0a1f 新榜指数(名称): -filter=nickname%7C&order=NRI&nonce=e6826c723&xyz=b7eb06284deaaeb8fd2 新榜指数(500强): - filter=top500%7C&order=NRI&nonce=9c7df5062&xyz=21b4bdbf21433c048fbd41e 新榜指数(原创): - filter=ori%7C&order=NRI&nonce=0505d7046&xyz=bc4b98d5d6abf3fc3d2f177a 新榜指数(服务号): - filter=server%7C&order=NRI&nonce=23ca24875&xyz=ba27a0682ca3427c7a3600a5fe785cf0 新榜指数(认证号): - filter=certified%7C&order=NRI&nonce=d2f&xyz=dd4f06509a2fea5601d0e79c9979e2fd 相关度(all): - filter=&order=relation&nonce=7d1aaefeb&xyz=6fbc8b1bd52dc3f034639d7a7f5c0048 相关度(名称): - filter=nickname%7C&order=relation&nonce=294eb2b6c&xyz=2ca0be05adbc84f9760add062c908be9 相关度(500强): - filter=top500%7C&order=relation&nonce=41f023e0b&xyz=bbfb3e34329c3b4d5d3cc6d6 相关度(原创): - filter=ori%7C&order=relation&nonce=e2a72bace&xyz=e6c951a64320b53b43c5e49 相关度(服务号): - filter=server%7C&order=relation&nonce=fd56a24b9&xyz=70018bde9d8684a94ac502c30f4b34c0 相关度(认证号): - filter=certified%7C&order=relation&nonce=e99dede64&xyz=994e5bb73ad6bb25748c8bbb4f
讯享网
二、主要执行代码:
讯享网 public static void getSearchData(String url) { HttpHelper http = new HttpHelper(); try { Result results = http.doPost(url, 0); System.out.println("post url :" + url); if (results.statusCode == 200) { String result = (String) results.data; if (result.contains("null")) { result = result.replace("null", "\"-1\""); } JSONObject json = JSONObject.fromObject(result); JSONArray obj = json.getJSONObject("value").getJSONArray("result"); List<Map<String, Object>> list = new ArrayList<>(); for (int i = 0; i < obj.length(); i++) { Map<String, Object> map = new HashMap<>(); JSONObject data = obj.getJSONObject(i); String name = data.getString("name"); String url_prefix = "http://www.newrank.cn/public/info/detail.html?account="; String code = data.getString("account"); String lastArticleTitle = data.getString("lastArticleTitle"); String lastArticleTime = data.getString("lastArticleTime"); String newrankIndex= data.getString("weekLog1pmark"); map.put("name", name); map.put("code", code); if (code.equals("-1")) { map.put("newrank_url", "-1"); } else { map.put("newrank_url", url_prefix+code); } map.put("newrank_index", newrankIndex); map.put("last_update_title", lastArticleTitle); if (lastArticleTime.equals("-1")) { map.put("last_update", "1970-00-00"); } else { map.put("last_update", lastArticleTime); } list.add(map); } insert(list); } } catch (IOException e) { e.printStackTrace(); } }
三、服务器部署:(每天固定时间执行)
1、MQ上ant更新打包和svn代码更新,发布到指定的服务器
2、编写shell脚本,(并给执行权限chmod +x)通过crontab 来设置定时任务

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/97919.html