-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86fa76c
commit 00398e2
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Hello kind contributor👋 | ||
#### I'm very happy that you decided to contribute to this small project | ||
|
||
## Contribution | ||
### If you're a developer: | ||
1. Fork this repo | ||
2. Make changes on fork | ||
3. Test the code | ||
4. Write a description of what are the changes you made & reason | ||
5. Create a pull request from your repository to the main repository | ||
|
||
### End user who found a bug: | ||
1. Go to issues of main repository | ||
2. Create new issue | ||
3. Describe the problem you faced; better if you can provide screenshot | ||
4. Don't forget to add Fedora version and on what architecture & mirror you faced problem | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Hello humble learner👋 | ||
Let me tell you how I made this script. | ||
|
||
### Flow of the script: | ||
|
||
**index.py** -> **system_info.py** -> **scrape.py** -> **speedtest.py** | ||
|
||
|
||
### Description of the files | ||
|
||
|
||
**index.py** is the entrypoint. Here I'm importing all the | ||
dependent files, displaying brand name & version | ||
|
||
**system_info.py** fetches system info such as Fedora version & architecture by | ||
running the command `hostnamectl` with `grep` and gives the data back to **index.py** | ||
|
||
**scrape.py** used for scraping mirror list from Fedora mirror manager using `beautifulsoup4`. After fetching system info **index.py** calls this file | ||
1. From Fedora version & architecture it fetches HTML of mirror manager e.g. `https://admin.fedoraproject.org/mirrormanager/mirrors/Fedora/38/x86_64` | ||
2. From that it filters out all the `<td>` as they contain country name & mirror address | ||
3. From them it traverse through all of them | ||
- If it finds two capital letters e.g. `AU`, it saves in a variable | ||
- If it finds URL: filters for Fedora mirrors & removes Fedora EPEL & others | ||
- Saves filtered urls into dictionary with country code as key e.g. `{AU:[mirror1_URL, mirror2_URL]}` | ||
4. After all the country is fetched, sends the data back to **index.py** | ||
|
||
**speedtest.py** file responsible for measuring speed of each mirror by downloading a small file | ||
1. First it checks if the version is `development` or `release` version with a simple `request` script. According to that it downloads different files | ||
2. After that from the mirror list it downloads `efiboot.img` file from each of the mirrors and displays the download speed. |