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
- you can use parseStringForUrl, which will return the string with replaced bitly links.
- 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
-
View User Profile
-
Send Message
Posted Aug 28, 2012Since i installed this plugin all words on one line are showed like this in console.
This text is in one line
this
text
is
in
one
line
-
View User Profile
-
Send Message
Posted May 10, 2012This is awesome, thanks a ton!
-
View User Profile
-
Send Message
Posted May 4, 2012<3 -3-