Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #r "FSharp.Data.dll"
- open System
- open System.Collections.Generic
- open FSharp.Data
- let getCities =
- fun () ->
- let mutable continueLooping = true
- let cities = new List<string>()
- while continueLooping do
- Console.Write "Enter city to visualize: "
- let city = Console.ReadLine()
- if city = "end" then
- continueLooping <- false
- else
- cities.Add(city)
- (cities)
- let klvToFarnht (k:float) =
- fun () ->
- ((k - 273.15)*1.8000 + 32.00)
- [<Literal>]
- let sample = "http://api.openweathermap.org/data/2.5/weather?q=London"
- let apiUrl = "http://api.openweathermap.org/data/2.5/weather?q="
- type Weather = JsonProvider<sample>
- for i in getCities() do
- let sf = Weather.Load(apiUrl + i)
- Console.WriteLine klvToFarnht sf.Main.Temp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement