Skip to content

Commit

Permalink
run black on scripts folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Nfsaavedra committed Mar 19, 2024
1 parent ed865f6 commit f7a12ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
11 changes: 4 additions & 7 deletions scripts/docker_images_scraper.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import requests

next_url = "https://hub.docker.com/api/content/v1/products/search?image_filter=official&page=1&page_size=100&q=&type=image"
headers = {
"Accept": "application/json",
"Search-Version": "v3"
}
headers = {"Accept": "application/json", "Search-Version": "v3"}

images_list = []

while next_url:
res = requests.get(next_url, headers=headers).json()
next_url = res['next']
images = [i['name'] for i in res['summaries']]
next_url = res["next"]
images = [i["name"] for i in res["summaries"]]
images_list += images

with open("official_images", 'w') as f:
with open("official_images", "w") as f:
f.write("\n".join(images_list))
8 changes: 4 additions & 4 deletions scripts/obsolete_commads_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
page = requests.get(URL)

soup = BeautifulSoup(page.content, "html.parser")
table = soup.find('table', cellpadding="5", border="1")
tds = table.find_all('td', valign='top')
table = soup.find("table", cellpadding="5", border="1")
tds = table.find_all("td", valign="top")
obsolete = [td.text for td in tds if len(td) == 1]

with open("obsolete_commands", 'w') as f:
f.write("\n".join(obsolete))
with open("obsolete_commands", "w") as f:
f.write("\n".join(obsolete))

0 comments on commit f7a12ed

Please sign in to comment.