twitter-stream-channels

API Docs for: 1.0.0
Show:

StreamChannels

Extends events.EventEmitter
Module: twitter-stream-channels

Summary

The constructor itself of this class is private, you should open a StreamChannels via TwitterStreamChannels.streamChannels(options)

Check out the available events in the README on the github repo.

Constructor

StreamChannels

Syntax

StreamChannels

(
  • apiClient
  • options
)
StreamChannels private

Summary

Parameters:

  • apiClient Twit
  • options Object

    You can use the same filter options as described in the Twitter stream API for statuses/filter https://dev.twitter.com/docs/api/1.1/post/statuses/filter

    • track Object | Array

      Pass an object describing your channels. If you don't want to use channels, you can pass directly an array of keywords.

    • [follow] String optional

      A comma separated list of user IDs, indicating the users to return statuses for in the stream

    • [locations] String optional

      Specifies a set of bounding boxes to track. More about how to format this parameter here : https://dev.twitter.com/docs/streaming-apis/parameters#locations

    • [enableChannelsEvents=true] Boolean optional

      If true, will fire the events like 'channels/channelName'

    • [enableRootChannelsEvent=true] Boolean optional

      If true, will fire the event 'channels'

    • [enableKeywordsEvents=false] Boolean optional

      If true, will fire the events 'keywords/keywordName' (disabled by default)

Returns:

Methods

_getOptionsToPassToApiClient

Syntax

_getOptionsToPassToApiClient

(
  • options
)
Object private

Summary

Formats options passed with non-duplicate tracked keywords

Parameters:

Returns:

addGenericEvents

Syntax

addGenericEvents

(
  • twitterStream
  • streamChannels
  • [options]
)
StreamChannels private

Summary

Adds the events (specifics and propagated from twitter API client), according to options

Parameters:

  • twitterStream Twit
  • streamChannels StreamChannels
  • [options] Object optional
    • [enableChannelsEvents=true] Boolean optional

      If true, will fire the events like 'channels/channelName'

    • [enableRootChannelsEvent=true] Boolean optional

      If true, will fire the event 'channels'

    • [enableKeywordsEvents=false] Boolean optional

      If true, will fire the events 'keywords/keywordName' (disabled by default)

Returns:

getChannels

Syntax

getChannels

() StreamChannels.channels

Summary

Returns your channel description

Returns:

StreamChannels.channels:

getchannelsKeywordsLowerCasedRegExp

Syntax

getchannelsKeywordsLowerCasedRegExp

() StreamChannels.channels

Summary

Returns an object key/value - key:your channels - value:the full text search RegExp for the keywords of this channel

Returns:

StreamChannels.channels:

getTrackedKeywords

Syntax

getTrackedKeywords

() Array

Summary

Returns an array of the keywords you're tracking (duplicates were removed)

Returns:

removeAllListeners

Syntax

removeAllListeners

(
  • event
)
StreamChannels

Summary

Removes all the listeners added

See more methods http://nodejs.org/api/events.html#events_events

Parameters:

Returns:

removeEvents

Syntax

removeEvents

(
  • twitterStream
  • streamChannels
  • [options]
)
StreamChannels private

Summary

Removes the events (specifics and propagated from twitter API client), according to options

Parameters:

  • twitterStream Twit
  • streamChannels StreamChannels
  • [options] Object optional
    • [removeAllListeners=false] Object optional

      If true removes all the listeners set on the stream

Returns:

start

Syntax

start

() StreamChannels

Summary

Call this function to restart the stream after you called .stop() on it.

Note: there is no need to call .start() to begin streaming. TwitterStreamChannels.streamChannels calls .start() for you.

Returns:

stop

Syntax

stop

(
  • [options]
)
StreamChannels

Summary

Closes the opened stream with Twitter

Parameters:

  • [options] Object optional
    • [removeAllListeners=false] Object optional

      If true removes all the listeners set on the stream

Returns: