diff --git a/emotional_analysis_parent/emotional_analysis_spider/src/test/java/org/bianqi/follower/FollowerTest.java b/emotional_analysis_parent/emotional_analysis_spider/src/test/java/org/bianqi/follower/FollowerTest.java deleted file mode 100644 index 21c36bb..0000000 --- a/emotional_analysis_parent/emotional_analysis_spider/src/test/java/org/bianqi/follower/FollowerTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.bianqi.follower; - -import java.io.IOException; - -import org.junit.Test; - -/** - *

Title: FollowerTest

- *

Description:

- *

School: qiqihar university

- * @author BQ - * @date 2017年10月25日下午1:10:43 - * @version 1.0.0 - */ -public class FollowerTest { - - /** - * 粉丝 但是数据使用JS解析 是个问题 - //TODO - *

Title: test3

- *

Description:

- * @throws IOException - */ - @Test - public void test3() throws IOException{ - int songId = 63650; - int pageNum = 0; - String req_str = "{\"ids\":\"["+songId+"]\",\"offset\":"+pageNum+",\"br\":128001,\"csrf_token\":\"\"};"; - } - -} diff --git a/emotional_analysis_parent/emotional_analysis_spider/src/test/java/org/bianqi/followering/FollowingTest.java b/emotional_analysis_parent/emotional_analysis_spider/src/test/java/org/bianqi/followering/FollowingTest.java new file mode 100644 index 0000000..555aa74 --- /dev/null +++ b/emotional_analysis_parent/emotional_analysis_spider/src/test/java/org/bianqi/followering/FollowingTest.java @@ -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); + } + + + +} diff --git a/emotional_analysis_parent/emotional_analysis_spider/src/test/java/org/bianqi/followers/FollowerTest.java b/emotional_analysis_parent/emotional_analysis_spider/src/test/java/org/bianqi/followers/FollowerTest.java new file mode 100644 index 0000000..8bdf03a --- /dev/null +++ b/emotional_analysis_parent/emotional_analysis_spider/src/test/java/org/bianqi/followers/FollowerTest.java @@ -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; + +/** + *

Title: FollowerTest

+ *

Description:

+ *

School: qiqihar university

+ * @author BQ + * @date 2017年10月25日下午1:10:43 + * @version 1.0.0 + */ +public class FollowerTest { + + /** + * 粉丝 但是数据使用JS解析 是个问题 + //TODO + *

Title: test3

+ *

Description:

+ * @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); + } + +} diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..007d7ca --- /dev/null +++ b/pom.xml @@ -0,0 +1,7 @@ + + 4.0.0 + emotional_analysis + emotional_analysis + 0.0.1-SNAPSHOT + pom + \ No newline at end of file