IRC API

IRC Bot Nick: TokyoTosho
Channel: #tokyotosho-api
Network: Rizon / irc.rizon.net

For every torrent submission, it will send the following two messages separated by ASCII character 30 to the channel.
For example in mIRC, to get the torrent name, you can use $gettok($1-,5,30)

[string "Torrent"][int ID][string Type][int Type][string Name][string URL][string Size][string Comment]
[string "Torrent_Meta"][int ID][string BTIH][string Username][int Authorized]

BTIH (BitTorrent Info Hash) is a 40 character string.
Username is the logged in username of the submitter.

Authorized:
0 = anonymous (non-enforced tag)
1 = not authorized (tag matched someone else)
2 = authorized

When a user requests a torrent to be deleted, the bot will send the following string by ASCII character 30 to the channel.
[string "Nuke"][int ID][string Type]
Currently types include "hide" or "delete".
Hiding an entry means it is removed from view and cannot be resubmitted,
to force no chance of this entry being re-submitted, typically to correct the torrent itself that requires an {{{info_hash}}} change.
Deleting an entry means it is totally removed from DB, and it could be re-submitted,
typically to correct errors in other information of the entry.

Example mIRC script

on *:TEXT:*:#tokyotosho-api:{
  if ($nick == TokyoTosho) {
    if ($gettok($1-,1,30) == Torrent) {
      var -s %id = $gettok($1-,2,30)
      var -s %type_name = $gettok($1-,3,30)
      var -s %type = $gettok($1-,4,30)
      var -s %name = $gettok($1-,5,30)
      var -s %url = $gettok($1-,6,30)
      var -s %size = $gettok($1-,7,30)
      var -s %comment = $gettok($1-,8,30)

      echo -s msg #tokyotosho 10Release: $+(,$cat_to_color(%type),[,%type_name,]) $+(3,%name)
      echo -s msg #tokyotosho 12Torrent: $+(,%url)
      if ($len(%comment) == 0) {
        echo -s msg #tokyotosho 10Size: %size
      }
      else {
        echo -s msg #tokyotosho 10Size: %size $chr(124) Comment: %comment
      }
    }
  }
}
alias -l cat_to_color {
  if ($1- == 1) { return 6 }
  if ($1- == 2) { return 7 }
  if ($1- == 3) { return 8 }
  if ($1- == 4) { return 4 }
  if ($1- == 5) { return 15 }
  if ($1- == 6) { return 10 }
  if ($1- == 7) { return 11 }
  if ($1- == 8) { return 14 }
  if ($1- == 9) { return 13 }
  if ($1- == 10) { return 9 }
  if ($1- == 11) { return 5 }
}