To automatically start the synchronize action and retrieve tweets from a Twitter stream, create a new fetch task using the following procedure.
Twitter allows a user account to connect to only one stream at a time. If you run multiple fetch tasks concurrently (by setting the TaskThreads
parameter) and these tasks connect to Twitter streams, Twitter might close the connections.
To retrieve information from a Twitter stream
In the [Ingestion]
section of the configuration file, set the IngestBatchSize
parameter:
IngestBatchSize
|
The number of documents to send to the ingestion server in each batch. If you are processing large numbers of streamed tweets and sending the information to CFS, Micro Focus recommends setting this parameter to 500 or greater. The Twitter Connector sends metadata-only documents to CFS, and CFS can process large batches more efficiently than small batches. |
In the [FetchTasks]
section of the configuration file, specify the number of fetch tasks using the Number
parameter. If you are configuring the first fetch task, type Number=1
. If one or more fetch tasks have already been configured, increase the value of the Number
parameter by one (1). Below the Number
parameter, specify the names of the fetch tasks, starting from zero (0). For example:
[FetchTasks] Number=1 0=MyTask
Below the [FetchTasks]
section, create a new TaskName section. The name of the section must match the name of the new fetch task. For example:
[FetchTasks] Number=1 0=MyTask [MyTask]
In the new section, set the following parameter:
StreamType
|
A string that specifies the tweets that you want to retrieve.
|
If you are using the statuses/filter
stream type, set one or more of the following parameters to retrieve tweets related to specific users, geographic regions, or keywords. If you do not set any of these parameters, the connector does not retrieve any tweets.
Follow
|
A comma-separated list of Twitter user names or IDs. Do not include the ‘@’ character before the Twitter user name. |
Location
|
A comma-separated list of longitude and latitude values to identify specific geographic regions. Each region is a square, defined by four values in the following order: [Longitude West], [Latitude South], [Longitude East], [Latitude North]. |
Track
|
A comma-separated list of keywords. |
For more information about these parameters, refer to the Twitter Connector Reference.
Language
parameter to a comma-separated list of BCP 47 language codes that correspond to any of the languages listed on the Twitter advanced search page (https://twitter.com/search-advanced). For example, to retrieve only those tweets that Twitter has identified to be written in English, set Language=en
.FilterLevel
configuration parameter. For example, FilterLevel=medium
.Save and close the configuration file. You can now start the connector.
|