aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/_stats-script.js9
-rw-r--r--scripts/generate.sh13
-rw-r--r--scripts/local.sh2
-rw-r--r--scripts/website-check.rb20
4 files changed, 44 insertions, 0 deletions
diff --git a/scripts/_stats-script.js b/scripts/_stats-script.js
new file mode 100644
index 0000000..43b795e
--- /dev/null
+++ b/scripts/_stats-script.js
@@ -0,0 +1,9 @@
+updateSubTotal(); // Initial call
+
+function updateSubTotal() {
+ var table = document.getElementById("myTable");
+ let subTotal = Array.from(table.rows).slice(1).reduce((total, row) => {
+ return total + parseFloat(row.cells[1].innerHTML);
+ }, 0);
+ document.getElementById("val").innerHTML = "SubTotal =" + (subTotal.toFixed(2) / 742);
+}
diff --git a/scripts/generate.sh b/scripts/generate.sh
new file mode 100644
index 0000000..a421a38
--- /dev/null
+++ b/scripts/generate.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#define parameters which are passed in.
+SIZE=$1
+URL=$2
+
+#define the template.
+cat << EOF
+---
+pageurl: $URL
+size: $SIZE
+---
+EOF
diff --git a/scripts/local.sh b/scripts/local.sh
new file mode 100644
index 0000000..bed6aaf
--- /dev/null
+++ b/scripts/local.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+sudo docker run -p 4000:4000 -v $(pwd):/site bretfisher/jekyll-serve
diff --git a/scripts/website-check.rb b/scripts/website-check.rb
new file mode 100644
index 0000000..48adab5
--- /dev/null
+++ b/scripts/website-check.rb
@@ -0,0 +1,20 @@
+require 'httparty'
+require 'nokogiri'
+
+HTTParty::Basement.default_options.update(verify: false)
+
+response = HTTParty.get('https://1mb.club')
+
+document = Nokogiri::HTML(response.body)
+website_urls = document.css("#container tr")
+
+puts "Scanning website members URLs..."
+website_urls.each do |single_site|
+ begin
+ url = single_site.css("a.site").first.attribute("href").value
+ response = HTTParty.get(url, timeout: 4)
+ puts "Checking: " + url
+ rescue Exception
+ puts "<!-------- ERROR: " + url
+ end
+end