当前位置: 首页 > news >正文

宿州做网站的公司有哪些东莞网站建设求职简历

宿州做网站的公司有哪些,东莞网站建设求职简历,wordpress密码加密方式,新站点seo联系方式文章目录 背景实现是否下架预警评分 总的工具类,测试 背景 在谷歌上面发布包,有时候要看看评分,有时候会因为总总原因被下架,希望后台能够对评分进行预警,和下架预警 实现 测试地址: https://play.google.com/store/apps/details?idcom.tencent.mm 通过jsoup解析页面,然后获… 文章目录 背景实现是否下架预警评分 总的工具类,测试 背景 在谷歌上面发布包,有时候要看看评分,有时候会因为总总原因被下架,希望后台能够对评分进行预警,和下架预警 实现 测试地址: https://play.google.com/store/apps/details?idcom.tencent.mm 通过jsoup解析页面,然后获取评分; 这是获取评分的: 而判断包是否下架就直接判断返回的code码是否大于300,就算作下架了; 是否下架预警 public static void offline(String url) {// 1.解析网页(jsoup 解析返回的对象是浏览器Document对象)HttpResponse response null;try {response getHttpResponse(url);if (response.getStatusLine().getStatusCode() 300) {// 下架通知log.error(谷歌App检测下架: {} , url);}log.error(谷歌App检测下架: code码{} , response.getStatusLine().getStatusCode());} catch (Exception e) {log.error(谷歌App检测下架!!!url:{},异常:{}, url, e);//throw new RuntimeException(e);} finally {if (Objects.nonNull(response)) {try {EntityUtils.consume(response.getEntity());} catch (IOException e) {//throw new RuntimeException(e);}}}}评分 public static Integer score(String url) {// 1.解析网页(jsoup 解析返回的对象是浏览器Document对象)HttpResponse response null;try {response getHttpResponse(url);if (response.getStatusLine().getStatusCode() 300) {Document document Jsoup.parse(EntityUtils.toString(response.getEntity(), Charsets.UTF_8));// google商店的评分classElements tt9eCd document.getElementsByClass(TT9eCd);if (CollectionUtils.isEmpty(tt9eCd)) {log.debug(google商店评分数据监控没有评分app:{}, url);return null;}return (int) (Double.parseDouble(tt9eCd.get(0).textNodes().get(0).text()) * 10);}} catch (Exception e) {e.printStackTrace();log.error(google商店评分数据监控异常!!!url:{},异常:{}, url, e.toString());//throw new RuntimeException(e);} finally {if (Objects.nonNull(response)) {try {EntityUtils.consume(response.getEntity());} catch (IOException e) {//throw new RuntimeException(e);}}}return null;}总的工具类,测试 package com.study.springbootplus.util;import com.google.common.base.Charsets; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.select.Elements;import java.io.IOException; import java.util.Objects;/*** ClassName GooglePlayUtil* Author yida* Date 2023-08-21 17:04* Description GooglePlayUtil*/ Slf4j public class GooglePlayUtil {private static final HttpClient httpClient HttpClients.custom().setDefaultRequestConfig(RequestConfig.custom().setConnectTimeout(3000).setSocketTimeout(3000).build()).build();public static void main(String[] args) {System.setProperty(java.net.useSystemProxies, true);offline(https://play.google.com/store/apps/details?idcom.tencent.mm);System.out.println(返回的分数: score(https://play.google.com/store/apps/details?idcom.tencent.mm));}public static void offline(String url) {// 1.解析网页(jsoup 解析返回的对象是浏览器Document对象)HttpResponse response null;try {response getHttpResponse(url);if (response.getStatusLine().getStatusCode() 300) {// 下架通知log.error(谷歌App检测下架: {} , url);}log.error(谷歌App检测下架: code码{} , response.getStatusLine().getStatusCode());} catch (Exception e) {log.error(谷歌App检测下架!!!url:{},异常:{}, url, e);//throw new RuntimeException(e);} finally {if (Objects.nonNull(response)) {try {EntityUtils.consume(response.getEntity());} catch (IOException e) {//throw new RuntimeException(e);}}}}public static Integer score(String url) {// 1.解析网页(jsoup 解析返回的对象是浏览器Document对象)HttpResponse response null;try {response getHttpResponse(url);if (response.getStatusLine().getStatusCode() 300) {Document document Jsoup.parse(EntityUtils.toString(response.getEntity(), Charsets.UTF_8));// google商店的评分classElements tt9eCd document.getElementsByClass(TT9eCd);if (CollectionUtils.isEmpty(tt9eCd)) {log.debug(google商店评分数据监控没有评分app:{}, url);return null;}return (int) (Double.parseDouble(tt9eCd.get(0).textNodes().get(0).text()) * 10);}} catch (Exception e) {e.printStackTrace();log.error(google商店评分数据监控异常!!!url:{},异常:{}, url, e.toString());//throw new RuntimeException(e);} finally {if (Objects.nonNull(response)) {try {EntityUtils.consume(response.getEntity());} catch (IOException e) {//throw new RuntimeException(e);}}}return null;}public static HttpResponse getHttpResponse(String url) throws Exception {return httpClient.execute(new HttpGet(url));}} 测试结果: 返回的分数:36
http://www.yutouwan.com/news/207979/

相关文章:

  • 网站模板中文工程建设含义
  • 数据型网站建设软件外包产生的背景和原因
  • 潘家园网站建设wordpress 媒体库位置
  • 集团高端网站建设在门户网站中
  • 涉县移动网站建设网络推广是啥
  • 学习php好的网站html5手机网站特效
  • 网站推广的平台国际最新十大新闻事件
  • 工程门户网站建设刚做的网站 搜不到
  • 网站模版与模板的使用上海发布官方网
  • 网站开发实用技术第2版课后答案如何新建网站dw
  • 长春市建设工程交易中心网站西安网站建设报价方案
  • 网站建设主机类型怎么选公司网站建设沈阳
  • 安徽合肥做网站的公司seo手机端优化
  • 商务网站建设的一般流程是什么意思经典广告语
  • 云主机网站的空间在哪里看浙里建app官方网站
  • 定制网站开发价格体验式营销
  • 中国中国建设银行网站企业网站有哪些举例
  • 做一个英文的公司网站多少钱苏州中车建设工程有限公司网站
  • 网站店铺建设百度查重入口免费版
  • 做华为网站的还有哪些重庆网红打卡点
  • 企业网站建设功能模块东北建站
  • 浪起科技做的网站怎么样爱站网站长seo综合查询工具
  • 做跨境电商的网站wordpress 轮播图 修改
  • 网站的底部设计wordpress git 7.5
  • 网站开发工程师待遇淄博排名优化软件点击
  • 网站内搜索功能怎么做软件商店正版下载
  • 东莞凤岗网站建设江苏赛华建设监理有限公司网站
  • 如何把网站放在根目录那些网站分享pr做的视频软件
  • 在国外做电商网站云南省文山建设厅网站
  • 网站建设优化扬州贵州网站建设公司推荐