Skip to content

Commit

Permalink
fix for boxoffice top 5
Browse files Browse the repository at this point in the history
  • Loading branch information
TomBrennan91 committed May 15, 2020
1 parent fac0619 commit db8e2a3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/io/brennan/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static void setAPIKey() throws IOException{
key = in.lines().findFirst().get();
}

APIKey = key;
APIKey = "e3f73bca";
System.out.println("API Key = " + APIKey);
}
}
9 changes: 6 additions & 3 deletions src/main/java/io/brennan/review/ReviewController.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ public class ReviewController {
public String getBoxOfficeTop5() throws IOException {
System.out.println("getBoxOfficeTop5");
String rawMojo = Utilities.getHTML("https://www.boxofficemojo.com/data/js/wknd5.php");
// System.out.println(rawMojo);
String[] splitMojo = rawMojo.split("<tr><td class=mojo_row>");
System.out.println(rawMojo);

String[] splitMojo = rawMojo.split("<tr><td class=mojo_row>");
StringBuilder formattedMojo = new StringBuilder();
for (int i = 1 ; i <= 5 ; i++){
String[] before = splitMojo[i].split("&lt;/td&gt;",2);

String[] before = splitMojo[i].split("</td>",2);
System.out.println(i + " " + before[0]);
before = before[0].split("\\(");
// System.out.println(before[0]);
formattedMojo.append(before[0].substring(3) + "\r\n");
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#spring.jpa.hibernate.ddl-auto=create
spring.datasource.url=jdbc:mysql://localhost:3306/reviewdb
spring.datasource.username=springuser
spring.datasource.password=ThePassword
spring.datasource.username=root
spring.datasource.password=PASSWORD

spring.jpa.hibernate.ddl-auto=update

Expand Down
8 changes: 8 additions & 0 deletions usefulLinks.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
installing mysql on aws:

https://tecadmin.net/install-mysql-on-amazon-linux/

configuring the mysql user:

https://spring.io/guides/gs/accessing-data-mysql/

0 comments on commit db8e2a3

Please sign in to comment.