-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
84 additions
and
31 deletions.
There are no files selected for viewing
31 changes: 0 additions & 31 deletions
31
...ysis_parent/emotional_analysis_spider/src/test/java/org/bianqi/follower/FollowerTest.java
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
..._parent/emotional_analysis_spider/src/test/java/org/bianqi/followering/FollowingTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.bianqi.followering; | ||
|
||
import java.io.IOException; | ||
import java.math.BigInteger; | ||
import java.security.SecureRandom; | ||
|
||
import org.bianqi.utils.EncryptUtils; | ||
import org.jsoup.Jsoup; | ||
import org.jsoup.Connection.Method; | ||
import org.jsoup.Connection.Response; | ||
import org.junit.Test; | ||
|
||
/** | ||
* 关注者 | ||
* @author dhc | ||
* | ||
*/ | ||
public class FollowingTest { | ||
|
||
@Test | ||
public void test3() throws Exception{ | ||
String secKey = new BigInteger(100, new SecureRandom()).toString(32).substring(0, 16); | ||
String encText = EncryptUtils.aesEncrypt(EncryptUtils.aesEncrypt("{\"offset\":0,\"limit\":50};","0CoJUm6Qyw8W8jud"), secKey); | ||
String encSecKey = EncryptUtils.rsaEncrypt(secKey); | ||
Response execute = Jsoup.connect("http://music.163.com/weapi/user/getfolloweds") | ||
.data("params",encText) | ||
.data("encSecKey",encSecKey) | ||
.method(Method.POST).ignoreContentType(true).execute(); | ||
String string = execute.body().toString(); | ||
System.out.println(string); | ||
} | ||
|
||
|
||
|
||
} |
42 changes: 42 additions & 0 deletions
42
...sis_parent/emotional_analysis_spider/src/test/java/org/bianqi/followers/FollowerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.bianqi.followers; | ||
|
||
import java.math.BigInteger; | ||
import java.security.SecureRandom; | ||
|
||
import org.bianqi.utils.EncryptUtils; | ||
import org.jsoup.Connection.Method; | ||
import org.jsoup.Connection.Response; | ||
import org.jsoup.Jsoup; | ||
import org.junit.Test; | ||
|
||
/** | ||
* <p>Title: FollowerTest</p> | ||
* <p>Description: </p> | ||
* <p>School: qiqihar university</p> | ||
* @author BQ | ||
* @date 2017年10月25日下午1:10:43 | ||
* @version 1.0.0 | ||
*/ | ||
public class FollowerTest { | ||
|
||
/** | ||
* 粉丝 但是数据使用JS解析 是个问题 | ||
//TODO | ||
* <p>Title: test3</p> | ||
* <p>Description: </p> | ||
* @throws Exception | ||
*/ | ||
@Test | ||
public void test3() throws Exception{ | ||
String secKey = new BigInteger(100, new SecureRandom()).toString(32).substring(0, 16); | ||
String encText = EncryptUtils.aesEncrypt(EncryptUtils.aesEncrypt("{\"offset\":0,\"limit\":50};","0CoJUm6Qyw8W8jud"), secKey); | ||
String encSecKey = EncryptUtils.rsaEncrypt(secKey); | ||
Response execute = Jsoup.connect("http://music.163.com/weapi/user/getfollows/2768563") | ||
.data("params",encText) | ||
.data("encSecKey",encSecKey) | ||
.method(Method.POST).ignoreContentType(true).execute(); | ||
String string = execute.body().toString(); | ||
System.out.println(string); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>emotional_analysis</groupId> | ||
<artifactId>emotional_analysis</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
</project> |