Skip to content

Commit

Permalink
Check first 100 results
Browse files Browse the repository at this point in the history
  • Loading branch information
DecimalTurn authored Aug 9, 2024
1 parent 2d1b094 commit e01ed1a
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions .github/workflows/scan_and_suggest.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import requests
import os
import subprocess
import time

def search_github_repos(query, sort='updated', order='desc', per_page=20):
def search_github_repos(query, sort='updated', order='desc', per_page=10, page=1):
url = f"https://api.github.com/search/repositories"
headers = {'Accept': 'application/vnd.github.v3+json'}
params = {
'q': query,
'sort': sort,
'order': order,
'per_page': per_page
'per_page': per_page,
'page': page
}

response = requests.get(url, headers=headers, params=params)
Expand Down Expand Up @@ -60,23 +62,31 @@ def fix_vbnet_issue(repo):

def main():
query = 'VBA'
repos = search_github_repos(query)
query = 'VBA in:name,description'
per_page = 20 # Number of repos to fetch per page
total_pages = 5 # Number of pages to check (you can adjust this value)

for page in range(1, total_pages + 1):
print(f"Fetching page {page}...")
repos = search_github_repos(query, per_page=per_page, page=page)

if repos:
print(f"Found {repos['total_count']} repositories:")
for repo in repos['items']:
if repo['language'] != 'VBA':
print(f"Name: {repo['name']}")
print(f"Description: {repo['description']}")
print(f"Language: {repo['language']}")
print(f"URL: {repo['html_url']}")
print(f"Updated at: {repo['updated_at']}")
print('-' * 40)

if repo['language'] == "Visual Basic .NET":
fix_vbnet_issue(repo)
else:
print("No repositories found.")
if repos:
print(f"Found {repos['total_count']} repositories:")
for repo in repos['items']:
if repo['language'] != 'VBA':
print(f"Name: {repo['name']}")
print(f"Description: {repo['description']}")
print(f"Language: {repo['language']}")
print(f"URL: {repo['html_url']}")
print(f"Updated at: {repo['updated_at']}")
print('-' * 40)

if repo['language'] == "Visual Basic .NET":
fix_vbnet_issue(repo)
else:
print("No repositories found.")

time.sleep(2)

if __name__ == "__main__":
main()

0 comments on commit e01ed1a

Please sign in to comment.