Note: OGM Forum is no longer active. This is a static snapshot as of February 2022. You can browse the site to see posts, but the functional features of the site will not work. You can search or download a zip archive of the files from the site at github/OpenGlobalMind/forum.openglobalmind.com.

Getting Thought Name from a Shortened TheBrain Link

I can expand more on how or why to do this if anybody’s interested, but to put it concisely, if $i is your short TheBrain link, then:

curl -s `curl -Ls -I -w %{url_effective} $i | sed 's#app.thebrain.com#api.thebrain.com/api-v11#'` | jq ".data.attributes.name"

So:

curl -s `curl -Ls -I -w %{url_effective} https://bra.in/9jQg6m | sed 's#app.thebrain.com#api.thebrain.com/api-v11#'` | jq ".data.attributes.name"

gets you "Scuttlebutt (2017)".

nice! Curl is such a useful library. And you have made fine use of it here. What are some of the main use cases we’re envisioning here?