Rules API Methods
The following Ruby snippets demonstrate how to perform the following rule-management operations on the Rules API of Gnip's Data Collector streams.
- Add a rule to a stream
- Delete a rule from a stream
- Retrieve the list of rules for a stream
Each snippet can be modified to perform these operations on:
- Data Collector streams, using JSON formatted rules
- Data Collector streams, using XML formatted rules
Each snippet provides examples of what the stream URL should look like for each type described above, and includes specific lines that may be commented or uncommented depending on the type of stream you are using.