Esempio n. 1
0
        public List <GithubTag> GetTags(string authorName, string repositoryName)
        {
            var jsonString = _githubApiRequestManager.GetText(GetTagsUrl(authorName, repositoryName));
            var jsonObject = JSON.Parse(jsonString).AsArray;

            return(jsonObject.Childs.Select(child => new GithubTag()
            {
                CommitSha = child["commit"]["sha"].AsString,
                Name = child["name"].AsString
            }).ToList());
        }
Esempio n. 2
0
        public IEnumerable <GithubRepositoriesRegistryEntry> GetGithubRepositoriesRegistry(string url)
        {
            var jsonString = _commonWebRequestManager.GetText(url);
            var json       = JSON.Parse(jsonString).AsArray;


            foreach (var child in json.Childs)
            {
                var title = child["title"].AsString;
                var code  = child["code"];

                var s = GithubSchemeDecoder.DecodeShort(code);

                yield return(new GithubRepositoriesRegistryEntry()
                {
                    Title = title,
                    RepositoryName = s.Name,
                    AuthorName = s.Owner
                });
            }
        }