MCPcopy Create free account
hub / github.com/C3ting/ARL / github_search_code

Function github_search_code

arl_tool/GithubLeak.py:69–86  ·  view source on GitHub ↗
(query, order="desc", sort="indexed", per_page=100, page=1)

Source from the content-addressed store, hash-verified

67
68
69def github_search_code(query, order="desc", sort="indexed", per_page=100, page=1):
70 url = "https://api.github.com/search/code"
71 params = {
72 "q": query,
73 "order": order,
74 "sort": sort,
75 "per_page": per_page,
76 "page": page
77 }
78
79 data = github_client(url, params=params)
80 logger.info("search {} count {}".format(query, data["total_count"]))
81 ret_list = []
82 for item in data["items"]:
83 result = GithubResult(item=item)
84 ret_list.append(result)
85
86 return ret_list
87
88
89def github_client(url, params=None):

Callers 1

searchMethod · 0.70

Calls 2

github_clientFunction · 0.70
GithubResultClass · 0.70

Tested by

no test coverage detected