User:Ommina

From AniDB
Revision as of 22:12, 25 March 2008 by Ommina (talk | contribs) (New page: == Notify Commands == === Introduction === Broadly speaking, notifications provide an indication to the client that some event has occurred within the AniDB database. There are three ty...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Notify Commands

Introduction

Broadly speaking, notifications provide an indication to the client that some event has occurred within the AniDB database.

There are three types:

  • New file notification. (Only anime type supported.)
  • New private message notification.
  • New buddy event notification.

Note that, while a user can subscribe to multiple 'new file' events (link to wiki Notifications page here), at present, the UDP API only supports notifications of new files by anime. New files by group, or new files by producer, are NOT presently supported.

Two HOWTOs...

These commands offer a way to receive different types of notifications:

Simple HOWTO:

  • PUSH to register your client session.
  • Listen for 271-274 NOTIFICATIONs (not 290).
  • PUSHACK the NOTIFICATIONs received (with the supplied id [nid]).
  • Use NOTIFY to get number of notifications / NOTIFYLIST to get a list of the notifications (with ids [not nid]).
  • Use NOTIFYGET to receive a notification.
  • Use NOTIFYACK to acknowledge a notification (from NOTIFYLIST).

It is probably a good idea to use tags to separate NOTIFICATIONs from the other communication. NOTIFICATIONs will never have tags.

NOTE The word "notification" is used a bit inconsistently in this document. An AniDB notification is originally a "new file notification". It might be more correct to use the term "event" for the original "happening" and then "notification" as the means to notify the user (client). New-file, new-message, buddy-* and going-down are all events that results in notifications. Only the first two type of events are persistent, though, meaning they exist and remain in the same state until some user action affects them.

PUSH: UDP Notification Registration

With this command you can register your client as an observer for anidb notification events for the current user. If you are registered for one or more event types the anidb server will send an UDP packet (format see below) on each change which affects the current user. The UDP packet is sent to the ip and port from which the AUTH command was recieved.