Open topic with navigation

# Retrieve Information from a Twitter Stream

To automatically start the synchronize action and retrieve tweets from a Twitter stream, create a new fetch task using the following procedure.

NOTE:

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

1. Before creating a fetch task, configure OAuth authentication by following the procedure described in Configure OAuth Authentication.
2. Stop the connector.
3. Open the connector’s configuration file in a text editor.

4. 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.

5. 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

6. 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]

7. In the new section, set the following parameter:

   `StreamType` | A string that specifies the tweets that you want to retrieve. statuses/filter. The connector retrieves any tweet that matches `Language` (if set) and `FilterLevel`, and at least one of the parameters `Follow`, `Location`, or `Track` (see the following steps) statuses/sample. (This is the default) The connector retrieves a random sample of public tweets that match both `Language` (if set) and `FilterLevel`. The `Follow`, `Location`, and `Track` parameters are ignored.

8. 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.

9. (Optional) To retrieve only those tweets that match specific languages, set the `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`.
10. (Optional) To retrieve only those tweets that match or exceed a specific filter level, set the `FilterLevel` configuration parameter. For example, `FilterLevel=medium`.

11. Save and close the configuration file. You can now start the connector.

© Copyright 2019 Micro Focus or one of its affiliates | Send documentation feedback Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm