Getting all search results from Github API - github

I was trying to search Github for all repositories that contains the word article in the readme.
I tried two methods:
API: https://api.github.com/search/repositories?q=article&in=readme.
Github Search box: https://github.com/search?utf8=%E2%9C%93&q=article+in%3Areadme&type=Repositories&ref=searchresults
The first methods says there are total 9921 results, "total_count": 9921, whereas the search box finds 77638 repositories.
Why the discrepancy?

The advanced search page shows that:
in: is only for code search
a general term is used for all searches (-in: is ignored for those searches, except for code search)
So:
9921 is the number of readme file with article in it
77638 is the number of repo including an article file, or artienter code herecle in their titles.

Related

How do I search the readme of repositories using Github Search API?

My objective is to count the number of repositories that use PyTorch. Therefore, I came up with the following code, using the THUNDER CLIENT extension in VS Code -
https://api.github.com/search/repositories?q=language:python + readme:PyTorch
However, this gives me just 7 search results. I am confident the result should be in the range of thousands. Could someone suggest where I am going wrong?
The GitHub search API for repositories checks the name, description and the README of all repositories.
Therefore, all that was needed to be done was -
https://api.github.com/search/repositories?q=PyTorch

GitHub search: how to exclude multiple authors from the search result?

I know I can exclude one author by -author:someone, but it looks like excluding 2 authors doesn't work: -author:user1 -author:user2. The result will include the user2.
I read GitHub search syntax doc but could find a solution.
Is there a way to exclude 2 authors at the same time?
I don't seem to be facing the same issue as you for some reason. I tried searching "rust" in:name, to show all repos matching the exact phrase "rust", which gave me the following results (you can view them on GitHub here):
screenshot of searching "rust" in:name on GitHub
I then searched "rust" in:name -user:rust-lang -user:TheAlgorithms -user:tensorflow (view them on GitHub here) to exclude the first 3 authors from the results, which worked a charm:
screenshot of searching "rust" in:name -user:rust-lang -user:TheAlgorithms -user:tensorflow on GitHub

Search code in the repositories whose name contains a keyword

In github search, the following string allows me to search JavaScript code that contain Acode in all the repositories of the user NameOfUser:
user:NameOfUser language:JavaScript ACode
Now, I would like to add another condition: i am only interested in the code containing ACode in the repositories whose name contains repokey.
Does anyone know how to write the request?
The search API already does this. You can just use the search that you've posted above to search for repositories containing the text you've specified.
For example...
user:mrdoob language:JavaScript Three Extension
returns this...
https://github.com/search?utf8=%E2%9C%93&q=user%3Amrdoob+language%3AJavaScript+Three+Extension&type=Repositories&ref=searchresults
As above answer I also tried with type=Code and added a "WebGLBufferRenderer" keyword, See if it helps:
https://github.com/search?utf8=%E2%9C%93&q=user%3Amrdoob+language%3AThree+Extension+WebGLBufferRenderer&type=Code&ref=searchresults

GitHub Repository search using partial or begins-with

I would like to do a code search in a collection of repositories. I would like to restrict my search using a pattern or naming convention in the repository name.
1) I can limit my search by the organization.
Example: "user:google"
2) I can search a single repository directly.
Example: "repo:google/devtoolsExtended test"
So, is it possible to search all repositories that begin with a pattern?
Equivalent to: "repo:google/dev* test"
In order to search for repositories all you need to do is just type in your query, like the following:
https://github.com/search?q=foo
This finds repos such as FooTable and foodme as well, as if we searched for foo*. If you want to limit your search to the repository name only, use in:name, which results in:
https://github.com/search?q=foo+in%3Aname&type=Repositories
There's no explicit method of searching by begins with or using wildcards, but results for those kinds of searches appear as well.
Sources:
GitHub Help: Searching repositories

Online like diff tool view for w3c.org documents

Once I saw somewhere a sly link to w3c.org document. And it was suffixed by "diff" or something like, for instance: http://www.w3.org/TR/selectors-api2/diff/bla-bla-bla.
And it show what was added, what was removed like in diff tool.
So my question is, how can I view diff between documents on w3c.org without externall tools?
You're looking for this service:
http://services.w3.org/htmldiff
(was found by googeling: w3c diff, second result).
Example: http://services.w3.org/htmldiff?doc1=&doc2=http%3A%2F%2Fwww.w3.org%2FTR%2Fselectors-api2%2F