Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
weather stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
fulton committed Nov 10, 2019
1 parent e35817f commit 3093672
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/main/java/com/andromeda/araserver/Run.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ public NanoHTTPD.Response serve(NanoHTTPD.IHTTPSession session) {
//Start the Hello function
else if (sessionUri.startsWith("/hi")) main2 = new Hello().hello();
else if (sessionUri.startsWith("/yelpclient")) main2 = new Locdec().main(sessionUri);
else if (sessionUri.startsWith("/searcht")) {
main2 = new GetInfo().main(sessionUri);
}
else if (sessionUri.startsWith("/weat")) main2 = new Weather().getWeatherNow(sessionUri);

else if (sessionUri.startsWith("/math")) main2 = new Equations().main(sessionUri);
else if (sessionUri.startsWith("/update")) main2 = new Update().update(sessionUri);
else if (sessionUri.startsWith("/what")) main2 = new SocialSkills().doYouLike(sessionUri.replace("/what/", ""));
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/com/andromeda/araserver/account/Run.java

This file was deleted.

7 changes: 6 additions & 1 deletion src/main/java/com/andromeda/araserver/skills/Weather.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package com.andromeda.araserver.skills

import com.google.gson.Gson
import com.google.gson.JsonParser
import java.net.URL
import java.util.*

class Weather {
private var log: String? = null
private var lat: String? = null
private var term: String? = null
fun getWeatherNow(url:String){
fun getWeatherNow(url:String): String {
//get api params
val pairs =
ArrayList(listOf(*url.split("&".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()))
Expand All @@ -21,6 +23,9 @@ class Weather {
}
val urlGrid = URL("https://api.weather.gov/points/$lat,$log")
val urlGridData = urlGrid.readText()
val json = JsonParser().parse(urlGridData)
print(json)
return "test"


}
Expand Down

0 comments on commit 3093672

Please sign in to comment.