github-search-zh / test_gh.py
Lowking's picture
Direct update with gemini-3.6-flash model and SOP settings
64e6d24
Raw
History Blame Contribute Delete
646 Bytes
import urllib.request, urllib.parse, json
queries = [
'OCR',
'("ocr" OR "optical character recognition" OR "text recognition" OR "ocr tool") in:name,description,readme'
]
for q in queries:
url = 'https://api.github.com/search/repositories?q=' + urllib.parse.quote(q)
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0', 'Accept':'application/vnd.github.v3+json'})
try:
with urllib.request.urlopen(req) as r:
data = json.loads(r.read())
print(f"Query: {q}")
print(f"Count: {data['total_count']}\n")
except Exception as e:
print(f"Error on {q}: {e}")