How best to deliver notifications to various IM /

2019-07-12 19:50发布

问题:

We have a website which provides time-critical updates on changes in the value of FOO, and want to deliver notifications of new data via various IM protocols.

For reasons best known to themselves (and their parents), the FOO-traders use Yahoo! Messenger, MSN, gTalk, AIM, you name it. They want to receive their updates on their desktops so they can buy and sell FOO realtime.

We want to deliver the updates to them via the various networks, without investing a huge amount of time in supporting new networks.

I'm aware of services like RPX (or whatever it's now called) and Gigya, which allow you to authenticate across multiple websites. I want something similar, but which allows us to deliver IM to the same various networks.

The service should be able to readily expose access to notifications coming from a PHP (Drupal 7) website.

The website is a paid subscription service; we are not after a cross-network spam solution. I say this (1) so you won't hate me (2) because if we wanted to send spam, that would probably preclude gateway providers.

Self-hosted solutions like PHPurple are an option also, but I haven't found much online to recommend it as an option yet.

Support for other networks will be a bonus, although I haven't seen any of the FOO-traders use Twitter yet. We will also include SMS and email notification for added old-school cred.

回答1:

Through Jabber server.

  1. Set up Jabber server
  2. Register accounts for all the services you going to use
  3. Register gateways, all jabber servers support them
  4. Test through GUI jabber client
  5. Write a daemon (or get somewhere), which logs into jabber, starts up gateways, reads messages from somewhere and sends them right away.

There are command-line utilities, but they won't work, because server won't keep gateways connected unless on it's own.

XMPP protocol is quite straightforward and has many libraries.

For reliable SMS you might need to use other, 3rd party protocols or utilities.