forked from acceptbitcoincash/acceptbitcoincash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stats.json
85 lines (85 loc) · 2.95 KB
/
stats.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
layout: 'json'
show_generated_date: false
---
{%- assign page_count = 0 -%}
{%- assign section_count = 0 -%}
{%- assign total = 0 -%}
{%- assign bch = 0 -%}
{%- assign only_bch = 0 -%}
{%- assign btc = 0 -%}
{%- assign cobra = 0 -%}
{%- assign other_crypto = 0 -%}
{%- assign any_crypto = 0 -%}
{%- assign pages = site.data.sections | group_by:"page" | sort:"name" -%}
{%- assign sortedPages = pages | reverse -%}
{%- assign page_count = sortedPages | size -%}
{% for tracked_page in sortedPages %}
"{{ tracked_page.name | capitalize }}": {
{%- assign count_total = 0 -%}
{%- assign count_bch = 0 -%}
{%- assign count_only_bch = 0 -%}
{%- assign count_btc = 0 -%}
{%- assign count_cobra = 0 -%}
{%- assign count_other_crypto = 0 -%}
{%- assign count_sections = tracked_page.items | size -%}
{%- assign count_any_crypto = 0 -%}
{%- for section in tracked_page.items -%}
{%- assign section_file = site.data[section.id] -%}
{%- assign section_listings = section_file.websites | size -%}
{%- assign count_total = count_total | plus: section_listings -%}
{%- for website in section_file.websites -%}
{%- if website.bch or website.btc or website.othercrypto or website.bsv -%}
{%- assign count_any_crypto = count_any_crypto | plus: '1' -%}
{%- if website.bch -%}
{%- assign count_bch = count_bch | plus: '1' -%}
{%- unless website.btc or website.othercrypto or website.bsv -%}
{%- assign count_only_bch = count_only_bch | plus: '1' -%}
{% endunless %}
{%- endif -%}
{%- if website.btc -%}
{%- assign count_btc = count_btc | plus: '1' -%}
{%- if website.bch -%}
{%- assign count_cobra = count_cobra | plus: '1' -%}
{%- endif -%}
{%- endif -%}
{%- if website.othercrypto or website.bsv -%}
{%- assign count_other_crypto = count_other_crypto | plus: '1' -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{% endfor %}
"accepts": {
"BCH": {{ count_bch }},
"BCH_only": {{ count_only_bch }},
"BTC": {{ count_btc }},
"BTC_BCH": {{ count_cobra }},
"Altcoins": {{ count_other_crypto }},
"Crypto": {{ count_any_crypto }}
},
"sites_tracked": {{ count_total }},
"sections": {{ count_sections }}
},
{%- assign bch = bch | plus: count_bch -%}
{%- assign only_bch = only_bch | plus: count_only_bch -%}
{%- assign btc = btc | plus: count_btc -%}
{%- assign cobra = cobra | plus: count_cobra -%}
{%- assign other_crypto = other_crypto | plus: count_other_crypto -%}
{%- assign total = total | plus: count_total -%}
{%- assign any_crypto = any_crypto | plus: count_any_crypto -%}
{%- assign section_count = section_count | plus: count_sections -%}
{% endfor %}
"Site": {
"accepts": {
"BCH": {{ bch }},
"BCH_only": {{ only_bch }},
"BTC": {{ btc }},
"BTC_BCH": {{ cobra }},
"Altcoins": {{ other_crypto }},
"Crypto": {{ any_crypto }}
},
"sites_tracked": {{ total }},
"sections": {{ section_count }},
"pages_of_listings": {{ page_count }},
"generated": "{{ site.time }}"
}