andybest
V2EX  ›  问与答

GitHub 能搜索代码吗?

  •  1
     
  •   andybest · Apr 29, 2014 · 4098 views
    This topic created in 4578 days ago, the information mentioned may be changed or developed.
    比如我想统计一下使用 getUser 与 get_user 变量/方法名的代码总数对比
    如何实现?
    4 replies  •  2014-04-29 21:24:53 +08:00
    akfish
    akfish
    Apr 29, 2014❤️1
    1
    当然能,最顶上不是一个搜索框。。。。。
    API的话:
    https://developer.github.com/v3/search/#search-code
    不过貌似搜索只是简单的匹配,并没有对代码做解析。
    andybest
    andybest
    OP
    Apr 29, 2014
    2
    @akfish 谢谢,我脑残了,没看到左边有 code 的选项,默认只搜索了 Repositories
    weakish
    weakish
    Apr 29, 2014
    4
    @andybest 针对你的需求,搜索只能是粗略的感觉了。GitHub 有开放大数据接口,可以自己下载下来慢慢分析,也可以用 Google BigQuery 实时查询 http://segmentfault.com/a/1190000000448830

    这样出来的统计的结果比较精确。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2359 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 13:10 · PVG 21:10 · LAX 05:10 · JFK 08:10
    ♥ Do have faith in what you're doing.