-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from deprecated Dark Sky API to OpenWeather API
- Loading branch information
1 parent
c7a533f
commit bdc3158
Showing
10 changed files
with
125 additions
and
97 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
// Reference: based on video by Genuine Coder (https://www.youtube.com/watch?v=A7HAB5whD6I) | ||
public class Email { | ||
private static String appEmail = "[email protected]"; | ||
private static String appPassword = "javaiscool"; | ||
private static String appPassword = System.getenv("APP_PASS"); | ||
|
||
public static void sendMail(User recipient, Location alertedLocation) throws Exception { | ||
System.out.println("Preparing to send email..."); | ||
|
@@ -53,8 +53,7 @@ private static Message generateMessage(Session session, String recipientEmail, L | |
message.setText(alert.getTitle() + "\n" | ||
+ "Time: " + alert.getTime() + "\n" | ||
+ "Expires: " + alert.getExpires() + "\n\n" | ||
+ alert.getDescription() + "\n" | ||
+ "For more information: " + alert.getUri()); | ||
+ alert.getDescription() + "\n"); | ||
return message; | ||
} catch (Exception e) { | ||
Logger.getLogger(Email.class.getName()).log(Level.SEVERE, null, e); | ||
|
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
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
Oops, something went wrong.