gnip_api 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1a03c01f8a95a5621c8f373ad4c5f2067e17ee3
4
- data.tar.gz: d9e4ad8ec4efdf87050a69df72ade7463da1064c
3
+ metadata.gz: fa62208071b71ee1b39f62ea2e2a1f828a1988d9
4
+ data.tar.gz: aba53bd23b19aab7e0d8093cd0d17032173956f8
5
5
  SHA512:
6
- metadata.gz: 3b4ea27632b292fb770554048fda192e39105c6b2eb4126132317792304ae9ee69637216325167a04b953cb6c10f29a1370bb0f513bcb374778239dafc3cfa14
7
- data.tar.gz: 96e048454f85a96147052f24ba442343b4113630725154d84db567b02453cb6b68112820bc1ce974383ed1b9eddde31b142f460ed9f20599b5486a7522b4bb61
6
+ metadata.gz: c9b59171474daf4d71ba16aea659c2c5c86d502fd9c0c63d79489f4601e1d300ea4120f66f3aea7e6755d2c1649e584259624eec22d87fb4be90cbbf8aa3206a
7
+ data.tar.gz: 55d5b7fe81df412c02fd6f4386a692df3b381ee62ed40ecdad611efe2bf7019f26b3940208f601ff09c10299dcaa1ffd4b712fc5a37ca25565cc7e0b031f08b5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gnip_api (1.1.0)
4
+ gnip_api (1.1.1)
5
5
  addressable
6
6
  httparty
7
7
  yajl-ruby
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ### Important: Gnip will be ending support for v1 endpoints on December 1 of 2016. GnipApi will be updated to work with v2, backward compatibility won't be posible after the deadline.
1
+ ### Important: Gnip support for PowerTrack v1 are officially deprecated.
2
2
 
3
3
  # GnipApi
4
4
 
@@ -59,6 +59,12 @@ Note that you'll need a source and a label. Source is the data source within Gni
59
59
 
60
60
  ### Search API
61
61
 
62
+ ## Important
63
+
64
+ While using the Full Archived Histocial keep in mind Gnip seems to have some issues with their pagination on certain situations. You may face 503 errors which are unrecoverable from client side. If you come across this error please report the situationt to Gnip.
65
+
66
+ ## Overview
67
+
62
68
  The Search API allows you to get counts or activities in a time period, with a maximum period size of 30 days per request. PowerTrack rules are used as query parameter, but be careful **PowerTrack operators may not be supported on Search API or could behave differently**. Read the Gnip docs to make sure.
63
69
  To access the Search API you will need a rule first, you can use PowerTrack Rule object for it:
64
70
 
@@ -51,6 +51,8 @@ module GnipApi
51
51
  else
52
52
  error_message = response.error_message
53
53
  @logger.error "#{response.request_method} request to #{response.request_uri} returned with status #{response.status} FAIL: #{error_message}"
54
+ raise GnipApi::Errors::Adapter::GnipSoftwareError.new error_message if response.status == 503 || response.status == '503'
55
+ # raise GnipApi::Errors::Adapter::RateLimitedError.new error_message if response.status == 429
54
56
  raise GnipApi::Errors::Adapter::RequestError.new error_message
55
57
  end
56
58
  end
@@ -19,6 +19,12 @@ module GnipApi
19
19
  @message = msg
20
20
  end
21
21
  end
22
+
23
+ class GnipSoftwareError < StandardError
24
+ def initialize msg='Gnip Software Error'
25
+ @message = msg
26
+ end
27
+ end
22
28
  end
23
29
 
24
30
  module PowerTrack
@@ -16,6 +16,10 @@ module Gnip
16
16
  @message_type ? true : false
17
17
  end
18
18
 
19
+ def compliance_message?
20
+ GnipApi::Gnip::Message::TWITTER_COMPLIANCE_MESSAGES.include? @object_type
21
+ end
22
+
19
23
  def error?
20
24
  @message_type == 'error'
21
25
  end
@@ -1,3 +1,3 @@
1
1
  module GnipApi
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -83,6 +83,9 @@ describe Gnip::Message do
83
83
  message = Gnip::Message.build(data)
84
84
  expect(message.class).to eq(Gnip::TwitterComplianceMessage)
85
85
  end
86
+
87
+
88
+
86
89
  end
87
90
 
88
91
  context 'system_message' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnip_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rayko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-09 00:00:00.000000000 Z
11
+ date: 2017-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler