Titler: instantly add page titles to URLS in your text
Guess what? This is the 100th project (see?) I’ve made available for download on this blog. I don’t know what that means in the grand scheme of things, but I feel like I should celebrate.
I’ve been making a lot of new tools lately, but I’ve been short on free time to polish and document them for sharing. I have a growing list of tools and projects that I’m hoping to get around to posting soon.
Oh look, here’s one now.
This is a System Service called Titler. It does what it says on the label: finds URLs in selected text and adds titles to them based on the page title. I specifically needed this for podcast show notes as I often just paste a url into my notes when I don’t have time to do much else. This Service lets me take a pile of such links and turn them into Markdown links with their page title as the text. It also adds Amazon and iTunes affiliate tokens, cleans out referrer junk, and has the ability to neatly truncate titles at word breaks based on a maximum length setting.
Download below, unzip, and double click the included Services (.workflow
extension) to install.
Titler does require a tiny bit of setup1. You need to have the nokogiri gem in your system Ruby install. That’s just a matter of running sudo gem install nokogiri
in Terminal. If you use a Ruby version manager, make sure you switch to the system Ruby before installing the gem.
The first time it runs, it will create a .titler
file in your home directory. Edit this file to change the default behavior. Its format is identical to SearchLink, so if you use SearchLink, you can just copy the iTunes and Amazon settings over. If you don’t want affiliate links, just delete the contents of the keys for them. The settings are all documented in the config file.
Once you have those two steps done, you should be able to just select text and right click, choose a Titler service from the menu, and get your titles inserted in place.
There are 3 flavors. First, the regular Titler service. It finds all urls in the text. If they’re already inline Markdown links, it will replace the text in square brackets with the title, and the url in parenthesis with the cleaned up, affiliated url. If the link is part of a reference link, it leaves the id in square brackets alone, updates the URL, and appends the title to the end in quotes.
The second one, Extract Links, will gather all the URLS in your selection and output them as a bulleted list with titles in inline Markdown format. URLs are affiliated and cleaned. Your selection is left alone and the results are put on your clipboard. It will notify you (on Yosemite) when it’s finished.
The third flavor, Affiliatize, will skip finding titles and just replace any iTunes or Amazon links it finds with versions containing your affiliate tokens. All of the “affiliatization” removes existing affiliate tokens as part of the process, unless you have no affiliate tokens configured, in which case it will skip the process entirely.
Titler Service v1.1.0
Download Titler Service v1.1.0
An OS X System Service to add titles and affiliate tokens to urls (Markdown format) in selected text
Published 02/25/15.
Updated 02/25/15. Changelog
-
“Tiny” if all goes well. Installing gems can lead to a bad couple of hours if you run into trouble and you don’t know what you’re doing and Google has no freaking clue. Welcome to the rabbit hole. ↩