Created
March 20, 2013 09:39
-
-
Save follesoe/5203471 to your computer and use it in GitHub Desktop.
Consuming RegObs OData Feed from F#
This file contains hidden or 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
#r "FSharp.Data.TypeProviders" | |
#r "System.Data.Services.Client" | |
open System | |
open Microsoft.FSharp.Linq | |
open Microsoft.FSharp.Data.TypeProviders | |
type RegObs = ODataService<"http://api.nve.no/hydrology/regobs/v0.8.7/Odata.svc"> | |
let data = RegObs.GetDataContext() | |
let ava = query { | |
for a in data.AvalancheObs do | |
where (a.Comment.Length > 0) | |
sortByDescending a.DtAvalancheTime | |
take 10 | |
select a | |
} | |
ava |> Seq.iter(fun a -> printfn "(%A): %s" a.DtAvalancheTime a.Comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment