It was recently uncovered that Bitly is possibly monetarily gaining from your affiliate shortlinks with the affiliate tool, Viglink. What it comes down to, again, like it has for Disqus and many services like it is who owns your content? You don’t host your links, Bitly does. They can manipulate and track and, yes, monetize your data.
So as I read these articles a couple of days ago while our son was being way too loud in the bathtub, the camel’s back got downright broken. I’ve tried to setup YOURLS twice before and given up. I don’t know if I’m that much smarter now or if I was that much more driven, but I got it setup today in a couple of hours while doing client and social media stuff.
What to do
Here’s what I did.
I went to https://github.com/YOURLS/YOURLS and downloaded the .zip file locally and followed the directions here: http://yourls.org (that link is on the Github page)
I use ServerPilot on my DigitalOcean droplet, so I created a new app for the domain I wanted to use shortening on: jdub.co
The next step was to configure the file in /user like it says to in the document and add all of the database and domain info that was just setup in ServerPilot.
Upload the entire contents of the .zip file to the public folder or subfolder you choose on the server and then visit YOURLSDOMAIN/admin to install it and login. For this part, it’s very much like WordPress. It connects to the database you just created on YOUR server, so you own the data, and from this admin, you can add plugins for additional features.
I’ve installed the following plugins:
- https://github.com/YOURLS/random-keywords
- https://github.com/YOURLS/dont-log-bots
- https://github.com/katzwebservices/YOURLS-Link-Anonymizer
- https://github.com/miconda/yourls/tree/master/plugins/popular-clicks
Now for the best part: connecting it to services like Tweetbot as the link shortener. In the admin, go to Tools. Look for the Secure passwordless API call. See the token? You need to insert that into this line of code, which is the URL to use in Tweetbot:
http://YOURDOMAIN.COM/yourls-api.php?signature=SECRETTOKEN&format=simple&action=shorturl&url=%@
Replace SECRETTOKEN with that token string and you’re all set.
Happy YOURLS-ing!