{"id":18300285,"url":"https://github.com/docnow/unshrtn","last_synced_at":"2025-04-05T13:36:04.867Z","repository":{"id":20432114,"uuid":"23708794","full_name":"DocNow/unshrtn","owner":"DocNow","description":"A LevelDB backed URL unshortening microservice written in JavaScript","archived":false,"fork":false,"pushed_at":"2022-12-10T16:09:09.000Z","size":236,"stargazers_count":31,"open_issues_count":13,"forks_count":4,"subscribers_count":11,"default_branch":"main","last_synced_at":"2024-04-15T12:18:13.968Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DocNow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-05T15:49:57.000Z","updated_at":"2021-04-21T08:51:56.000Z","dependencies_parsed_at":"2023-01-11T20:50:40.652Z","dependency_job_id":null,"html_url":"https://github.com/DocNow/unshrtn","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DocNow%2Funshrtn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DocNow%2Funshrtn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DocNow%2Funshrtn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DocNow%2Funshrtn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DocNow","download_url":"https://codeload.github.com/DocNow/unshrtn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247342709,"owners_count":20923642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T15:11:57.303Z","updated_at":"2025-04-05T13:36:04.580Z","avatar_url":"https://github.com/DocNow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unshrtn\n\n*unshrtn* is a [LevelDB] backed URL unshortening microservice written in\n[JavaScript] and [Node] for quick, asynchronous processing of requests.\n*unshrtn* remembers what it has already looked up so it can save you the trouble\nof keeping track of URLs when you are looking up a lot of them at one time and\nthey haven't necessarily been de-duplicated.\n\n*unshrtn* uses the [metaweb] library to do the lookups, which means that in addition to returning the unshortened URL you will also get some potentially useful metadata if the response happens to be HTML:\n\n```\n% curl http://localhost:3000?url=https://bit.ly/348J1DN\n{\n  \"short\": \"https://bit.ly/348J1DN\",\n  \"long\": \"https://www.youtube.com/watch?v=oHg5SJYRHA0\",\n  \"canonical\": \"https://www.youtube.com/watch?v=oHg5SJYRHA0\",\n  \"status\": 200,\n  \"content_type\": \"text/html; charset=utf-8\",\n  \"title\": \"RickRoll'D - YouTube\",\n  \"description\": \"http://www.facebook.com/rickroll548 As long as trolls are still trolling, the Rick will never stop rolling.\",\n  \"image\": \"https://i.ytimg.com/vi/oHg5SJYRHA0/hqdefault.jpg\",\n  \"publisher\": \"YouTube\",\n  \"keywords\": [\"Cotter548\", \"Shawn\", \"Cotter\", \"lol\", \"gamefaqs\", \"CE\", \"reddit\", \"rettocs\", \"no\", \"brb\", \"afk\", \"lawl\", \"pwnt\", \"Rickroll\", \"Rickroll'd\", \"Rick\", \"Roll\", \"Duckroll\", \"Duck\", \"rick\", \"roll\", \"astley\", \"...\"]\n}\n```\n\n## Install\n\nProbably the easiest way to get *unshrtn* up and running is with [Docker].\n\n    docker run -p 3000:3000 docnow/unshrtn\n    Status: Downloaded newer image for docnow/unshrtn:latest\n    info: started http://0.0.0.0:3000\n\nYou can also install it with [npm]:\n\n    % npm install -g unshrtn\n    % unshrtn\n    info: started http://0.0.0.0:3000\n\n## Usage\n\nOnce installed you can start up the microservice:\n\n    % unshrtn start\n\nIf you'd like more control over how it starts use the *start* subcommand:\n\n    % unshrtn start --host 0.0.0.0 --port 8080 --log /var/log/unshrtn.log\n\nBy default *unshrtn* writes its database to *unshrtn.db* in the current working\ndirectory. However you can control this with the *--database* option:\n\n    % unshrt start --database /var/unshrtn/unshrtn.db\n\nYou can dump the database as line oriented JSON and load it again if you want to\nback it up or move it around:\n\n    % unshrtn dump /path/to/datbase \u003e backup.jsonl\n    % cat backup.jsonl | unshrtn load /path/to/another/database\n\nIf you just want to look up one URL you can also use *unshrtn* on the command line:\n\n    % unshrtn get https://bitly.com/4kb77v\n\n[LevelDB]: https://code.google.com/p/leveldb/\n[JavaScript]: https://en.wikipedia.org/wiki/JavaScript\n[Node]: https://nodejs.org\n[canonical links]: https://en.wikipedia.org/wiki/Canonical_link_element\n[Docker]: https://www.docker.com/\n[npm]: https://www.npmjs.com/\n[metaweb]: https://github.com/edsu/metaweb\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocnow%2Funshrtn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocnow%2Funshrtn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocnow%2Funshrtn/lists"}