Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I make the repository search run within the topic? #1704

Closed
it19862 opened this issue Nov 4, 2017 · 4 comments
Closed

How do I make the repository search run within the topic? #1704

it19862 opened this issue Nov 4, 2017 · 4 comments

Comments

@it19862
Copy link

it19862 commented Nov 4, 2017

The code to search for "github.com" repositories:

```
 public async void searchReposit_GitHub() 
	        {
	
	            var client = new GitHubClient(new ProductHeaderValue("my-cool-app")); 
	            var basicAuth = new Credentials("username", "password"); 
	
	            client.Credentials = basicAuth;
	
	            
	            var request = new SearchRepositoriesRequest("mvc client side framework") 
	            {   
	                //  // or go all out and search the readme, name or description?
	                 In = new[] { InQualifier.Readme, InQualifier.Description, InQualifier.Name },
	             
	            };            
	
	            var result = await client.Search.SearchRepo(request);
	
	
	            for (int s = 0; s < 3; s++)
	            {
	                var vr = result.Items[s];
	
	                string readme_content;
	                string readme_name;
	                string readme_descript;
	                string readme_Html_url;
	
	                readme_name = vr.Name;
	                readme_descript = vr.Description;
					readme_Html_url = vr.HtmlUrl; 
					
					 try
	                {
	                    var readme = await client.Repository.Content.GetReadme(vr.Id);
	                    var rawText = readme.Content;
	                
	     				readme_content = rawText.ToString();
	                    richTextBox1.AppendText(" Сontent `readme` *** " + readme_content + " *** \r\n"); 
	                }
	                catch (Exception)
	                {
	                    richTextBox1.AppendText(" Сontent `readme` -  empty ххх" +  " \r\n"); // url
	                    // return;
	                    // throw;
	                }
					
	            }
			}
				


There is a theme https://github.com/topics/chrome-extensions

Question
How to make the code look inside: https://github.com/topics/chrome-extensions
@ryangribble
Copy link
Contributor

Are you saying you want to access the "topics" for a given repo?

@it19862
Copy link
Author

it19862 commented Nov 4, 2017

@ryangribble
I'm sorry, I still do not understand the structure of "github.com".

How to understand the place github.com/topics/chrome-extensions

"Chrome extension" is the theme in which the repositories are located?
or
"Chrome extension" - a repository in which there are nested repositories?

"Chrome extension" contains 95 pieces of repositories.

Question
How to search in the files "README.MD", which are located in repositories (95 pieces of repositories) in the topic "Chrome extension" (https://github.com/topics/chrome-extensions)?

For example.
Similar topic "API" (https://github.com/topics/api) contains 9039 pieces of repositories.

PS
Sorry if the question (answer) is difficult to perceive.
I do not know much English.
I use - translate.google

@ryangribble
Copy link
Contributor

ryangribble commented Nov 5, 2017

Hi @it19862

What are Topics?

"Chrome extension" is a TOPIC.

A Repository can have as many TOPICs as the owner wants.

BUT a TOPIC does not own a repository... it is like a tag or label on a repository, that can group repositories together that have similar topics.

Does that make sense?

Here is some further information:
https://github.com/blog/2309-introducing-topics
https://help.github.com/articles/about-topics/

Can we search for repositories by topic?

Yes It is possible to search for repositories with a topic: https://help.github.com/articles/searching-repositories/#search-by-repository-topic

But we have not implemented TOPICS in octokit.net yet!

To implement this support we would need to:

  • Add Topic field to Repository and use preview header to enable the field to be returned from the API
  • Add Topic field to SearchRepositoriesRequest so you can search by topic
  • Add Topics field to SearchRepositoriesRequest so you can search by number of topics

@ryangribble
Copy link
Contributor

I've raised #1707 to cover implementing this support in Octokit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants