PPF Home
Plugins
Developers
   Font size:      

TinyUrl (v1.1)

PDF
PDF

Description

Convert urls in channel to tinyurls.

When the !tinyurl command is entered, it takes the last url seen in the channel, converts it to a tinyurl and displays the tinyurl in the channel.

Configuration

The configuration file for this plugin is plugins/TinyUrl/TinyUrlConfig.xml

commandTinyUrl

The command for generating a tinyurl. You can set the authLevel to control who is allowed to access the command. Please note that if automatic tinyurl generation is enabled (see the automatic-tinyurl configuration option below), this command is ignored by the plugin.

  • authLevel - ANY, ADMIN, MASTER, TRUSTED, NONE

<commandTinyUrl authLevel="none">!tinyurl</commandTinyUrl>

    

automatic-tinyurl

Whether to enable automatic generation of tinyurls. Disabled by default. If enabled, the !tinyurl command above is ignored.


<automatic-tinyurl enable="true"/>

      

original-url-quoting / enable

if enabled, the original url will be quoted in the output message


<original-url-quoting>
  ..
  <enable>true</enable>
  ..
</original-url-quoting>

      

original-url-quoting / max-length

the maximum length of the quoted url. If length exceeded, the middle part will be replaced with "..." so that the result will be this long.


<original-url-quoting>
  ..
  <max-length>30</max-length>
  ..
</original-url-quoting>

      

original-url-quoting / strip-protocol

whether to strip the protocol i.e. http:// or https:// from the original url in the message sent to the channel


<original-url-quoting>
  ..
  <strip-protocol>false</strip-protocol>
  ..
</original-url-quoting>

      

tinyurl-request-interval

The minimum interval (in seconds) between two tinyurl requests (to avoid abuse of tinyurl service)


<tinyurl-request-interval>10</tinyurl-request-interval>

      

url-min-length

The minimum length of the url that will be tinyurlized


<url-min-length>5</url-min-length>

      

messages / msgUrlIsTinyAlready

Printed if the url is tiny enough already. Not used if automatic-tinyurl mode is enabled


<messages>
  ..
  <msgUrlIsTinyAlready>Url is tiny enough already :)</msgUrlIsTinyAlready>
  ..
</messages>

      

messages / msgNoUrl

Printed if no url has yet been detected in the channel (also happens after reloading the plugin)


<messages>
  ..
  <msgNoUrl>No url</msgNoUrl>
  ..
</messages>

      

messages / msgFailureFor

Printed if there was a problem creating a tinyurl


<messages>
  ..
  <msgFailureFor>Sorry, failed to create tinyurl for</msgFailureFor>
  ..
</messages>

      

NOTE: The messages can be disabled by specifying an empty string.

Commands

Create tinyurl

Command: !tinyurl [url]
Description: Create tinyurl of last or given url
Auth Level: none
Where to give command: channel (message, action, notice)
Outputs to: channel
Example(s):

  • !tinyurl
  • !tinyurl http://some.host.com/some/path

Change History

v1.1 Version 1.1 by xkr47
v1.0 First Version by xkr47