Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"version": 1,
"isRoot": true,
"tools": {
"fable": {
"version": "4.14.0",
"commands": ["fable"]
}
}
}
34 changes: 34 additions & 0 deletions backers.fsx
Original file line number Diff line number Diff line change
@@ -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<Member>
|> 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")
)
)