A Personalized Twitch Resources Recommendation Engine

Wed, Jun 16, 2021 One-minute read

code download

  1. Intelij 启动 Tomcat 后,有乱码,出现 “淇℃伅 [main] org.apach”

解决办法 :

修改 tomcat 安装目录下的 config/logging.properties 文件

java.util.logging.ConsoleHandler.encoding = GBK

  1. delpoy website: http://localhost:8080/jupiter-war-exploded/game

解决办法:

Run -> Configurations -> Deployment

image

Deployment

now opens up at http://localhost:8080/jupiter/game:

  1. postman

POST http://localhost:8080/jupiter/game

  1. IDEA tomcat 404
image

Tomcat Configurations

  1. HTTP 500 –..JSONObject["name"] not found.

解决办法:

replay a new client id. 😅 😅 😅

  1. Postman?? IDEA offers better options: Tools -> HttpClient
image

Tomcat Configurations

GET https://api.twitch.tv/helix/streams?game_id=12924 Authorization: Bearer jo3r1bpdgk5gx41zx2wuajygdb1d8b Client-Id: t5bc5a4tab71mqgs1f880ent6cx8j4

Authorization, Client-Id is refer to your own data under the postman headers tab

  1. lombok and Builder pattern
image

Tomcat Configurations

Without the lombok, the code would be like below:

image

Tomcat Configurations

image

Tomcat Configurations

image

Tomcat Configurations

you need use delombok to find the problem:

image

Tomcat Configurations

Lombok

  1. Jackson tutorial Jackson
 @JsonProperty("thumbnail_url")
        private String thumbnailUrl;
 // Convert JSON format data returned from Twitch to an Arraylist of Game objects
 ObjectMapper mapper = new ObjectMapper();
        try {
            return Arrays.asList(mapper.readValue(data, Game[].class));


  • @JsonIgnoreProperties(ignoreUnknown = true) indicates that other fields in the response can be safely ignored. Without this, you’ll get an exception at runtime.

  • @JsonInclude(JsonInclude.Include.NON_NULL) indicates that null fields can be skipped and not included.

  • @JsonDeserialize indicates that Jackson needs to use Game.Builder when constructing a Game object from JSON strings.

  1. Failed to connect to api.twitch.com port 443: Connection

中国特色错误,换 EXpressVPN