Commit 7c521742 by zhiwei

添加readme.md相应说明及添加打包程序

parent e35fc306
# 直播平台采集系统 # 直播平台采集系统
# 项目说明:此项目包含 # 项目说明:此项目包含
1. 弹幕采集 (斗鱼、熊猫TV 1. 弹幕采集 (斗鱼、熊猫TV、B站)
2. 房间热度查询 (斗鱼、熊猫TV、虎牙、B站) 2. 房间热度查询 (斗鱼、熊猫TV、虎牙、B站)
# 使用方法请查看相应的测试类 # 使用方法请查看相应的测试类
# 根据房间地址获取房间信息
/**
* B站房间信息获取
*/
@Test
public void getBilibiliRoomInfoByRoomUrl() {
String roomUrl = "https://live.bilibili.com/483";
try {
RoomInfo roomInfo = BilibiliRoomInfoCrawler.getRoomInfoByRoomUrl(roomUrl);
System.out.println("房间信息:::"+ roomInfo);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 斗鱼房间信息获取
*/
@Test
public void getDouyuRoomInfoByRoomUrl() {
String roomUrl = "https://www.douyu.com/4372875";
try {
RoomInfo roomInfo = DouYuRoomInfoCrawler.getRoomInfoByRoomUrl(roomUrl);
System.out.println("房间信息:::"+ roomInfo);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 虎牙房间信息获取
*/
@Test
public void getHuYaRoomInfoByRoomUrl() {
String roomUrl = "https://www.huya.com/baishaling";
try {
RoomInfo roomInfo = HuYaRoomInfoCrawler.getRoomInfoByRoomUrl(roomUrl);
System.out.println("房间信息:::"+ roomInfo);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 熊猫TV房间信息获取
*/
@Test
public void getPandamTVRoomInfoByRoomUrl() {
String roomUrl = "https://www.panda.tv/337852";
try {
RoomInfo roomInfo = PandamTVRoomInfoCrawler.getRoomInfoByRoomUrl(roomUrl);
System.out.println("房间信息:::"+ roomInfo);
} catch (Exception e) {
e.printStackTrace();
}
}
# 根据房间地址获取房间弹幕
/**
* B站房间弹幕获取
*/
@Test
public void getBilibiliDanmu(){
String roomUrl = "https://live.bilibili.com/139";
try {
BilibiliClient.getDanmu(new DataCallBack() {
@Override
public void onData(Object message) {
if(message instanceof BilibiliMessage) {
BilibiliMessage bilibiliMessage = (BilibiliMessage)message;
System.out.println("-------------" + bilibiliMessage.toString());
}
}
}, roomUrl);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 斗鱼房间弹幕获取
*/
@Test
public void getDouyuDanmu(){
String roomUrl = "https://www.douyu.com/71017";
try {
DouyuClient.getDanmu(new DataCallBack() {
@Override
public void onData(Object message) {
if (message instanceof DouYuMessage) {
DouYuMessage douyuMessage = (DouYuMessage) message;
System.out.println("-------------" + douyuMessage.toString());
}
}
}, roomUrl);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 熊猫TV房间弹幕获取
*/
@Test
public void getPandamDanmu(){
String roomUrl = "https://www.panda.tv/337852";
try {
PandamClient.getDanmu(new DataCallBack() {
@Override
public void onData(Object message) {
if (message instanceof PandamMessage) {
PandamMessage pandamMessage = (PandamMessage) message;
System.out.println("-------------" + pandamMessage.toString());
}
}
}, roomUrl);
} catch (Exception e) {
e.printStackTrace();
}
}
\ No newline at end of file
...@@ -28,4 +28,56 @@ ...@@ -28,4 +28,56 @@
<version>4.1.33.Final</version> <version>4.1.33.Final</version>
</dependency> </dependency>
</dependencies> </dependencies>
<!-- 打包管理 -->
<build>
<plugins>
<!-- 发布源码 -->
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<configuration>
<attach>true</attach>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
</plugin>
<!-- 解决maven test命令时console出现中文乱码乱码 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7.2</version>
<configuration>
<forkMode>once</forkMode>
<argLine>-Dfile.encoding=UTF-8</argLine>
</configuration>
</plugin>
</plugins>
</build>
<!-- 分发管理:管理distribution和supporting files -->
<distributionManagement>
<snapshotRepository>
<id>nexus-releases</id>
<name>User Porject Snapshot</name>
<url>http://192.168.0.30:8081/nexus/content/repositories/snapshots/</url>
<uniqueVersion>true</uniqueVersion>
</snapshotRepository>
<repository>
<id>nexus-releases</id>
<name>User Porject Release</name>
<url>http://192.168.0.30:8081/nexus/content/repositories/releases/</url>
</repository>
</distributionManagement>
</project> </project>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment