TinyUrl (v1.2) |
- Description
- Configuration
- Commands
- Change History
Description | ||
The TinyUrl plugin provides two main functions:
- Converts urls to tinyurls
- Displays the page title of the requested URL
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.
If the titlereader is enabled and the URL points to a
HTML page, the HTML title will be displayed on the
channel. The titlereader will also look for an RDF block
in the HTML document and try to extract RDF title
information.
The tinyurl and title information can be displayed on either the same line or as separate lines. The following example shows the output of a combined tinyurl and the page title:
<user> http://www.cnn.com/2007/TECH/science/11/15/dino.vacuum.ap/index.html <tinyurl> http://tinyurl.com/yvnrh2 [www.cnn.com/2...ap/index.html]: Dinosaur sucked up food like a vacuum - CNN.com
The titlereade feature includes a blacklist function
that can be used to disable the feature for certain
hosts. This is useful in case the title information on
pages from a certain host does not include any
information not already apparent from the URL.
Configuration | ||
The configuration file for this plugin is plugins/TinyUrl/TinyUrlConfig.xml
Commands | ||
The commands section defines the commands for calling tinyurl and control the title reader blacklist. The following commands are supported:
- commandTinyUrl - The command for generating a tinyurl. Please note that if automatic tinyurl generation is enabled (see the automatic-tinyurl configuration option below), this command is ignored by the plugin.
- commandAddLastUrlToBlackList - The command for adding the host of the last processed URL to the titlereader blacklist. The host is added to the channel specific blacklist.
- commandListChannelBlackLists - The command for listing the titlereader blacklist contents. Lists both the channel specific and the global blacklist contents.
- commandRemoveFromBlackList - The command for removing a host from the channel specific titlereader blacklist.
You can set the authLevel to control who is allowed to access each command:
- authLevel - ANY, ADMIN, MASTER, TRUSTED, NONE
<commands> <commandTinyUrl authLevel="none">!tinyurl</commandTinyUrl> <commandAddLastUrlToBlackList authLevel="none">!tinyurl add blacklist</commandAddLastUrlToBlackList> <commandListChannelBlackLists authLevel="none">!tinyurl list blacklist</commandListChannelBlackLists> <commandRemoveFromBlackList authLevel="none">!tinyurl remove blacklist</commandRemoveFromBlackList> </commands>
TinyUrl configuration | ||
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>
Titlereader configuration | ||
titlereader / enable
Enables or disabled the titlereader functionality
<titlereader> ... <enable>true</enable> ... </titlereader>
titlereader / singlelineoutput
If enabled, page titles will be displayed on the same line after the tinyurl. If disabled, page titles are displayed on an own row
<titlereader> ... <singlelineoutput>true</singlelineoutput> ... </titlereader>
titlereader / output_view_blacklist_to_channel
If enabled, viewing titlereader blacklist will send output to channel. If disabled, output is sent as private message
<titlereader> ... <output_view_blacklist_to_channel>false</output_view_blacklist_to_channel> ... </titlereader>
titlereader-blacklist
List of hosts that should be ignored by the
titlereaded. The channel attribute indicates the
host is on the channel specific blacklist. If
the channel attribute is missing, the host is on
the global blacklist.
NOTE:
This section is automatically updated when hosts
are added or removed during runtime.
<titlereader-blacklist> <host>www.dilbert.com</host> <host channel="#sample">www.shoutfile.com</host> </titlereader-blacklist>
Messages | ||
The message section configures the messages sent to the channel when the TinyUrl plugin is used.
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>
messages / msgBlackListAdd
Printed when a request was made to add the host of the last URL on the channel to the titlereader blacklist
<messages> .. <msgBlackListAdd>Page titles will not be reported for the following host:</msgBlackListAdd> .. </messages>
messages / msgBlackListAddFailure
Printed in case the host could not be parsed from the last URL on the channel
<messages> .. <msgBlackListAddFailure>Failed to add host to titlereader blacklist</msgBlackListAddFailure> .. </messages>
messages / msgBlackListRemove
Printed when a host was removed from the titlereaded blacklist. Appended with host name.
<messages> .. <msgBlackListRemove>Host removed from titlereader blacklist:</msgBlackListRemove> .. </messages>
messages / msgBlackListRemoveFailure
Printed in case the host could not be removed from the blacklist or the host was not found on the blacklist. Appended with the host name.
<messages> .. <msgBlackListRemoveFailure>Failed to remove host from titlereader blacklist:</msgBlackListRemoveFailure> .. </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:
As configured
Where to give command:
channel (message, action, notice)
Outputs to:
channel
Example(s):
- !tinyurl
- !tinyurl http://some.host.com/some/path
Add host to titlereader blacklist | ||
Command:
!tinyurl add blacklist
Description:
Adds the host of the last given URL to the
titlereader channel specific blacklist. Titles will
not be displayed for URLs from the host anymore.
Auth Level:
As configured
Where to give command:
channel (message, action, notice)
Outputs to:
channel
Example(s):
- !tinyurl add blacklist
List titlereader blacklist | ||
Command:
!tinyurl list blacklist
Description:
Lists the contents of the titlereader blacklist.
Shows the global blacklist and the channel specific
blacklist for the channel the command was given on.
Auth Level:
As configured
Where to give command:
channel (message, action, notice)
Outputs to:
channel or private message. Depends on
configuration.
Example(s):
- !tinyurl list blacklist
Remove host form titlereader blacklist | ||
Command:
!tinyurl remove blacklist [host]
Description:
Removes the given host from the channel specific
titlereader blacklist.
Note: the global blacklist can be modified only by
editing the plugin configuration file.
Auth Level:
As configured
Where to give command:
channel (message, action, notice)
Outputs to:
channel
Example(s):
- !tinyurl remove blacklist www.dilbert.com
Change History | ||
v1.2 | Version 2.0 by Dan Silfvast. Added titlereader functionality. |
v1.1 | Version 1.1 by xkr47 |
v1.0 | First Version by xkr47 |