From c77a66dba85e330a6e9d07a3904f5514a9841423 Mon Sep 17 00:00:00 2001 From: tyeth Date: Thu, 7 Mar 2024 15:42:29 +0000 Subject: [PATCH] WIP: revert --- board-url-test.py | 36 ++++++++++++++++++++++++++++++++++++ quick_test.sh | 3 +++ 2 files changed, 39 insertions(+) create mode 100644 board-url-test.py create mode 100644 quick_test.sh diff --git a/board-url-test.py b/board-url-test.py new file mode 100644 index 0000000..9bd6a8e --- /dev/null +++ b/board-url-test.py @@ -0,0 +1,36 @@ + +import requests +from requests.exceptions import SSLError, RequestException + +# List of URLs to check +urls = [ + "https://adafruit.github.io/arduino-board-index/package_adafruit_index.json", + "http://arduino.esp8266.com/stable/package_esp8266com_index.json", + "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json", + "https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json", + "https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json", + "http://drazzy.com/package_drazzy.com_index.json", + "http://drazzy.good-enough.cloud/package_drazzy.com_index.json" +] + +def check_url(url): + try: + # Attempt to request URL with SSL verification + response = requests.get(url) + response.raise_for_status() # Raise an error for bad status codes + print(f"URL accessible: {url}") + except SSLError as ssl_error: + print(f"URL failed with SSL error: {url}, Error: {ssl_error}, retrying without SSL verification...") + # Retry without SSL verification if an SSL error occurs + try: + response = requests.get(url, verify=False) + response.raise_for_status() + print(f"URL accessible (without SSL verification): {url}") + except RequestException as e: + print(f"URL still failed after disabling SSL verification: {url}, Error: {e}") + except RequestException as e: + # Handle other errors + print(f"URL failed: {url}, Error: {e}") + +for url in urls: + check_url(url) diff --git a/quick_test.sh b/quick_test.sh new file mode 100644 index 0000000..9b41ff4 --- /dev/null +++ b/quick_test.sh @@ -0,0 +1,3 @@ +repo_topics=$(curl -f --request GET --url "https://api.github.com/repos/$GITHUB_REPOSITORY" || echo '{"topics":[]}') +repo_topics=$(echo $repo_topics | jq -r '.topics[]' ) +echo $repo_topics \ No newline at end of file