atlassian-json/json-backups/sourcetreeapp-archive.csx
2021-01-17 05:03:43 +03:00

16 lines
612 B
C#

#r "nuget: AngleSharp, 1.0.0-alpha-844"
using System.Linq;
System.Console.Out.WriteLine(
"downloads(" + System.Text.Json.JsonSerializer.Serialize(
new AngleSharp.Html.Parser.HtmlParser()
.ParseDocument(
await new System.Net.Http.HttpClient()
.GetStringAsync("https://www.sourcetreeapp.com/download-archives")
.ConfigureAwait(false))
.QuerySelectorAll(".wpl tr div>a")
.Select(row => new { Version = row.TextContent, ZipUrl = row.GetAttribute("href") })
.ToArray()) + ")"
);