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 +4 -4
- data/README.md +1 -1
- data/lib/share_counter.rb +2 -1
- data/lib/share_counter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0026d0121a27fe9d9b4d3fcece1f80462980978b
|
4
|
+
data.tar.gz: 241427ae602ab26425318ff2213851a55ce1700a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce2985938f2f21524768991f121e8e840401660f09412080569bf0ae2fac17344f9f898f4bffd78738ef2c2448b6e0a2e27ed6c025882336f9e09624755acba6
|
7
|
+
data.tar.gz: 1b137a8cedceccacf10514d5070252f74157cc67c325a751b2162742ea50f3e642f1e93556c0dc164ee4c0cacbf9c3b53e05633304e7c64bd474da65665364a2
|
data/README.md
CHANGED
data/lib/share_counter.rb
CHANGED
@@ -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
|
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.
|
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-
|
11
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|