StreamChannels
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
Summary
Parameters:
-
apiClient
Twit -
options
ObjectYou 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 | ArrayPass an object describing your channels. If you don't want to use channels, you can pass directly an array of keywords.
-
[follow]
String optionalA comma separated list of user IDs, indicating the users to return statuses for in the stream
-
[locations]
String optionalSpecifies 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 optionalIf true, will fire the events like 'channels/channelName'
-
[enableRootChannelsEvent=true]
Boolean optionalIf true, will fire the event 'channels'
-
[enableKeywordsEvents=false]
Boolean optionalIf true, will fire the events 'keywords/keywordName' (disabled by default)
-
Returns:
Item Index
Methods
_getOptionsToPassToApiClient
Syntax
Summary
Formats options passed with non-duplicate tracked keywords
Parameters:
-
options
Object
Returns:
addGenericEvents
Syntax
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 optionalIf true, will fire the events like 'channels/channelName'
-
[enableRootChannelsEvent=true]
Boolean optionalIf true, will fire the event 'channels'
-
[enableKeywordsEvents=false]
Boolean optionalIf true, will fire the events 'keywords/keywordName' (disabled by default)
-
Returns:
getChannels
Syntax
getChannels
()
StreamChannels.channels
Summary
Returns your channel description
Returns:
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:
getTrackedKeywords
Syntax
Summary
Returns an array of the keywords you're tracking (duplicates were removed)
Returns:
removeAllListeners
Syntax
Summary
Removes all the listeners added
See more methods http://nodejs.org/api/events.html#events_events
Parameters:
-
event
String
Returns:
removeEvents
Syntax
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 optionalIf true removes all the listeners set on the stream
-
Returns:
start
Syntax
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
Summary
Closes the opened stream with Twitter