ShortLink

ShortLink

This plugin will parse chat and replace any links found, with bit.ly links.

Installation

Download the zip file, extract the jar and folder to your plugin folder. To use your own bit.ly api key and username, just modify the configuration file.

Using ShortLink in your own plugin

Create a new ShortenUrlTask with the parameters (String bitlyUsername, String bitlyApiKey, String messageToParse)

From here, you can do one of two things

  1. you can use parseStringForUrl, which will return the string with replaced bitly links.
  2. pass it into the scheduler to parse it in a new thread.

The reason i let you parse it in a seperate thread, is because.. Well, if bitly is down and you try to parse in the main server thread, your server will time out.

Other info

This is my first plugin release. Typically i dont like to release plugins, because those that i make are highly proprietary to my server. However, i hadnt seen a plugin like this, and decided to create one.

Note that it contains regex to detect links, and i have no idea how to work regex, so if it breaks, i have no idea how to fix it. I dont release this with the explicit plan of keeping up to date with it, so if i do, lucky you, if not, heres my github


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files