
Ask HN: How do I search source code of popular projects only? - zb3
I&#x27;ve tried to search code on GitHub, Codesearch, Krugle, openhub etc, but I&#x27;ve run into a strange problem.<p>Every time I would like to see how some feature is being used in practice, I am bombarded with results coming from small, &quot;Hello World&quot;ish projects, that are mostly unknown, and therefore not reviewed, and don&#x27;t really show how a feature can be used in practice.
Even worse, since I am searching for a C code, they could exhibit some bad practices I&#x27;d like to avoid...<p>I couldn&#x27;t find any option to sort the code by any popularity factor like stars, forks, or even issues...
On GitHub, I can only sort repositories by stars or forks, not the code results.<p>So is there any way to limit code results to projects that are somewhat popular? Did I miss any switch?
======
madhouse
You can limit your search to certain repositories on GitHub, with advanced
search:
[https://github.com/search/advanced](https://github.com/search/advanced)

You will need to enter the repositories by hand, though. Mind you, writing a
small tool that'd list the most popular/forked/starred/etc C repos, and do a
search for you in those should be a few minute task.

~~~
cweagans
Couldn't you just ask for repos with > 5-10 stars instead of maintaining a
list of popular C projects?

~~~
zb3
The whole point was that I cannot specify this criteria when searching for
code. This option is for repository search only.

Searching: "typedef struct language:C stars:>100" doesn't do the job.

~~~
i336_
I would consider this both an unimplemented-feature use-case argument, _and_ a
bug, because while 'language:C' works in both Repository and Code search mode,
'stars:>100' only works in Repository mode, yet the 'Cheat sheet' link at the
bottom doesn't reflect this fact. Either the documentation needs to match the
functionality, or ideally, the functionality needs to match the documentation
(and intuition). :P

[https://github.com/contact](https://github.com/contact)

FYI, this form works, you do actually get feedback :)

------
0x400614
Github sucks at code search. Have you heard of OpenGrok?

