Kippt TCL plugin for Eggdrop
Kippt is a link sharing site. People using IRC typically have an Eggdrop bot on their channel. With this TCL-script the bot can be used to post links presented in an IRC-channel to the Kippt service.
Instructions
Requirements
- Kippt account
- Kippt API token
- Kippt list ID to use
- Kippt list name to use
- Working Eggdrop-bot
- TCL-extensions:
- http
- tls
- json
- Permissions to add new files into Eggdrop
- Permissions to manage channel flags
- Make a choice what operation mode eggdrop takes when it receives:
- Mesg directly to bot will always be posted immediately.
- Somebody saying "!kippt http://da.fancy.url.hre" on the channel will always be posted immediately.
- Optionally somebody saying something like "Hey check this out, http://da.fancy.url.hre it is really cool!" on the channel, can be handled if bot is properly configured to do so. The person saying an URL will need to confirm posting.
Setup
- Make sure the required extensions are available. If any are missing, your bot won't survive rehash / restart.
- Copy the script and example configuration file from:
- Make your Eggdrop load the Kippt-script.
Add something like this: source scripts/kippt.tcl
into your bot.conf-script. - Edit kippt.conf configuration file:
- Your Kippt username: set conf(kippt_user)
- Your Kippt token: set conf(kippt_token)
- Human readable URL to your list to be displayed in help:
append conf(kippt_list_URL) - Machine readable numeric id to your list: set conf(kippt_list_id)
Getting the list ID is tricky, the information is not available anywhere in Kippt user interface.
To get a JSON-list of your lists, run curl, remember to replace your username and API-token to the command:
curl -X GET -H "X-Kippt-Username: (kippt_user)" \
-H "X-Kippt-API-Token: (kippt_token)" \
https://kippt.com/api/lists/
- Confirm your system character encoding. Out of the box kippt.tcl uses UTF-8.
There is:
encoding system "utf-8"
in the TCL-script. - Confirm your IRC-channel character encoding. kippt.tcl can output text in different character encoding from your system encoding, the setting is in kippt.conf:
set conf(output_encoding) "utf-8" - Rehash (or restart) Eggdrop to load the new script: .rehash
- If there were no errors during rehash, setup is ready.
Operation
Private Msg to bot
By sending a message "!kippt" to bot, it will process any kippt command. Bot will reply as mesg.
Using commands on a channel
Out-of-the-box bot will not react to somebody saying "!kippt" on a channel. Bot master can enable this behaviour with eggdrop-command:
.chanset #my-cool-channel +kippt
Or disable this behaviour with eggdrop-command:
.chanset #my-cool-channel -kippt
Confirm current setting in user defined channel flags with eggdrop-command:
.chaninfo #my-cool-channel
When public channel behaviour is enabled and bot is on the channel, Kippt can be controlled by saying "!kippt". Note that the exclamation mark must the first character on the line, otherwise any text will not be considered as a command.
Saying URL on a channel
As default, any URL said on the channel with bot enabled will be processed. The bot will require confirmation before posting the URL.
The user saying the text can confirm posting by saying:
!kippt yes
or deny posting by saying:
!kippt no
or confirm and optionally describe link by saying:
!kippt yes Check out my cool URL!
The post will expire in 60 seconds and will be resolved as !kippt no. Any other URLs said to channel by that user will be ignored during 60 second wait period. Also any other user can NOT confirm or deny posting.
This behaviour can be disabled from kippt.conf setting:
set conf(match_any_public_http) to other than 0. Then only way of posting URLs to Kippt is using mesg or command.
Commands
- !kippt help - Display help
- !kippt <any resonable URL> <optional description of the link> - Post the URL into Kippt immediately, no confirmation required. Any other text is considered as description and will be added as note the link.
- !kippt recent - Display list of recently posted URLs
- !kippt urls - Display Kippt URLs which can be used by human users