diff options
author | Bradley Taunt <bt@btxx.org> | 2024-01-22 13:06:19 -0500 |
---|---|---|
committer | Bradley Taunt <bt@btxx.org> | 2024-01-22 13:06:19 -0500 |
commit | d2e4da10c806d815eded44ade076babb78802c16 (patch) | |
tree | 7494261e22f3255926204164449c7345f5b500e5 /scripts |
Initial commit to new cgit platform
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/_stats-script.js | 9 | ||||
-rw-r--r-- | scripts/generate.sh | 13 | ||||
-rw-r--r-- | scripts/local.sh | 2 | ||||
-rw-r--r-- | scripts/website-check.rb | 20 |
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 |