share_counter 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45fd928678903ce9c5d4bff5d6ec741a91fc5dfb
4
- data.tar.gz: 51039ad9ccf8ba41a2b8f43bf5912e1d46bac7b7
3
+ metadata.gz: 0026d0121a27fe9d9b4d3fcece1f80462980978b
4
+ data.tar.gz: 241427ae602ab26425318ff2213851a55ce1700a
5
5
  SHA512:
6
- metadata.gz: bde0b084ecf1201a108cfc6635f9cd830ef9cd54223b1e7574f2588bc8eb2c0eec09adc0d44a43530741a4ef99bb57a7644aa3392b09b0f1ea066ef5ffeb5762
7
- data.tar.gz: 454686d4b4ca7f30d62f4228a133bec3945ea649323f480cfa4aab4da1b77ad09480ffc3d7e3f9baf183aaba6b64ba9958a0c30cf5501f9f7821f1ea6a477f90
6
+ metadata.gz: ce2985938f2f21524768991f121e8e840401660f09412080569bf0ae2fac17344f9f898f4bffd78738ef2c2448b6e0a2e27ed6c025882336f9e09624755acba6
7
+ data.tar.gz: 1b137a8cedceccacf10514d5070252f74157cc67c325a751b2162742ea50f3e642f1e93556c0dc164ee4c0cacbf9c3b53e05633304e7c64bd474da65665364a2
data/README.md CHANGED
@@ -6,7 +6,7 @@ Services currently supported:
6
6
 
7
7
  Facebook
8
8
 
9
- Twitter
9
+ Twitter (not yet supported by twitter http://www.i-programmer.info/news/155-social-media/9048-twitter-switches-off-json-api-no-more-tweet-counts.html)
10
10
 
11
11
  Linkedin
12
12
 
@@ -6,6 +6,8 @@ module ShareCounter
6
6
  def self.twitter url
7
7
  html = make_request "http://urls.api.twitter.com/1/urls/count.json", url: url
8
8
  return JSON.parse(html)['count']
9
+ rescue Exception
10
+ 0
9
11
  end
10
12
 
11
13
  def self.facebook url
@@ -73,7 +75,6 @@ module ShareCounter
73
75
  ? response.gsub(/\A\/\*\*\/\s+/, "").gsub(/^(.*);+\n*$/, "\\1").gsub(/^#{params[:callback]}\((.*)\)$/, "\\1") \
74
76
  : response
75
77
  rescue => e
76
- puts "Failed #{attempts} attempt(s) - #{e}"
77
78
  attempts += 1
78
79
  if attempts <= 3
79
80
  sleep 2
@@ -1,3 +1,3 @@
1
1
  module ShareCounter
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: share_counter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Davide Santangelo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-06 00:00:00.000000000 Z
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler