Skip to content

Commit

Permalink
added jar file
Browse files Browse the repository at this point in the history
and handled optimized code
  • Loading branch information
sushantAtwork committed Oct 27, 2024
1 parent be8ce3d commit 48d1472
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/com/company/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void main(String[] args) throws IOException, InterruptedException,
Jedis jedis = null;
try {
// Connect to Redis
String redisUri = "redisUri";
String redisUri = "";
jedis = new Jedis(redisUri);
System.out.println("Connection to server successful");
} catch (Exception e) {
Expand Down Expand Up @@ -60,14 +60,15 @@ public static void main(String[] args) throws IOException, InterruptedException,
String time = extractTime(resp);
isFourHoursDiff = isTimeDifferenceFourHours(time);
if (!isFourHoursDiff) {
System.out.println("Retrieving Data...");
jsonObject = new JSONObject(resp);
jsonObject1 = new JSONObject(jsonObject.get("main").toString());
jsonObject2 = new JSONObject(jsonObject.get("wind").toString());
jsonArray = new JSONArray(jsonObject.get("weather").toString());
}
}
if (isFourHoursDiff || resp == null) {
System.out.println("Fetching Data");
if (isFourHoursDiff) {
System.out.println("Fetching Data....");
city = space(city);
String rawUrl = "https://api.openweathermap.org/data/2.5/weather?q=" + city + "&appid={{API_KEY_OPEN_WEATHER}}";
var url = rawUrl;
Expand Down
Binary file modified temprature_cli_java.jar
Binary file not shown.

0 comments on commit 48d1472

Please sign in to comment.