ish_manager 0.1.8.487 → 0.1.8.488
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5d6230cc24c1746299a40db13ee998b8ad59fb10cf90c5d4b6efd060f7b43a71
|
|
4
|
+
data.tar.gz: b9708207b607a11368db470bcfc76d2e84fb549c9ddef553e062fe4cfc5470a2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3c9b239cfd2593b44bcbe50bfdcb92ea7fb3479d01a5e496b37afd78e8e010048c73d2b10469a0fa30d647ee2098d22a64e170b4318190f3fb80cdd5d11f44c6
|
|
7
|
+
data.tar.gz: 6a82bf2054f9efaa665365d1bf2cba8e8384ed55ae431cfe84fe5780e6dc2d3d987a590fa62811842e45cf36686e67094edc451714e25e56fc02c3cd4de057a0
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
class IshManager::AnalyticsController < IshManager::ApplicationController
|
|
3
|
+
|
|
4
|
+
def test
|
|
5
|
+
authorize! :analytics, IshManager::Ability
|
|
6
|
+
|
|
7
|
+
base_url = "https://analytics.wasya.co/index.php?force_api_session=1&module=API&format=JSON&"
|
|
8
|
+
opts = {
|
|
9
|
+
"method" => "Actions.getPageUrls",
|
|
10
|
+
"token_auth" => ANALYTICS_TOKEN,
|
|
11
|
+
"idDimension" => 1,
|
|
12
|
+
"idSite" => 2,
|
|
13
|
+
"period" => "day",
|
|
14
|
+
"date" => "#{(Time.now - 3.months ).to_date.to_s},#{Time.now.to_date.to_s}",
|
|
15
|
+
}
|
|
16
|
+
api_url = "&idDimension=1&idSite=2&period=day&date=2023-07-01,2023-09-01"
|
|
17
|
+
cids = []
|
|
18
|
+
reports = {}
|
|
19
|
+
|
|
20
|
+
inns = HTTParty.get( "#{base_url}#{opts.to_query}" )
|
|
21
|
+
inns = JSON.parse( inns.body )
|
|
22
|
+
|
|
23
|
+
inns.each do |date, items|
|
|
24
|
+
items.each do |item|
|
|
25
|
+
|
|
26
|
+
path = item['label']
|
|
27
|
+
if path[0] != '/'
|
|
28
|
+
path = "/#{path}"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
cid = path[/.*cid=([\d]*)/,1]&.to_i
|
|
32
|
+
if cid
|
|
33
|
+
cids.push cid
|
|
34
|
+
reports[cid] ||= []
|
|
35
|
+
reports[cid].push "#{date} :: #{path}"
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
cids = cids.uniq.compact
|
|
41
|
+
leads_h = Lead.find_to_h cids
|
|
42
|
+
@reports = {}
|
|
43
|
+
|
|
44
|
+
reports.each do |k, v|
|
|
45
|
+
email = leads_h[k].email
|
|
46
|
+
@reports[email] = v
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
end
|
data/config/routes.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ish_manager
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.8.
|
|
4
|
+
version: 0.1.8.488
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- piousbox
|
|
@@ -481,6 +481,7 @@ files:
|
|
|
481
481
|
- app/assets/stylesheets/ish_manager/vendor/jquery-ui.css
|
|
482
482
|
- app/assets/stylesheets/ish_manager/vendor/summernote-bs4.min.css
|
|
483
483
|
- app/assets/stylesheets/ish_manager/videos.scss
|
|
484
|
+
- app/controllers/ish_manager/analytics_controller.rb
|
|
484
485
|
- app/controllers/ish_manager/appliance_tmpls_controller.rb
|
|
485
486
|
- app/controllers/ish_manager/appliances_controller.rb
|
|
486
487
|
- app/controllers/ish_manager/application_controller.rb
|
|
@@ -567,6 +568,7 @@ files:
|
|
|
567
568
|
- app/views/202212 Mailchimp Templates/202212 theme subtle.html
|
|
568
569
|
- app/views/202212 Mailchimp Templates/202212 theme ticket.html
|
|
569
570
|
- app/views/202212 Mailchimp Templates/202212 theme whale.html
|
|
571
|
+
- app/views/ish_manager/analytics/test.haml
|
|
570
572
|
- app/views/ish_manager/appliance_tmpls/_form.haml
|
|
571
573
|
- app/views/ish_manager/appliance_tmpls/index.haml
|
|
572
574
|
- app/views/ish_manager/appliances/_form.haml
|