diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..0e07099 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,10 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "fable": { + "version": "4.14.0", + "commands": ["fable"] + } + } +} diff --git a/backers.fsx b/backers.fsx new file mode 100644 index 0000000..0cc9c61 --- /dev/null +++ b/backers.fsx @@ -0,0 +1,34 @@ +#r "nuget: Fable.Fetch, 2.6.0" + +open Fable.Core +open Fetch + +type Member = {| + isActive: bool + role: string + name: string + profile: string + image: string option + company: string option +|} + +fetch "https://opencollective.com/amplifying-fsharp/members/all.json" [] +|> Promise.bind (fun res -> res.json()) +|> Promise.iter (fun json -> + json + |> JS.Constructors.Array.from + |> Array.filter (fun m -> m.isActive && m.role = "BACKER") + |> Array.iter (fun m -> + let markdownImage = + match m.image with + | None -> "" + | Some image -> $"![%s{m.name}](%s{image}&s=50) " + + let andCompany = + match m.company with + | None -> "" + | Some company -> $", %s{company}" + + JS.console.log ($"%s{markdownImage}[%s{m.name}%s{andCompany}](%s{m.profile})\n") + ) +) \ No newline at end of file