diff --git a/README.md b/README.md index 2b3d985..89cd120 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,23 @@ # Unshorten -Firefox Extension and API server for revealing links behind shortened URLs. \ No newline at end of file +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 diff --git a/server/src/main.py b/server/src/main.py index 632de62..cc51db6 100644 --- a/server/src/main.py +++ b/server/src/main.py @@ -40,4 +40,4 @@ async def receive_url(url: Optional[str] = None): CACHE[url] = result return result - return {"error": f"server error"} + return {"error": "server error"} diff --git a/server/src/unshorteners.py b/server/src/unshorteners.py index c2a8c41..23d810b 100644 --- a/server/src/unshorteners.py +++ b/server/src/unshorteners.py @@ -1,7 +1,7 @@ """Unshortening functions""" import re -import requests from typing import Optional +import requests def unshorten_tinyurl(url: str) -> Optional[str]: