{"id":13638670,"url":"https://github.com/staticaland/go-whaturl","last_synced_at":"2025-04-19T18:30:49.920Z","repository":{"id":50464738,"uuid":"518921288","full_name":"staticaland/go-whaturl","owner":"staticaland","description":"Add titles to your URLs!","archived":false,"fork":false,"pushed_at":"2024-06-05T11:50:50.000Z","size":301,"stargazers_count":6,"open_issues_count":12,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T10:05:05.941Z","etag":null,"topics":["cli","cue","cuelang","go","golang","markdown","org-mode"],"latest_commit_sha":null,"homepage":"","language":"CUE","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/staticaland.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-28T16:36:41.000Z","updated_at":"2024-08-06T17:26:18.000Z","dependencies_parsed_at":"2024-06-19T23:05:15.107Z","dependency_job_id":null,"html_url":"https://github.com/staticaland/go-whaturl","commit_stats":{"total_commits":298,"total_committers":6,"mean_commits":"49.666666666666664","dds":0.5402684563758389,"last_synced_commit":"4671ec95853842f5e4de6d5d35ae27e454d8a0c0"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticaland%2Fgo-whaturl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticaland%2Fgo-whaturl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticaland%2Fgo-whaturl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticaland%2Fgo-whaturl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/staticaland","download_url":"https://codeload.github.com/staticaland/go-whaturl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249764720,"owners_count":21322289,"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":["cli","cue","cuelang","go","golang","markdown","org-mode"],"created_at":"2024-08-02T01:00:51.385Z","updated_at":"2025-04-19T18:30:49.376Z","avatar_url":"https://github.com/staticaland.png","language":"CUE","funding_links":[],"categories":["Projects"],"sub_categories":[],"readme":"* whaturl\n\n#+begin_html\n\u003cp\u003e\n    \u003ca href=\"https://github.com/staticaland/go-whaturl/actions/workflows/go.yml\"\u003e\n        \u003cimg alt=\"Build\" src=\"https://github.com/staticaland/go-whaturl/actions/workflows/go.yml/badge.svg?branch=main\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/staticaland/go-whaturl/actions/workflows/vale.yml\"\u003e\n        \u003cimg alt=\"Vale\" src=\"https://github.com/staticaland/go-whaturl/actions/workflows/vale.yml/badge.svg?branch=main\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/staticaland/go-whaturl/actions/workflows/superlinter.yml\"\u003e\n        \u003cimg alt=\"Lint\" src=\"https://github.com/staticaland/go-whaturl/actions/workflows/superlinter.yml/badge.svg?branch=main\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/staticaland/go-whaturl/actions/workflows/cue-yaml-reconciliation-check.yml\"\u003e\n        \u003cimg alt=\"CUE\" src=\"https://github.com/staticaland/go-whaturl/actions/workflows/cue-yaml-reconciliation-check.yml/badge.svg?branch=main\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/staticaland/go-whaturl/actions/workflows/goreleaser.yml\"\u003e\n        \u003cimg alt=\"Release\" src=\"https://github.com/staticaland/go-whaturl/actions/workflows/goreleaser.yml/badge.svg\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/staticaland/go-whaturl/releases\"\u003e\n        \u003cimg alt=\"Version\" src=\"https://img.shields.io/github/v/release/staticaland/go-whaturl\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://staticaland.github.io/go-whaturl/\"\u003e\n        \u003cimg alt=\"Docs\" src=\"https://github.com/staticaland/go-whaturl/actions/workflows/pages.yml/badge.svg?branch=main\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n#+end_html\n\n\n* About\n\n=whaturl= replaces URLs found in text with a markup hyperlink with the contents\nof the =\u003ctitle\u003e= tag in the HTML of the URL. It works like a typical [[https://en.wikipedia.org/wiki/Filter_%28software%29][Unix\nfilter]]:\n\n#+begin_src sh\necho \"I like https://github.com\" | whaturl\nI like [GitHub: Where the world builds software · GitHub](https://github.com)\n#+end_src\n\nInspired by [[http://brettterpstra.com/2015/02/18/titler-system-service/][Titler by Brett Terpstra]] for Mac OS and [[https://github.com/rexim/org-cliplink][org-cliplink]] for Emacs.\n\n\n* Installation\n\n[[https://github.com/staticaland/go-whaturl/releases][Check out releases for pre-built binaries]].\n\nA Homebrew formula is included at [[./Formula/whaturl.rb][Formula/whaturl.rb]].\n\n#+begin_src sh\nbrew tap staticaland/go-whaturl https://github.com/staticaland/go-whaturl\nbrew install whaturl\n#+end_src\n\nIf you watch the project (Watch → Custom → Releases) you can easily upgrade to\nthe latest version when notified:\n\n#+begin_src sh\nbrew upgrade whaturl\n#+end_src\n\nTo uninstall:\n\n#+begin_src sh\nbrew uninstall whaturl\nbrew untap staticaland/go-whaturl\n#+end_src\n\n\n* Usage\n\n#+begin_src sh :wrap src sh :results raw :exports results\nwhaturl --help 2\u003e\u00261\n#+end_src\n\n#+RESULTS:\n#+begin_src sh\nUsage of whaturl:\n  -format string\n    \tSpecify link format (default \"markdown\")\n  -list\n    \tCreate list of links\n  -relaxed\n    \tProcess URLs without a schema\n#+end_src\n\nIf you run the program, it will wait for input from [[https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)][stdin]].\n\n#+begin_src sh\nwhaturl\n#+end_src\n\nYou can write lines to it and get a result by pressing enter. To finish, press\nCtrl+D to communicate [[https://en.wikipedia.org/wiki/End-of-Transmission_character][end-of-transmission]]. However, the more common use-case is\nto pipe something directly:\n\n#+begin_src sh\ncat urls | whaturl\n#+end_src\n\n\n* Editor integration\n\n** Emacs\n\nI use =reformatter.el= (see [[https://github.com/staticaland/doom-emacs-config/blob/master/modules/editor/reformatter/config.el][my reformatter.el configuration here]]). You may also\nwant to check out [[https://github.com/radian-software/apheleia][Apheleia]]. Otherwise, =shell-command-on-region= ([[https://www.gnu.org/software/emacs/manual/html_node/emacs/Single-Shell.html][docs]]) is what\nyou are looking for. Read [[https://www.masteringemacs.org/article/executing-shell-commands-emacs][Executing Shell Commands in Emacs]] to learn more.\n\n\n** Vim\n\n#+begin_example\nnnoremap \u003cleader\u003el :%!whaturl\u003cCR\u003e\nvnoremap \u003cleader\u003el :!whaturl\u003cCR\u003e\n#+end_example\n\nThis is reminiscent of the [[https://blog.sanctum.geek.nz/vim-koans/][Vim Kōan Master Wq and the Markdown acolyte]].\n\n\n* Build and run\n\n#+begin_html\n\u003cp\u003e\n    \u003ca href=\"https://github.com/staticaland/go-whaturl/actions/workflows/go.yml\"\u003e\n        \u003cimg alt=\"Build\" src=\"https://github.com/staticaland/go-whaturl/actions/workflows/go.yml/badge.svg\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n#+end_html\n\n#+begin_src sh\ngo build whaturl.go\n#+end_src\n\n#+begin_src sh\ngo run whaturl.go\n#+end_src\n\n\n* Tests\n\n#+begin_html\n\u003cp\u003e\n    \u003ca href=\"https://github.com/staticaland/go-whaturl/actions/workflows/go.yml\"\u003e\n        \u003cimg alt=\"Build\" src=\"https://github.com/staticaland/go-whaturl/actions/workflows/go.yml/badge.svg\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n#+end_html\n\nYou can find some table driven tests in [[./whaturl_test.go][whaturl_test.go]].\n\n#+begin_src sh\ngo test\n#+end_src\n\n\n* Similar projects\n\n- [[https://github.com/Skn0tt/markdown-link-expander][markdown-link-expander]]\n- [[https://github.com/kukushi/PasteURL][kukushi/PasteURL]]\n- [[https://github.com/zolrath/obsidian-auto-link-title][zolrath/obsidian-auto-link-title]]\n- [[https://github.com/sindresorhus/linkify-urls][sindresorhus/linkify-urls]]\n- [[https://github.com/sindresorhus/urls-md][sindresorhus/urls-md]]\n- [[https://github.com/alphapapa/org-protocol-capture-html][alphapapa/org-protocol-capture-html]]\n- [[https://github.com/deathau/markdownload][deathau/markdownload]]\n- [[https://gist.github.com/kepano/90c05f162c37cf730abb8ff027987ca3][kepano/obsidian-web-clipper.js]]\n- [[https://forum.keyboardmaestro.com/t/create-a-markdown-link-url-title-url-for-a-url-in-the-clipboard/8505][Keyboard Maestro - Create a Markdown Link for a URL in the Clipboard]]\n- [[https://forum.obsidian.md/t/hyper-optimized-url-grabber-using-keyboard-maestro-on-the-mac/34318][Hyper Optimized URL grabber (Using Keyboard Maestro on the Mac)]]\n\n\n* See also\n\n- [[https://benjamincongdon.me/blog/2020/06/27/Vim-Tip-Paste-Markdown-Link-with-Automatic-Title-Fetching/][Vim Tip: Paste Markdown Link with Automatic Title Fetching]]\n- [[https://www.moncefbelyamani.com/automate-pasting-title-and-url-of-frontmost-browser/][Automate Copying and Pasting the Current Page Title and URL with Keyboard\n  Maestro]]\n\n\n* Bookmarklets\n\n[[https://orgmode.org][Org Mode]]:\n\n#+begin_src js\njavascript:(\n    function(){\n        prompt(\n            '',\n            '[['\n                +location.href\n                +']['\n                +document.title.replace(/ [-,|].*$/,'')\n                +']]'\n        )\n    }\n)()\n#+end_src\n\nMarkdown:\n\n#+begin_src js\njavascript:(\n    function(){\n        prompt(\n            '',\n            '['\n                +[location.href](\u003cdocument.title.replace(/ [-,|].*$/,'')\u003e)\n                +']('\n                +location.href\n                +')'\n        )\n    }\n)()\n#+end_src\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaticaland%2Fgo-whaturl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstaticaland%2Fgo-whaturl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaticaland%2Fgo-whaturl/lists"}