sharedcount 0.0.1 → 0.0.2

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: 1aa55830f7d51cc5fc0d7bbb7d7ced3fa5684347
4
- data.tar.gz: d65c2e171d8d11dc2cc0fe9b66e83231713ec772
3
+ metadata.gz: 0266ae0e11ce075aa619f0d019109ee62fd0d19b
4
+ data.tar.gz: def78610ec6e6b8a84cf4e1e7e2745a668999c57
5
5
  SHA512:
6
- metadata.gz: 94edc4c6a349f7907937d8c4b1cd270d1e564c24a9e0cdf5d39dfc52c80f15adb4c43db52161464aa7a9fe6fc04b0d9987952d79c602e305e8feb46e46595b3b
7
- data.tar.gz: a7868706901447f1cc938ce54defaa8017f7181df11c5933e8068ef8d63b800292426b150f0c64c05d6ad3db428fcb95696a89525181b7ca125037fef05f86a0
6
+ metadata.gz: 59ace3494805c885cb2211566a46c817cd938d1b94e5b8d111c9d7d3e93c8cc62b0501547317f992d1378860e36ba13e7997af394939dbdba5f49f440b86fee1
7
+ data.tar.gz: 7d4a6083b95adcc4ef6520b4e71476e15a9113ab48864a7a4e079a8fa02bce215df6b7e9c84f36798a8381687792c655b26ab149c5dd7e67e6cbf95fe9d0a7b2
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
@@ -17,8 +17,7 @@ module Sharedcount
17
17
 
18
18
  def fetch(url)
19
19
  response = self.connection.get "/?apikey=#{self.apikey}&url=#{url}"
20
- raw_data = JSON.parse(response.body)
21
- return Sharedcount::Data.new(raw_data)
20
+ return Sharedcount::Data.new(response.body)
22
21
  end
23
22
 
24
23
  end
@@ -5,27 +5,28 @@ module Sharedcount
5
5
  :facebook_clicks, :facebook_total, :facebook_comments, :facebook_likes,
6
6
  :facebook_shares, :delicious_shares, :google_plus_one, :google_buzzs,
7
7
  :twitter_shares, :pinterest_shares, :digg_shares, :linkedin_shares,
8
- :total_actions, :raw_data
8
+ :total_actions, :json_data, :raw_data
9
9
 
10
- def initialize(data)
10
+ def initialize(json_data)
11
11
 
12
- self.raw_data = data
12
+ self.json_data = json_data
13
+ self.raw_data = JSON.parse(json_data)
13
14
 
14
- self.stumble_upon_shares = (data["StumbleUpon"] || nil)
15
- self.reddit_shares = (data["Reddit"] || nil)
16
- self.delicious_shares = (data["Delicious"] || nil)
17
- self.google_plus_one = (data["GooglePlusOne"] || nil)
18
- self.google_buzzs = (data["Buzz"] || nil)
19
- self.twitter_shares = (data["Twitter"] || nil)
20
- self.digg_shares = (data["Diggs"] || nil)
21
- self.pinterest_shares = (data["Pinterest"] || nil)
22
- self.linkedin_shares = (data["LinkedIn"] || nil)
23
- self.facebook_commentsbox = (data["Facebook"]["commentsbox_count"] || nil)
24
- self.facebook_clicks = (data["Facebook"]["click_count"] || nil)
25
- self.facebook_total = (data["Facebook"]["total_count"] || nil)
26
- self.facebook_comments = (data["Facebook"]["comment_count"] || nil)
27
- self.facebook_likes = (data["Facebook"]["like_count"] || nil)
28
- self.facebook_shares = (data["Facebook"]["share_count"] || nil)
15
+ self.stumble_upon_shares = (self.raw_data["StumbleUpon"] || nil)
16
+ self.reddit_shares = (self.raw_data["Reddit"] || nil)
17
+ self.delicious_shares = (self.raw_data["Delicious"] || nil)
18
+ self.google_plus_one = (self.raw_data["GooglePlusOne"] || nil)
19
+ self.google_buzzs = (self.raw_data["Buzz"] || nil)
20
+ self.twitter_shares = (self.raw_data["Twitter"] || nil)
21
+ self.digg_shares = (self.raw_data["Diggs"] || nil)
22
+ self.pinterest_shares = (self.raw_data["Pinterest"] || nil)
23
+ self.linkedin_shares = (self.raw_data["LinkedIn"] || nil)
24
+ self.facebook_commentsbox = (self.raw_data["Facebook"]["commentsbox_count"] || nil)
25
+ self.facebook_clicks = (self.raw_data["Facebook"]["click_count"] || nil)
26
+ self.facebook_total = (self.raw_data["Facebook"]["total_count"] || nil)
27
+ self.facebook_comments = (self.raw_data["Facebook"]["comment_count"] || nil)
28
+ self.facebook_likes = (self.raw_data["Facebook"]["like_count"] || nil)
29
+ self.facebook_shares = (self.raw_data["Facebook"]["share_count"] || nil)
29
30
 
30
31
  self.total_actions = self.stumble_upon_shares + self.reddit_shares + self.delicious_shares + self.google_plus_one + self.google_buzzs + self.twitter_shares + self.digg_shares + self.pinterest_shares + self.linkedin_shares + self.facebook_total
31
32
 
@@ -1,3 +1,3 @@
1
1
  module Sharedcount
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -22,6 +22,11 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency "faraday", '~> 0.9', '>= 0.9.0'
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.10"
25
- spec.add_development_dependency "rake", "~> 10.0"
26
- spec.add_development_dependency "rspec"
25
+ spec.add_development_dependency "rake", "~> 10.1"
26
+ spec.add_development_dependency "rspec","~> 3.3"
27
+ spec.add_development_dependency "vcr", "~> 2.9"
28
+ spec.add_development_dependency "webmock", "~> 1.21"
29
+ spec.add_development_dependency "simplecov", "~> 0.10"
30
+ spec.add_development_dependency "coveralls", "~> 0.8"
31
+ spec.add_development_dependency "yard", "~> 0.8"
27
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sharedcount
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Mostosi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-24 00:00:00.000000000 Z
11
+ date: 2015-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -50,28 +50,98 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '10.0'
53
+ version: '10.1'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '10.0'
60
+ version: '10.1'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rspec
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ">="
65
+ - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0'
67
+ version: '3.3'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ">="
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '3.3'
75
+ - !ruby/object:Gem::Dependency
76
+ name: vcr
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '2.9'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '2.9'
89
+ - !ruby/object:Gem::Dependency
90
+ name: webmock
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '1.21'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '1.21'
103
+ - !ruby/object:Gem::Dependency
104
+ name: simplecov
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '0.10'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '0.10'
117
+ - !ruby/object:Gem::Dependency
118
+ name: coveralls
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '0.8'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '0.8'
131
+ - !ruby/object:Gem::Dependency
132
+ name: yard
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '0.8'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
73
143
  - !ruby/object:Gem::Version
74
- version: '0'
144
+ version: '0.8'
75
145
  description: Connector for SharedCount API service
76
146
  email:
77
147
  - andrea.mostosi@zenkay.net