3 ms·
This is pretty cool! I might be able to learn from your outer loop, actually--this is close to a much simpler problem I've needed to solve. I take my notes in
by geoelectric 7y ago
This is pretty cool!
I might be able to learn from your outer loop, actually--this is close to a much simpler problem I've needed to solve.
I take my notes in markdown bulleted lists, and try to make them very narrow so they fit on the side of my monitor. I shorten all my links to keep the character count down. The shortener we use at work times out the links if they're not used, though, so in old notes I can go back and discover my alias is gone.
I've been meaning to write something that just sweeps my notes and hits the links through the shortener URL periodically as a keepalive. Since the notes are not always conveniently in one tree with nothing else around, I was thinking something a little richer than text extraction piped to curl.
If nothing else, maybe this'll inspire me to get off my ass and actually get it done.
- macedotavares 7y agoThanks! If the URL shortener has an API, maybe you could write a script that keeps a record of every URL passing through it, and then run curl on those records with a cronjob or something. I’m guessing you use a plain text editor for your notes and want to stick with it, but some note-taking apps, like Bear and Roam automatically hide the URLs in markdown links, so you could keep them as short as their titles. This would bypass the need for a URL shortener.
- geoelectric 7y agoDefinitely, if I were using rendered output primarily that'd make a ton of sense of course. As you surmised, though, I use VS Code, vim, nvAlt, and iOS text editors as my primary tools (depending on setting) and actually create/read the journal in pure plaintext. The markdown formatting is more so I can c/p rendered versions from a preview HTML page to Google Docs and other targets that understand rich text from clipboard but not markdown directly--I can create meeting minutes and whatnot from my notes very quickly that way.
- rovr138 7y agoI would move away from url shorteners. - It’s a single point of failure. - If the database breaks, you loose all your links. - If they get attacked, they can redirect to malware. - If they go out of business or gets shut down, you have another issue to solve. If you’re using markdown, asciidoc, restructuredtext you can create a link and hide the url with text. Equivalent to, <a href=“http://example.com/some/page/here”>Example</a>
- geoelectric 7y agoYou can't hide it in plaintext, which is the point. I think your post got partially eaten by HN as formatting but I understand the []() format for MD--but you can see where that's at least 2 chars longer than just putting in the raw URL, and not super necessary in my editor that auto-linkifies. The markdown formatting is so I can share it with other people and paste into gdocs, but 50 char wide plaintext is the primary format. It's also an internal shortener service within an established company that maintains it well, but I appreciate your points for public ones.