This project is not covered by Drupal’s security advisory policy.

Overview

This module provides a daemon for consuming the Twitter Streaming API, configurable through your Drupal site and via hooks.

The received tweets are stored via Twitter Module.

Requirements

External Libraries

The following libraries must be placed in the module directory for the daemon to run:

Phirehose

System_Daemon

Installation & Configuration

A Twitter account needs to be specified on the module's configuration settings page after it has been authorized through Twitter Module.

By default the daemon will be run as the Ubuntu Apache user (www-data), but this can be modified for other systems and distros on the settings page.

The daemon can be started manually by executing sudo php twitterstream_daemon.php. Messages will be logged to /var/log/twitterstream.log.

Module Hook

Other modules can provide search terms or user ids to watch via a hook:

hook_twitterstream_params() {
  return array(
    'modulename' => array(
      'follow' => array(
        // Twitter user ids (usernames are not allowed)
      ),
      'track' => array(
        // Hashtags or single-word search terms
      ),
    )
  );
}

This hook is called on cron run, and the daemon will update soon afterwards.

For more timely changes, a module can update it's own parameters explicitly:

twitterstream_update_params('modulename', array(
  'follow' => array(), 
  'track' => array(),
));

Future Development

  • Implement example module that allows entering static values to follow and track
  • Allow creating Debian/Ubuntu init scripts

Github Mirror

https://github.com/gapple/twitterstream

Project Information

Downloads