Module: PowerTrack::API

Included in:
Stream
Defined in:
lib/powertrack/streaming/api.rb

Instance Method Summary collapse

Instance Method Details

#add_rule(rule) ⇒ Object

Adds one rule to your PowerTrack stream’s ruleset.

POST /rules

See support.gnip.com/apis/powertrack/api_reference.html#AddRules



17
18
19
# File 'lib/powertrack/streaming/api.rb', line 17

def add_rule(rule)
  add_rules(rule)
end

#add_rules(*rules) ⇒ Object

Adds many rules to your PowerTrack stream’s ruleset.

POST /rules

See support.gnip.com/apis/powertrack/api_reference.html#AddRules

Raises:

  • (NotImplementedError)


8
9
10
# File 'lib/powertrack/streaming/api.rb', line 8

def add_rules(*rules)
  raise NotImplementedError
end

#delete_rule(rule) ⇒ Object

Removes the specified rule from the stream.

DELETE /rules POST /rules?method=_delete

See support.gnip.com/apis/powertrack/api_reference.html#DeleteRules



37
38
39
# File 'lib/powertrack/streaming/api.rb', line 37

def delete_rule(rule)
  delete_rules(rule)
end

#delete_rules(*rules) ⇒ Object

Removes the specified rules from the stream.

DELETE /rules POST /rules?method=_delete

See support.gnip.com/apis/powertrack/api_reference.html#DeleteRules

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/powertrack/streaming/api.rb', line 27

def delete_rules(*rules)
  raise NotImplementedError
end

#list_rules(options = nil) ⇒ Object

Retrieves all existing rules for a stream.

GET /rules

See support.gnip.com/apis/powertrack/api_reference.html#ListRules

Options: o compressed: [true|false] To demand gzip-compressed response from GNIP

true by default

o objectify: [true|false] To demand PowerTrack::Rule object as results

instead of raw JSON. True by default.

Raises:

  • (NotImplementedError)


52
53
54
# File 'lib/powertrack/streaming/api.rb', line 52

def list_rules(options=nil)
  raise NotImplementedError
end

#track(options = nil) ⇒ Object

Establishes a persistent connection to the PowerTrack data stream, through which the social data will be delivered.

GET /track/:stream

See support.gnip.com/apis/powertrack/api_reference.html#Stream

Raises:

  • (NotImplementedError)


62
63
64
# File 'lib/powertrack/streaming/api.rb', line 62

def track(options=nil)
  raise NotImplementedError
end