Where there are people, there are rivers and lakes
The real martial arts is not the metaphysics in the mountains, not the fantasy novels with qi and sword. A true master will not be buried, but will be recognized by the world.
On May 17, Beijing time, Ma Baoguo, a taijiquan master known as Hun Yuan, was KO’d for 30 seconds by Wang Qingmin, a 50-year-old folk martial arts enthusiast, in Zibo, Shandong Province. If you are not aware of the event that has shocked China’s martial arts circles, you are advised to catch up on this video.
Almost instinctively, I went to station B and saw that the viewership had reached a horrible level
1. First use Jsoup to climb down the barrage
Rely on
<! <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> 3.10 FINAL < version > < / version > < / dependency > < the dependency > < groupId > org.. Apache httpcomponents < / groupId > <artifactId> httpClient </artifactId> <version>4.5.3</version> </dependency> <dependency> <groupId>org.jsoup</groupId> < artifactId > jsoup < / artifactId > < version > 1.11.3 < / version > < / dependency >Copy the code
code
package com.example.jm.jmm.util.jsoup; import com.alibaba.fastjson.JSONObject; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @description: * @author: Jiangsy * @date: 2020/11/20 **/ public class BiliUtil {public static void main(String[] args) throws Exception{// Video id String av = "BV1HJ411L7DP"; String url = "https://api.bilibili.com/x/player/pagelist?bvid="+av+"&jsonp=jsonp"; String result = HttpClientUtil.doGet(url); ParseObject (result).getJsonArray ("data").getJsonObject (0).getString("cid"); System.out.println("cid:{}"+cid); // Get the bullet-screen print to the file getContent(cid); } /** * @description: [cid] * @return: void * @author: Jiangsy * @date: 2020/11/20 **/ public static void getContent(String cid) throws Exception{ CloseableHttpClient closeableHttpClient = HttpClients.createDefault() ; HttpGet httpGet1 = new HttpGet("http://comment.bilibili.com/"+cid+".xml"); CloseableHttpResponse httpResponse1 = closeableHttpClient.execute(httpGet1) ; String en = EntityUtils.toString(httpResponse1.getEntity(), "UTF-8"); String c = "\">(.*?) < "; Pattern a = Pattern.compile(c); Matcher m = a.matcher(en); File file = new File("/project/11.txt"); if(file.exists()){ file.delete(); } OutputStream fos=new FileOutputStream("/project/11.txt"); while(m.find()){ String speak = m.group().replace("\">","") ; speak = speak.replace("<","") ; System.out.println(speak); String str=speak; str+=""; fos.write(str.getBytes()); }}}Copy the code
Python’s WordCloud generates word clouds
import jieba from matplotlib import pyplot as plt from wordcloud import WordCloud from PIL import Image import numpy as np path = r'ciyun.png' font = r'/System/Library/Fonts/Hiragino Sans GB.ttc' text = open('/project/11.txt', 'r', Encoding =' utF-8 ').read() cut = jieba.cut(text) #分词 String = ". Join (cut) print(len(string)) img = Image.open('ciyun/22.png') # image.open ('ciyun/22.png') # img_array = np.array(img) # Wc = WordCloud(background_color='white', width=1000, height=800, mask=img_array, font_path=font, Generate_from_text (string)# Draw image plt.imshow(wc) plt.axis('off') plt.figure() plt.show() # Show image Wc.to_file ('new.png') # Save the imageCopy the code
rendering
the end