update README.md

This commit is contained in:
agatha 2024-04-13 23:22:36 -04:00
parent 73a80f6d3d
commit b9e3591299
3 changed files with 24 additions and 3 deletions

View File

@ -1,2 +1,23 @@
# Unshorten # Unshorten
Firefox Extension and API server for revealing links behind shortened URLs. Firefox Extension and API server for revealing links behind shortened URLs.
## Usage
In order to deal with CORS, Unshorten must send links to a resolver API.
```shell
cd server
make build
docker -d --name unshortener -p 8000:8000 unshortener-api
```
Build the extension and import into Firefox. Right click on a link and choose
"Unshorten Link". The result will be copied to the clipboard.
```shell
cd extension
make zip
```
## Supported Sites
- t.co
- tinyurl.com

View File

@ -40,4 +40,4 @@ async def receive_url(url: Optional[str] = None):
CACHE[url] = result CACHE[url] = result
return result return result
return {"error": f"server error"} return {"error": "server error"}

View File

@ -1,7 +1,7 @@
"""Unshortening functions""" """Unshortening functions"""
import re import re
import requests
from typing import Optional from typing import Optional
import requests
def unshorten_tinyurl(url: str) -> Optional[str]: def unshorten_tinyurl(url: str) -> Optional[str]: