Skip to content

Commit

Permalink
添加粉丝和被粉的测试类
Browse files Browse the repository at this point in the history
  • Loading branch information
20100507 committed Jan 18, 2018
1 parent aa46308 commit 9ffbc38
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 31 deletions.

This file was deleted.

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);
}



}
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);
}

}
7 changes: 7 additions & 0 deletions pom.xml
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>

0 comments on commit 9ffbc38

Please sign in to comment.