b.oooom.net eggdrop script
Requirements: A recent version of TCL which has the HTTP package included. (How do I check?), and a recentish eggdrop.
If you need to prevent individual users (or a range of hostmasks) from using the script, add them to the userfile and give them the
- Get a coffee
- Download the script and put it in your eggdrop's scripts dir.
- Edit your bot's configuration file and put something like
source scripts/boooom.tcl in the appropriate place (at the end).
- Edit the script to set the configuration variables as required. Don't worry about which channels it'll run on, that comes later.
.rehash your bot
- For each channel you want to enable the script on,
.chanset #channel +shrinkurl
- If you want the script to try to fetch the page title for the URL and say that too (after the shrunk URL), also
.chanset #channel +tasteurl. The channel must have URL shrinking enabled for this to work.
- Drink the coffee
B flag globally:
.chattr username +B. You can change the flag used by editing the script if it clashes with something else.
Interacting with the script
Say the URL in the channel
If the URL you say is sufficently long (default: 50 chars) then the bot will follow with the shrunk version.
You can tag a URL not work safe by putting "NWS" or "NSFW" in the line with the URL.
[JamesOff] http://www.jamesoff.net/somelongnaughtyimage <-- NWS
[NoTopic] http://b.oooom.net/someid [NWS]
Message the bot
/msg the bot with "
shrink URL" and it will reply with the shrunk form.
You probably have to be on a channel with the bot for this to work (configurable).
The URL doesn't have to be over the 50 char limit to be shrunk (configurable).
[msg->NoTopic] shrink http://www.jamesoff.net/somelongurl
You may also be able to get the bot to relay your shrunk URL to a channel. For this to work, you MUST be in that channel. The script must also be enabled for that channel.
To do this, add "
[msg->NoTopic] shrink http://www.jamesoff.net/somelongurl NWS
[msg<-NoTopic] http://b.oooom.net/someid [NWS]
-> #channel" after the URL. If you want to tag a URL as NWS, put that before the redirection.
The bot will announce the URL in the channel, including the fact that you asked it to.
[msg->NoTopic] shrink http://www.jamesoff.net/somelongurl -> #somechan
[NoTopic/#somechan] http://b.oooom.net/someid (from JamesOff)
[msg->NoTopic] shrink http://www.jamesoff.net/somelongurl NWS -> #somechan
[NoTopic/#somechan] http://b.oooom.net/someid [NWS] (from JamesOff)