A Python library for using the fckaf.de URL shortener.
Project description
fckafde-shortener
fckafde-shortener is a Python library for interacting with the fckaf.de URL shortener service, which supports anti-nazi initiatives in Germany. This library allows you to:
- Shorten URLs
- De-shorten fckaf.de URLs to reveal the original URL
- Generate forward URLs with appended information
Installation
You can install the library via pip after uploading it to PyPI:
pip install fckafde-shortener
Usage
1. Shorten a URL
Use the shorten_url function to shorten a long URL.
from fckafde_shortener import shorten_url
short_url = shorten_url("https://example.com")
if short_url:
print("Shortened URL:", short_url)
else:
print("Failed to shorten URL.")
2. De-shorten a fckaf.de Short URL
Use the de_shorten_url function to retrieve the original URL from a fckaf.de short URL.
from fckafde_shortener import de_shorten_url
original_url = de_shorten_url("https://fckaf.de/Xkp")
if original_url:
print("Original URL:", original_url)
else:
print("Failed to retrieve the original URL.")
3. Generate Forward URLs
Use the generate_forward_url function to append additional information to a URL retrieved from a fckaf.de short URL, which will be visible in the URL.
from fckafde_shortener import generate_forward_url
forward_url = generate_forward_url("https://fckaf.de/Xkp", "some-info")
if forward_url:
print("Forward URL:", forward_url)
else:
print("Failed to generate forward URL.")
Requirements
- Python 3.6 or newer
requestsbeautifulsoup4
Install dependencies with:
pip install requests beautifulsoup4
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fckafde_shortener-0.1.0.tar.gz.
File metadata
- Download URL: fckafde_shortener-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e0320ca75a4bb887a6c128431cb650ef63c1ec8685eb7054ec24e20f722cc97
|
|
| MD5 |
530966232a655fe3307473b8197892ff
|
|
| BLAKE2b-256 |
4c38eac93cdb3c6450e30d0ba47e3910e38646784e53fa58eb2a423d78974842
|
File details
Details for the file fckafde_shortener-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fckafde_shortener-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
517a3ef2960cede0ac9884068da38053067bdd0705eb46a17f01ef6e8be8c7c9
|
|
| MD5 |
3c08266bf0dd4c11808ca906e56dbed3
|
|
| BLAKE2b-256 |
6d9cb0bc39be3ac844aa3b6fdd8e4784f1970e8aa2ce849ae7aa9c17c852f337
|