| | |
| | | import org.jsoup.nodes.Document;
|
| | | import org.jsoup.nodes.Element;
|
| | | import org.jsoup.select.Elements;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.dataoke.DingDongQiangDTO;
|
| | | import com.yeshi.fanli.dto.dataoke.DingDongTime;
|
| | |
| | | "🕦",// 十一点半
|
| | | };
|
| | |
|
| | | static final String[] evaluateEmojis = new String[] { |
| | | "💟",
|
| | | "🌸",
|
| | | "🍸",
|
| | | "🍺",
|
| | | "📢",
|
| | | "❤",
|
| | | "💝",
|
| | | "💋",
|
| | | "👛",
|
| | | "🐾",
|
| | | "🌹",
|
| | | "🔥",
|
| | | "🎉",
|
| | | "🎁",
|
| | | "🍥",
|
| | | "🍭",
|
| | | "🌺",
|
| | | "👑",
|
| | | "✨",
|
| | | "💫",
|
| | | "🍻",
|
| | | "🎈",
|
| | | "💥",
|
| | | "💕",
|
| | | "💞",
|
| | | "💰",
|
| | | "💌",
|
| | | "💭",
|
| | | "🌼",
|
| | | "🍀"
|
| | | };
|
| | | |
| | | |
| | | |
| | | public static List<GoodsClass> goodsClasses;
|
| | | static {
|
| | | goodsClasses = new ArrayList<>();
|
| | |
| | | return parseCurrent(url);
|
| | | }
|
| | |
|
| | | private static String getRandomCommonEmoji() {
|
| | | public static String getRandomCommonEmoji() {
|
| | | return commonEmojis[(int) (Math.random() * commonEmojis.length)];
|
| | | }
|
| | |
|
| | | |
| | | public static String getEvaluateEmojis() {
|
| | | return evaluateEmojis[(int) (Math.random() * evaluateEmojis.length)];
|
| | | }
|
| | | |
| | | public static String getDesc(DaTaoKeDetailV2 detail) {
|
| | |
|
| | | // 标题+券后价+包邮+描述
|
| | | String desc = detail.getDtitle();
|
| | | desc += "\n";
|
| | | desc += String.format("券后价%s【%s元】包邮秒杀 ", Math.random() > 0.5 ? "💰" : "",
|
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getActualPrice() ).toString())
|
| | | MoneyBigDecimalUtil.getWithNoZera(detail.getActualPrice()).toString())
|
| | | + (Math.random() > 0.5 ? getRandomCommonEmoji() : "");
|
| | | desc += "\n";
|
| | | // desc += detail.getIntroduce();
|
| | | String introduce = detail.getDesc().replace(",", ",").replace("。", ",").replace("!", ",").replace(",",
|
| | | ",");
|
| | | String introduce = detail.getDesc().replace(",", ",").replace("。", ",").replace("!", ",").replace(",", ",");
|
| | | introduce = introduce.replace(",,,", ",").replace(",,", ",");
|
| | |
|
| | | String[] sts = introduce.split(",");
|
| | |
| | | desc += introduce;
|
| | | return desc;
|
| | | }
|
| | |
|
| | |
|
| | | public static TaoBaoGoodsBrief filterTaoBaoGoods(TaoBaoGoodsBrief goods, DaTaoKeDetailV2 detail) {
|
| | | if (detail != null && goods != null) {
|
| | |
| | | return list;
|
| | | }
|
| | |
|
| | | // 获取推广文案
|
| | | public static void getPublishDoc(String id) {
|
| | | String url = String.format("http://www.dataoke.com/detailtpl?gid=%s&type=1", id);
|
| | | String response = HttpUtil.get(url);
|
| | | try {
|
| | | JSONObject json = JSONObject.fromObject(new String(response.getBytes("ISO-8859-1"), "UTF-8"));
|
| | | JSONObject data = json.optJSONObject("data");
|
| | | String tpl2 = data.optString("tpl2");
|
| | | tpl2 = tpl2.substring(0, tpl2.indexOf("---------"));
|
| | | System.out.println(tpl2.replace("</br>", "\n").trim());
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|