I recently purchased the somad.es domain for use with my own URL shortener. (Vanity or owning my own URLs: you decide.) I decided to use Alan Hogan’s Lessn More, an improved fork of Shaun Inman’s Lessn. I then decided I wanted to integrate the shortlink into my WordPress install, but the existing WP Lessn plugin isn’t very good. Its admin page doesn’t adhere to WP security best practices, it doesn’t use WP’s HTTPAPI, and it doesn’t properly integrate with WP 3.0’s shortlink API. In short, it doesn’t do things the WP way.
So, I made my own little plugin. I didn’t want another plugin settings page, so you have to hardcode your Lessn URL and API key. It integrates with the “Get Shortlink” button on your write/edit post screen, and the relevant shortlink HTTP header and meta elements are auto-inserted. Only the “post” post_type will get Lessn’d by default, but see the bottom of the plugin for how to add additional post_types.
Now, I just need to figure out how to integrate shortlinks for humans rather than just machines.
I’m trying to get your plugin to work with my site, and whenever I click the Get Shortlink button, the content of the shortlink is my 404 page.
I added the API key and the API base.
My lessn is installed at http://example.com/u/ and the backend of it is at http://example.com/u/-/ … so my API base is:
const LESSN_API_BASE = ‘http://example.com/u/-/’; // the API base for your Lessn install
Am I missing something?
Thanks so much!!
That seems like it should work. Have you gotten a link to shorten properly via the API call otherwise?