コード例 #1
0
    public async Task SearchForCSharpRepositories()
    {
        var request = new SearchRepositoriesRequest("csharp");
        var repos = await _gitHubClient.Search.SearchRepo(request);

        Assert.NotEmpty(repos.Items);
    }
コード例 #2
0
ファイル: HubbClient.cs プロジェクト: nigel-sampson/talks
        public async Task<IReadOnlyList<Repository>> SearchAsync(string term)
        {
            var search = new SearchRepositoriesRequest("caliburn")
            {
                Language = Language.CSharp,
                PerPage = 25
            };

            var results = await gitHubClient.Search.SearchRepo(search);

            return results.Items;
        }
        private static void Main()
        {
            var buildFolder = GetBuildFolder();

            var searchClient = new SearchClient(new ApiConnection(new Connection(new ProductHeaderValue("test"))));
            var searchRepositoriesRequest = new SearchRepositoriesRequest
            {
                Language = Language.CSharp,
                Forks = Range.GreaterThan(400) // 15 gets 75 projects for F#
            };

            var searchRepositoryResult =
                searchClient.SearchRepo(searchRepositoriesRequest)
                    .Result.Items.ToList();

            DownloadProjectsFromGitHub(searchRepositoryResult, buildFolder);

            AttemptToBuildProjects(buildFolder);

            Console.WriteLine("Finished. Press any key.");
            Console.ReadKey();
        }
コード例 #4
0
 /// <summary>
 /// search repos
 /// http://developer.github.com/v3/search/#search-repositories
 /// </summary>
 /// <param name="search"></param>
 /// <returns>List of repos</returns>
 public Task <IReadOnlyList <Repository> > SearchRepo(SearchRepositoriesRequest search)
 {
     Ensure.ArgumentNotNull(search, "search");
     return(ApiConnection.GetAll <Repository>(ApiUrls.SearchRepositories(), search.Parameters));
 }
コード例 #5
0
 public Task <SearchRepositoryResult> SearchRepo(SearchRepositoriesRequest search)
 {
     Ensure.ArgumentNotNull(search, nameof(search));
     return(ApiConnection.Get <SearchRepositoryResult>(ApiUrls.SearchRepositories(), search.Parameters));
 }
コード例 #6
0
ファイル: SearchClient.cs プロジェクト: alexgyori/octokit.net
 /// <summary>
 /// search repos
 /// http://developer.github.com/v3/search/#search-repositories
 /// </summary>
 /// <param name="search"></param>
 /// <returns>List of repos</returns>
 public Task<SearchRepositoryResult> SearchRepo(SearchRepositoriesRequest search)
 {
     Ensure.ArgumentNotNull(search, "search");
     return ApiConnection.Get<SearchRepositoryResult>(ApiUrls.SearchRepositories(), search.Parameters);
 }
コード例 #7
0
ファイル: HomeController.cs プロジェクト: hahmed/Sprint
        public async Task<ActionResult> Stats()
        {
            var vm = new StatsViewModel();

            var issueSearch = new SearchIssuesRequest
            {
                Comments = Range.GreaterThan(25),
                Created = DateRange.GreaterThan(new DateTime(DateTime.Now.Year, 01, 01)),
                SortField = IssueSearchSort.Comments,
                Language = Language.Ruby,
                Order = SortDirection.Descending
            };
            var mostCommented = await _githubClient.Search.SearchIssues(issueSearch);
            vm.MostCommentedIssue = mostCommented.Items.OrderByDescending(x=> x.Comments).Take(10).ToList();

            var repoSearch = new SearchRepositoriesRequest
            {
                Created = DateRange.GreaterThan(new DateTime(DateTime.Now.Year, 01, 01)),
                Language = Language.CSharp,
                SortField = RepoSearchSort.Stars,
                Order = SortDirection.Descending
            };
            var mostStarred = await _githubClient.Search.SearchRepo(repoSearch);
            vm.MostStarred = mostStarred.Items.Take(10).ToList();

            var repo = new RepositoryCollection();
            repo.Add("rails", "rails");
            issueSearch = new SearchIssuesRequest
            {
                 Repos = repo,
                 Created = DateRange.GreaterThan(new DateTime(DateTime.Now.Year, 01, 01)),
            };
            var railsIssues = await _githubClient.Search.SearchIssues(issueSearch);
            var dic = new Dictionary<DayOfWeek, List<Issue>>();
            foreach (var issue in railsIssues.Items)
            {
                if(dic.ContainsKey(issue.CreatedAt.DayOfWeek))
                {
                    dic[issue.CreatedAt.DayOfWeek].Add(issue);
                }
                else
                {
                    dic.Add(issue.CreatedAt.DayOfWeek, new List<Issue> { issue });
                }
            }

            vm.RailsIssues = dic;

            return View(vm);
        }
コード例 #8
0
ファイル: SearchClient.cs プロジェクト: pgarbe/octokit.net
 /// <summary>
 /// search repos
 /// http://developer.github.com/v3/search/#search-repositories
 /// </summary>
 /// <param name="search"></param>
 /// <returns>List of repos</returns>
 public Task<IReadOnlyList<Repository>> SearchRepo(SearchRepositoriesRequest search)
 {
     Ensure.ArgumentNotNull(search, "search");
     return ApiConnection.GetAll<Repository>(ApiUrls.SearchRepositories(), search.Parameters);
 }