metrika 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -3
- data/VERSION +1 -1
- data/lib/metrika/api/methods.rb +37 -6
- data/metrika.gemspec +70 -0
- metadata +3 -2
data/README.md
CHANGED
@@ -3,11 +3,11 @@ Metrika
|
|
3
3
|
|
4
4
|
Wrapper for Yandex.Metrika API
|
5
5
|
|
6
|
-
|
6
|
+
# Info
|
7
7
|
|
8
8
|
**Under heavy development!**
|
9
9
|
|
10
|
-
|
10
|
+
# JSON API
|
11
11
|
|
12
12
|
c = Metrika::Client.new('your_app_id', 'your_app_password')
|
13
13
|
|
@@ -24,4 +24,8 @@ Wrapper for Yandex.Metrika API
|
|
24
24
|
c.get_counter(id)
|
25
25
|
c.update_counter(id, params)
|
26
26
|
c.delete_counter(id)
|
27
|
-
c.check_counter(id)
|
27
|
+
c.check_counter(id)
|
28
|
+
|
29
|
+
# Object API
|
30
|
+
|
31
|
+
Later…
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/lib/metrika/api/methods.rb
CHANGED
@@ -1,21 +1,23 @@
|
|
1
1
|
module Metrika
|
2
2
|
module Api
|
3
3
|
module Methods
|
4
|
+
|
5
|
+
# Counters
|
4
6
|
def get_counters
|
5
|
-
self.get(self.counters_path)['counters']
|
7
|
+
self.get(self.counters_path)['counters']
|
6
8
|
end
|
7
9
|
|
10
|
+
def create_counter(params)
|
11
|
+
self.post(self.counters_path, params)['counter']
|
12
|
+
end
|
13
|
+
|
8
14
|
def counters_path
|
9
15
|
"/counters"
|
10
16
|
end
|
11
17
|
|
12
18
|
def get_counter(id)
|
13
19
|
self.get(self.counter_path(id))['counter']
|
14
|
-
end
|
15
|
-
|
16
|
-
def create_counter(params)
|
17
|
-
self.post(self.counters_path, params)['counter']
|
18
|
-
end
|
20
|
+
end
|
19
21
|
|
20
22
|
def update_counter(id, params)
|
21
23
|
self.put(self.counter_path(id), params)['counter']
|
@@ -35,7 +37,36 @@ module Metrika
|
|
35
37
|
|
36
38
|
def counter_check_path(id)
|
37
39
|
"/counter/#{id}/check"
|
40
|
+
end
|
41
|
+
|
42
|
+
# Counter goals
|
43
|
+
def get_counter_goals(counter_id)
|
44
|
+
self.get(self.counter_goals_path(counter_id))['goals']
|
45
|
+
end
|
46
|
+
|
47
|
+
def create_counter_goal(counter_id, params)
|
48
|
+
self.post(self.counter_goals_path(counter_id), params)['goals']
|
49
|
+
end
|
50
|
+
|
51
|
+
def counter_goals_path(counter_id)
|
52
|
+
"/counter/#{counter_id}/goals"
|
53
|
+
end
|
54
|
+
|
55
|
+
def get_counter_goal(counter_id, id)
|
56
|
+
self.get(self.counter_goal_path(counter_id, id))['goal']
|
38
57
|
end
|
58
|
+
|
59
|
+
def update_counter_goal(counter_id, id, params)
|
60
|
+
self.put(self.counter_goal_path(counter_id, id), params)['goal']
|
61
|
+
end
|
62
|
+
|
63
|
+
def delete_counter_goal(counter_id, id)
|
64
|
+
self.delete(self.counter_goal_path(counter_id, id))['goal']
|
65
|
+
end
|
66
|
+
|
67
|
+
def counter_goal_path(counter_id, id)
|
68
|
+
"/counter/#{counter_id}/goal/#{id}"
|
69
|
+
end
|
39
70
|
end
|
40
71
|
end
|
41
72
|
end
|
data/metrika.gemspec
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "metrika"
|
8
|
+
s.version = "0.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Igor Alexandrov"]
|
12
|
+
s.date = "2012-09-25"
|
13
|
+
s.email = "igor.alexandrov@gmail.com"
|
14
|
+
s.extra_rdoc_files = [
|
15
|
+
"LICENSE.txt",
|
16
|
+
"README.md"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
".document",
|
20
|
+
"Gemfile",
|
21
|
+
"Gemfile.lock",
|
22
|
+
"LICENSE.txt",
|
23
|
+
"README.md",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"lib/metrika.rb",
|
27
|
+
"lib/metrika/api/methods.rb",
|
28
|
+
"lib/metrika/client.rb",
|
29
|
+
"lib/metrika/errors.rb",
|
30
|
+
"lib/metrika/helpers/authorization.rb",
|
31
|
+
"lib/metrika/helpers/parser.rb",
|
32
|
+
"lib/metrika/helpers/request.rb",
|
33
|
+
"metrika.gemspec",
|
34
|
+
"test/helper.rb",
|
35
|
+
"test/test_metrika.rb"
|
36
|
+
]
|
37
|
+
s.homepage = "http://github.com/igor-alexandrov/metrika"
|
38
|
+
s.licenses = ["MIT"]
|
39
|
+
s.require_paths = ["lib"]
|
40
|
+
s.rubygems_version = "1.8.24"
|
41
|
+
s.summary = "Wrapper for Yandex.Metrika API"
|
42
|
+
|
43
|
+
if s.respond_to? :specification_version then
|
44
|
+
s.specification_version = 3
|
45
|
+
|
46
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
+
s.add_runtime_dependency(%q<oauth2>, [">= 0"])
|
48
|
+
s.add_runtime_dependency(%q<yajl-ruby>, [">= 0"])
|
49
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
50
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
51
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.1.5"])
|
52
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
|
53
|
+
else
|
54
|
+
s.add_dependency(%q<oauth2>, [">= 0"])
|
55
|
+
s.add_dependency(%q<yajl-ruby>, [">= 0"])
|
56
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
57
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
58
|
+
s.add_dependency(%q<bundler>, ["~> 1.1.5"])
|
59
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
60
|
+
end
|
61
|
+
else
|
62
|
+
s.add_dependency(%q<oauth2>, [">= 0"])
|
63
|
+
s.add_dependency(%q<yajl-ruby>, [">= 0"])
|
64
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
65
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
66
|
+
s.add_dependency(%q<bundler>, ["~> 1.1.5"])
|
67
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metrika
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- lib/metrika/helpers/authorization.rb
|
130
130
|
- lib/metrika/helpers/parser.rb
|
131
131
|
- lib/metrika/helpers/request.rb
|
132
|
+
- metrika.gemspec
|
132
133
|
- test/helper.rb
|
133
134
|
- test/test_metrika.rb
|
134
135
|
homepage: http://github.com/igor-alexandrov/metrika
|
@@ -146,7 +147,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
147
|
version: '0'
|
147
148
|
segments:
|
148
149
|
- 0
|
149
|
-
hash: -
|
150
|
+
hash: -1085198774262121811
|
150
151
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
152
|
none: false
|
152
153
|
requirements:
|