funky 0.2.24 → 0.2.25

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: 1fccf2ed58806903a1dacc0e533b2c502f5c51e5
4
- data.tar.gz: 0b92742b5b3ce652f1e61adc1bb4a9ab07b19871
3
+ metadata.gz: 268438a57d6076e2cee11b564babe1987b212ea9
4
+ data.tar.gz: e3ff636db3b921f81ad22b2c13cb660c6e17cb5c
5
5
  SHA512:
6
- metadata.gz: 2c57cf3a237bec4b10ca873a493ec2efc3d9370508c984e21ea98549db3543900c1a51aacc987a60c144c8ec8591fad4172a6c7923ee1b4e9ced03c999965511
7
- data.tar.gz: 428875be6b1fa05babf65e9c46ac13ad7e2f52500cf6ca5b19ef43fa1b419146fa9cbad28cf4f7b49711b7e539275548810313cc690072d189db457ec573bcba
6
+ metadata.gz: a30cb5465c2235b26e65ae3d3aabe86efe0df1c0a1707713a2ba147cbc44273b7b7e89b488d15f460158e56a40c7a8176bd7ecf98b4922d815fc0c05784d837b
7
+ data.tar.gz: 256c4f2469dedf5c38e76b2ceaedb9bd424794f5d6246ce5e80c051c9a761edde2f72968a405bd956a51f45028fd896f80570317f65f6824667d8bcd3459c3f0
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ For more information about changelogs, check
6
6
  [Keep a Changelog](http://keepachangelog.com) and
7
7
  [Vandamme](http://tech-angels.github.io/vandamme).
8
8
 
9
+ ## 0.2.25 - 2017/05/16
10
+
11
+ * [FEATURE] Retry up to 5 times if Facebook responds with error
12
+
9
13
  ## 0.2.24 - 2017/05/10
10
14
 
11
15
  * [BUGFIX] Raise Funky::ContentNotFound error when a page does not return
@@ -29,8 +29,8 @@ module Funky
29
29
  end
30
30
 
31
31
  def self.fetch_multiple_pages(uri)
32
- json = json_for(uri)
33
32
  puts "Fetching '#{uri.path}' until #{ URI.decode_www_form(uri.query).to_h['until'] || 'now'}"
33
+ json = json_for(uri)
34
34
  if json[:data].empty?
35
35
  @try_count ||= 0
36
36
  if @previous_timestamp && @try_count < 1 && (Date.parse @previous_timestamp rescue nil)
@@ -9,7 +9,7 @@ module Funky
9
9
  Net::HTTP::Get.new(uri.request_uri)
10
10
  end
11
11
 
12
- def self.response_for(http_request, uri, max_retries = 3)
12
+ def self.response_for(http_request, uri, max_retries = 5)
13
13
  response = Net::HTTP.start(uri.host, 443, use_ssl: true) do |http|
14
14
  http.request http_request
15
15
  end
@@ -26,7 +26,7 @@ module Funky
26
26
 
27
27
  def self.sleep_and_retry_response_for(http_request, uri, retries, message)
28
28
  if retries > 0
29
- sleep (4 - retries) ** 2
29
+ sleep (6 - retries) ** 2
30
30
  response_for http_request, uri, retries - 1
31
31
  else
32
32
  raise ConnectionError, message
data/lib/funky/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Funky
2
- VERSION = "0.2.24"
2
+ VERSION = "0.2.25"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.24
4
+ version: 0.2.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-10 00:00:00.000000000 Z
11
+ date: 2017-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler