{"id":13633411,"url":"https://github.com/tomnomnom/unfurl","last_synced_at":"2025-05-15T06:07:42.137Z","repository":{"id":29852232,"uuid":"122951130","full_name":"tomnomnom/unfurl","owner":"tomnomnom","description":"Pull out bits of URLs provided on stdin","archived":false,"fork":false,"pushed_at":"2023-08-12T04:13:27.000Z","size":52,"stargazers_count":1147,"open_issues_count":12,"forks_count":126,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-14T10:42:40.128Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/tomnomnom.png","metadata":{"files":{"readme":"README.mkd","changelog":null,"contributing":"CONTRIBUTING.mkd","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-26T10:09:16.000Z","updated_at":"2025-04-12T20:10:29.000Z","dependencies_parsed_at":"2024-01-21T08:48:46.954Z","dependency_job_id":null,"html_url":"https://github.com/tomnomnom/unfurl","commit_stats":{"total_commits":28,"total_committers":5,"mean_commits":5.6,"dds":0.2857142857142857,"last_synced_commit":"8f10d050f1b0be12e505053da174f3f39e8eed74"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Funfurl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Funfurl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Funfurl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Funfurl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomnomnom","download_url":"https://codeload.github.com/tomnomnom/unfurl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254283350,"owners_count":22045141,"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-08-01T23:00:38.690Z","updated_at":"2025-05-15T06:07:42.043Z","avatar_url":"https://github.com/tomnomnom.png","language":"Go","readme":"# unfurl\n\nPull out bits of URLs provided on `stdin`\n\n## Install\n\nIf you have Go installed and configured:\n\n```\n▶ go install github.com/tomnomnom/unfurl@latest\n```\n\nOtherwise [download the latest binary for your platform](https://github.com/tomnomnom/unfurl/releases),\nextract it and move it to somewhere in your `$PATH` (e.g. `/usr/bin/`):\n\n```\n▶ wget https://github.com/tomnomnom/unfurl/releases/download/v0.0.1/unfurl-linux-amd64-0.0.1.tgz\n▶ tar xzf unfurl-linux-amd64-0.0.1.tgz\n▶ sudo mv unfurl /usr/bin/\n```\n\n## Usage\n\nunfurl works with URLs provided on stdin; they might come from a file like this one:\n\n```\n▶ cat urls.txt\nhttps://sub.example.com/users?id=123\u0026name=Sam\nhttps://sub.example.com/orgs?org=ExCo#about\nhttp://example.net/about#contact\n```\n\n### Domains\n\nYou can extract the domains from the URLs with the `domains` mode:\n\n```\n▶ cat urls.txt | unfurl domains\nsub.example.com\nsub.example.com\nexample.net\n```\n\nIf you don't want to output duplicate values you can use the `-u` or `--unique` flag:\n\n```\n▶ cat urls.txt | unfurl --unique domains\nsub.example.com\nexample.net\n```\n\nThe `-u`/`--unique` flag works for all modes.\n\n### Apex Domains\n\nYou can extract the apex part of the domain (e.g. the `example.com` in `http://sub.example.com`) using the `apexes` mode:\n\n```\n▶ cat urls.txt | unfurl -u apexes\nexample.com\nexample.net\n```\n\n### Paths\n\n```\n▶ cat urls.txt | unfurl paths\n/users\n/orgs\n/about\n```\n\n### Query String Keys\n\n```\n▶ cat urls.txt | unfurl keys\nid\nname\norg\n```\n\n### Query String Values\n\n```\n▶ cat urls.txt | unfurl values\n123\nSam\nExCo\n```\n\n### Query String Key/Value Pairs\n\n```\n▶ cat urls.txt | unfurl keypairs\nid=123\nname=Sam\norg=ExCo\n```\n\n### JSON\n```\n▶ cat urls.txt | unfurl json\n{\"scheme\":\"https\",\"opaque\":\"\",\"user\":\"\",\"host\":\"sub.example.com\",\"path\":\"/users\",\"raw_path\":\"\",\"raw_query\":\"id=123\\u0026name=Sam\",\"fragment\":\"\",\"parameters\":[{\"key\":\"id\",\"value\":\"123\"},{\"key\":\"name\",\"value\":\"Sam\"}],\"url\":\"https://sub.example.com/users?id=123\\u0026name=Sam\",\"domain\":\"sub.example.com\",\"subdomain\":\"sub\",\"root\":\"example\",\"tld\":\"com\",\"apex\":\"example.com\",\"port\":\"\",\"extension\":\"\"}\n{\"scheme\":\"https\",\"opaque\":\"\",\"user\":\"\",\"host\":\"sub.example.com\",\"path\":\"/orgs\",\"raw_path\":\"\",\"raw_query\":\"org=ExCo\",\"fragment\":\"about\",\"parameters\":[{\"key\":\"org\",\"value\":\"ExCo\"}],\"url\":\"https://sub.example.com/orgs?org=ExCo#about\",\"domain\":\"sub.example.com\",\"subdomain\":\"sub\",\"root\":\"example\",\"tld\":\"com\",\"apex\":\"example.com\",\"port\":\"\",\"extension\":\"\"}\n{\"scheme\":\"http\",\"opaque\":\"\",\"user\":\"\",\"host\":\"example.net\",\"path\":\"/about\",\"raw_path\":\"\",\"raw_query\":\"\",\"fragment\":\"contact\",\"parameters\":null,\"url\":\"http://example.net/about#contact\",\"domain\":\"example.net\",\"subdomain\":\"\",\"root\":\"example\",\"tld\":\"net\",\"apex\":\"example.net\",\"port\":\"\",\"extension\":\"\"}\n```\n\n### Custom Formats\n\nYou can use the `format` mode to specify a custom output format:\n\n```\n▶ cat urls.txt | unfurl format %d%p\nsub.example.com/users\nsub.example.com/orgs\nexample.net/about\n```\n\nThe available format directives are:\n\n```\n%%  A literal percent character\n%s  The request scheme (e.g. https)\n%u  The user info (e.g. user:pass)\n%d  The domain (e.g. sub.example.com)\n%S  The subdomain (e.g. sub)\n%r  The root of domain (e.g. example)\n%t  The TLD (e.g. com)\n%P  The port (e.g. 8080)\n%p  The path (e.g. /users)\n%e  The path's file extension (e.g. jpg, html)\n%q  The raw query string (e.g. a=1\u0026b=2)\n%f  The page fragment (e.g. page-section)\n%@  Inserts an @ if user info is specified\n%:  Inserts a colon if a port is specified\n%?  Inserts a question mark if a query string exists\n%#  Inserts a hash if a fragment exists\n%a  Authority (alias for %u%@%d%:%P)\n```\n\nAny characters that don't match a format directive remain untouched:\n\n```\n▶ cat urls.txt | unfurl -u format \"%d (%s)\"\nsub.example.com (https)\nexample.net (http)\n```\n\nNote that if a URL does not include the data requested, there will be no output for that URL:\n\n```\n▶ echo http://example.com | unfurl format \"%P\"\n▶ echo http://example.com:8080 | unfurl format \"%P\"\n8080\n```\n\n\n## Help\n\n```\n▶ unfurl -h\nFormat URLs provided on stdin\n\nUsage:\n  unfurl [OPTIONS] [MODE] [FORMATSTRING]\n\nOptions:\n  -u, --unique   Only output unique values\n  -v, --verbose  Verbose mode (output URL parse errors)\n\nModes:\n  keys     Keys from the query string (one per line)\n  values   Values from the query string (one per line)\n  keypairs Key=value pairs from the query string (one per line)\n  domains  The hostname (e.g. sub.example.com)\n  paths    The request path (e.g. /users)\n  apexes   The apex domain (e.g. example.com from sub.example.com)\n  json     JSON encoded url/format objects\n  format   Specify a custom format (see below)\n\nFormat Directives:\n  %%  A literal percent character\n  %s  The request scheme (e.g. https)\n  %u  The user info (e.g. user:pass)\n  %d  The domain (e.g. sub.example.com)\n  %S  The subdomain (e.g. sub)\n  %r  The root of domain (e.g. example)\n  %t  The TLD (e.g. com)\n  %P  The port (e.g. 8080)\n  %p  The path (e.g. /users)\n  %e  The path's file extension (e.g. jpg, html)\n  %q  The raw query string (e.g. a=1\u0026b=2)\n  %f  The page fragment (e.g. page-section)\n  %@  Inserts an @ if user info is specified\n  %:  Inserts a colon if a port is specified\n  %?  Inserts a question mark if a query string exists\n  %#  Inserts a hash if a fragment exists\n  %a  Authority (alias for %u%@%d%:%P)\n\nExamples:\n  cat urls.txt | unfurl keys\n  cat urls.txt | unfurl format %s://%d%p?%q\n```\n","funding_links":[],"categories":["Miscellaneous","Weapons","Tools","信息搜集","Go"],"sub_categories":["Useful","Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomnomnom%2Funfurl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomnomnom%2Funfurl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomnomnom%2Funfurl/lists"}