Last active
January 18, 2021 05:34
-
-
Save gistlyn/166fc83646f5e15f8caa2e80a763305f to your computer and use it in GitHub Desktop.
Simple VB .NET 5 Console App
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net5.0</TargetFramework> | |
<NoWarn>1591</NoWarn> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="ServiceStack.Common" Version="5.*" /> | |
</ItemGroup> | |
</Project> |
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
Imports System.Linq | |
Imports System.Net | |
Imports ServiceStack | |
Imports ServiceStack.Text | |
Module Program | |
Public Class GithubRepo | |
Public Property Name As String | |
Public Property Description As String | |
Public Property Url As String | |
Public Property Homepage As String | |
Public Property Language As String | |
Public Property Watchers As Integer | |
Public Property Forks As Integer | |
End Class | |
Sub Main(args As String()) | |
Dim orgName As String = "dotnet" | |
Dim orgRepos = $"https://api.github.com/orgs/{orgName}/repos" _ | |
.GetJsonFromUrl(Sub(httpReq) httpReq.UserAgent = "gist.cafe") _ | |
.FromJson(Of GithubRepo())() _ | |
.OrderByDescending(Function(x) x.Watchers) | |
Console.WriteLine($"Top 3 '{orgName}' Github Repos:") | |
orgRepos.Take(3).ToList().PrintDump() | |
Console.WriteLine($"{vbCrLf}Top 10 {orgName} Github Repos:{vbCrLf}") | |
orgRepos.Take(10).Select(Function(x) _ | |
New With { x.Name, x.Language, x.Watchers, x.Forks }).PrintDumpTable() | |
Inspect.vars(New With { orgRepos }) | |
End Sub | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment