forked from octokit/octokit.net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path07-search-for-repos.linq
30 lines (28 loc) · 990 Bytes
/
07-search-for-repos.linq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<Query Kind="Program">
<Reference><RuntimeDirectory>\System.Net.Http.dll</Reference>
<Reference><RuntimeDirectory>\System.Runtime.dll</Reference>
<NuGetReference>Octokit</NuGetReference>
<NuGetReference>Octokit.Reactive</NuGetReference>
<Namespace>System.Reactive.Linq</Namespace>
<Namespace>System.Net.Http.Headers</Namespace>
<Namespace>Octokit</Namespace>
<Namespace>System.Threading.Tasks</Namespace>
</Query>
async Task Main(string[] args)
{
//This makes discovering code fun!!
var client = new GitHubClient(new Octokit.ProductHeaderValue("octokit"));
var gorepos = await client.Search.SearchRepo(new SearchRepositoriesRequest()
{Language = Language.Go});
gorepos.Items.OrderByDescending (i => i.CreatedAt)
.OrderByDescending (i => i.StargazersCount)
.Take(50)
.Select (i => new {
Name = i.Name,
Description = i.Description ,
LastUpdated = i.UpdatedAt,
Url = i.HtmlUrl,
WatchCount = i.StargazersCount
})
.Dump();
}