Skip to content

Commit

Permalink
Readme updates
Browse files Browse the repository at this point in the history
  • Loading branch information
0xMarcio committed Jun 10, 2024
1 parent ce630fb commit 4b9c536
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Binary file added .github/.DS_Store
Binary file not shown.
12 changes: 6 additions & 6 deletions .github/getTrending.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ def time_ago(datetime_str):

current_year = datetime.now().year
total_repos_per_year = {}
tz_header = {"Time-Zone": "Europe/Amsterdam"}
#tz_header = {"Time-Zone": "Europe/Amsterdam"}

repositories_by_year = {}
for year in range(current_year, current_year - 5, -1):
year_repositories = []
print(f"Fetching data for {year}")
response = requests.get(f'https://api.github.com/search/repositories?q=CVE-{year}%20in:name%20language:Shell%20language:Go%20language:ASP%20language:WebAssembly%20language:R%20language:Lua%20language:Python%20%20%20language:C++%20language:C%20language:JavaScript%20language:Perl%20language:PowerShell%20language:Ruby%20language:Rust%20language:Java%20%20language:PHP&s=updated&o=desc&page=1&per_page=100', headers=tz_header)
response = requests.get(f'https://api.github.com/search/repositories?q=CVE-{year}%20in:name%20%20stars:>2%20language:Shell%20language:Go%20language:ASP%20language:WebAssembly%20language:R%20language:Lua%20language:Python%20%20%20language:C++%20language:C%20language:JavaScript%20language:Perl%20language:PowerShell%20language:Ruby%20language:Rust%20language:Java%20%20language:PHP&s=updated&o=desc&page=1&per_page=20')
if response.status_code != 200:
print(f"Failed to fetch data for year {year}: {response.status_code}")
continue
Expand All @@ -55,7 +55,7 @@ def time_ago(datetime_str):

if year_repositories:
# Sort the repositories by stargazers_count in descending order
year_repositories.sort(key=lambda repo: repo['stargazers_count'], reverse=True)
#year_repositories.sort(key=lambda repo: repo['stargazers_count'], reverse=True)
repositories_by_year[year] = year_repositories

# Define a class to handle repository information
Expand All @@ -73,18 +73,18 @@ def __hash__(self):
def __eq__(self, other):
return self.html_url == other.html_url and self.name == other.name

final_output = ["# Trending Proof-of-Concept exploits"]
final_output = ['<h1 align="center">Recently updated Proof-of-Concepts</h1>']
for year in range(current_year, current_year - 5, -1):
if year in repositories_by_year:
year_repositories = repositories_by_year[year]
year_repositories = [RepositoryInfo(repo["description"], repo["stargazers_count"], repo["name"], repo["html_url"], repo["updated_at"]) for repo in year_repositories]

final_output.append(f"\n\n## {year}\n")
final_output.append(f"### Top 10 of {total_repos_per_year[year]} Repositories\n")
final_output.append(f"### Latest 20 of {total_repos_per_year[year]} Repositories\n")
final_output.append("| Stars | Updated | Name | Description |")
final_output.append("| --- | --- | --- | --- |")

for repo in year_repositories[:10]:
for repo in year_repositories:
try:
description = repo.description or ""
updated = time_ago(repo.updated_at)
Expand Down

0 comments on commit 4b9c536

Please sign in to comment.