Browse Source

修复今日热点bug

tags/v1.0.6
wangyi15124 3 years ago
parent
commit
695b71455a
3 changed files with 10 additions and 6 deletions
  1. +2
    -2
      src/main/java/com/stonedt/intelligence/quartz/SynthesizeSchedule.java
  2. +7
    -4
      src/main/java/com/stonedt/intelligence/util/HotWordsUtil.java
  3. +1
    -0
      src/main/resources/templates/displayboard/displayboard.html

+ 2
- 2
src/main/java/com/stonedt/intelligence/quartz/SynthesizeSchedule.java View File

@@ -94,12 +94,12 @@ public class SynthesizeSchedule {
* 模板消息
*/

// @PostConstruct
//@PostConstruct
// @Scheduled(cron = "0 30 4 * * ?")
//@Scheduled(fixedDelay = 1000*60*2)
//
@Scheduled(cron = "0 0/30 * * * ?")
@Scheduled(cron = "0 0/30 * * * ?")
//@Scheduled(cron = "0 0 0/2 * * ?")
public void popularInformation() {
if(schedule_synthesize_open==1) {


+ 7
- 4
src/main/java/com/stonedt/intelligence/util/HotWordsUtil.java View File

@@ -30,7 +30,7 @@ import com.alibaba.fastjson.JSONObject;
public class HotWordsUtil {
public static void main(String[] args) {
System.out.println(hot36Kr());
System.out.println(search());
}
@@ -82,14 +82,17 @@ public class HotWordsUtil {
Document parse = Jsoup.parse(html);
try {
//#sanRoot > main > div.container.right-container_2EFJr > div > div:nth-child(2)
Elements tobody = parse.select("#sanRoot > main > div.container.right-container_2EFJr > div > div:nth-child(2)");
Elements tobody = parse.select("#sanRoot > main > div.container.right-container_2EFJr > div > div:nth-child(2) > div");
for(int i = 1;i<31;i++) {
Elements select = tobody.select("div:nth-child("+i+")");
Element select = tobody.select("div:nth-child("+i+")").get(0);
String topic = select.select("div.content_1YWBm > a > div.c-single-text-ellipsis").text();
String original_weight = select.select("div.trend_2RttY.hide-icon > div.hot-index_1Bl1a").text();
String original_weight = select.select("div.hot-index_1Bl1a").text();
if(StringUtils.isBlank(topic)) {
continue;
}
if(StringUtils.isBlank(original_weight)) {
continue;
}
JSONObject js = new JSONObject();
js.put("x", topic);
js.put("value", original_weight);


+ 1
- 0
src/main/resources/templates/displayboard/displayboard.html View File

@@ -1293,6 +1293,7 @@
if(!(!hot_search_terms)){
a = JSON.parse(escape2Html(hot_search_terms))
}
debugger;
anychart.onDocumentReady(function() {
var chart = anychart.tagCloud(a);
chart.container("keywords");


Loading…
Cancel
Save