|
6 | 6 | [](https://img.shields.io/github/commit-activity/m/stringertheory/clean-links) |
7 | 7 | [](https://img.shields.io/github/license/stringertheory/clean-links) |
8 | 8 |
|
9 | | -Tools for cleaning up linkss |
| 9 | +Tools for cleaning up links. |
10 | 10 |
|
11 | | -- **Github repository**: <https://github.com/stringertheory/clean-links/> |
12 | | -- **Documentation** <https://stringertheory.github.io/clean-links/> |
| 11 | +Remove cruft from URLs using the rules from |
| 12 | +https://github.com/ClearURLs/Rules |
13 | 13 |
|
14 | | -## Getting started with your project |
| 14 | +Unshorten URLs by making requests and following redirects. |
15 | 15 |
|
16 | | -First, create a repository on GitHub with the same name as this project, and then run the following commands: |
| 16 | +Are these two links the same? |
17 | 17 |
|
18 | | -```bash |
19 | | -git init -b main |
20 | | -git add . |
21 | | -git commit -m "init commit" |
22 | | -git remote add origin [email protected]:stringertheory/clean-links.git |
23 | | -git push -u origin main |
24 | | -``` |
25 | | - |
26 | | -Finally, install the environment and the pre-commit hooks with |
27 | | - |
28 | | -```bash |
29 | | -make install |
30 | | -``` |
31 | | - |
32 | | -You are now ready to start development on your project! |
33 | | -The CI/CD pipeline will be triggered when you open a pull request, merge to main, or when you create a new release. |
| 18 | +```python |
| 19 | +link1 = "https://trib.al/5m7fAg3" |
| 20 | +link2 = "https://bit.ly/dirtylank" |
34 | 21 |
|
35 | | -To finalize the set-up for publishing to PyPi or Artifactory, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/publishing/#set-up-for-pypi). |
36 | | -For activating the automatic documentation with MkDocs, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/mkdocs/#enabling-the-documentation-on-github). |
37 | | -To enable the code coverage reports, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/codecov/). |
| 22 | +resolved1 = unshorten_url(link1).get("resolved") |
| 23 | +cleaned1 = clear_url(resolved1) |
38 | 24 |
|
39 | | -## Releasing a new version |
| 25 | +resolved2 = unshorten_url(link2).get("resolved") |
| 26 | +cleaned2 = clear_url(resolved2) |
40 | 27 |
|
41 | | -- Create an API Token on [Pypi](https://pypi.org/). |
42 | | -- Add the API Token to your projects secrets with the name `PYPI_TOKEN` by visiting [this page](https://github.com/stringertheory/clean-links/settings/secrets/actions/new). |
43 | | -- Create a [new release](https://github.com/stringertheory/clean-links/releases/new) on Github. |
44 | | -- Create a new tag in the form `*.*.*`. |
45 | | - |
46 | | -For more details, see [here](https://fpgmaas.github.io/cookiecutter-poetry/features/cicd/#how-to-trigger-a-release). |
47 | | - |
48 | | ---- |
49 | | - |
50 | | -Repository initiated with [fpgmaas/cookiecutter-poetry](https://github.com/fpgmaas/cookiecutter-poetry). |
| 28 | +cleaned1 == cleaned2 # True! |
| 29 | +``` |
0 commit comments