Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Commit

Permalink
add gd stats to prebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAwesome98-Real committed Jan 28, 2024
1 parent a70753b commit 90cd681
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,6 @@ dist
_site/
www/

# thing for buttons
# things for compile time data
src/static/images/88x31/3rdparty
src/_data/gd.json
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
"description": "lily's home page",
"author": "lily <[email protected]>",
"scripts": {
"build": "rm -rf www && node prebuild.js && ELEVENTY_ENV=prod eleventy",
"serve": "rm -rf www && node prebuild.js && ELEVENTY_ENV=dev eleventy --serve",
"update": "git pull && yarn && yarn build"
"build": "rm -rf www && node prebuild.js && ELEVENTY_ENV=prod eleventy",
"serve": "rm -rf www && node prebuild.js && ELEVENTY_ENV=dev eleventy --serve",
"update": "git pull && yarn && yarn build"
},
"license": "BSD-3-Clause",
"private": false,
"dependencies": {
"@11ty/eleventy": "^2.0.1"
"@11ty/eleventy": "^2.0.1",
"gd.js": "^0.2.13"
}
}
16 changes: 16 additions & 0 deletions prebuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,19 @@ for (let set of eightyeightbythirtyones) {
}
}
}

const GD = require("gd.js");
let gd = new GD();
(async () => {
let userinfo = await gd.users.get('tauon07');
userinfo._creator = null;
userinfo.cosmetics._creator = null;
try {
filesystem.unlinkSync("src/_data/gd.json");
} catch (err) {
if (err.code != "ENOENT") {
throw err;
}
}
filesystem.writeFileSync("src/_data/gd.json", JSON.stringify(userinfo));
})();
6 changes: 5 additions & 1 deletion readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ additionally, to run `yarn update` automatically, you can do this:
secret=... ; the secret that was generated before
user=... ; the user that has access to yarn
```
6. done
6. done

finally, you may do dynamic data in the `prebuild.js` file. this currently
refreshes owned 88x31s, and refreshes geometry dash data. it could,
perhaps, get build date and commit hash.
20 changes: 10 additions & 10 deletions src/gd.njk
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ date: git Last Modified
{% endblock %}
{% block page %}
<h1>my gd stats :3</h1>
<small
>these aren't live yet but i'm planning on doing that soon once
i move this site to my server</small
>
<small>
these stats are now semi-live! they update every time i rebuild my site :3
</small>
<h3>details:</h3>
<ul>
<li>username: tauon07</li>
<li>stars: 39</li>
<li>diamonds: 561</li>
<li>coins: 8</li>
<li>creatorpoints: 0</li>
<li>demons: 0</li>
<li>username: {{ gd.username }}</li>
<li>stars: {{ gd.stats.stars }}</li>
<li>diamonds: {{ gd.stats.diamonds }}</li>
<li>coins: {{ gd.stats.coins.normal }}</li>
<li>creatorpoints: {{ gd.stats.cp }}</li>
<li>demons: {{ gd.stats.demons }}</li>
</ul>
<h3>demons:</h3>
<small>these don't update quite yet</small>
<h4>the nightmare:</h4>
<div class="progress_bar">
<div style="width: 65%">65%</div>
Expand Down
5 changes: 4 additions & 1 deletion src/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ document.currentScript.parentElement.innerHTML = `<abbr title="${age} to be exac
they're really cool :3)
</p>
<h2>embed my 88x31 on your page! :3</h2>
<p>please <b>do</b> hotlink the button btw!!</p>
<p>
please <b>do</b> hotlink the button btw!! (that is, unless you have a super
cool system like mine that auto-updates them)
</p>
<center>
<textarea style="width: 300px; height: 145px; resize: none" readonly>
<a href="https://tauon.dev/" target="_blank">
Expand Down
37 changes: 37 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ character-parser@^2.2.0:
dependencies:
is-regex "^1.0.3"

"charenc@>= 0.0.1":
version "0.0.2"
resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667"
integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==

chokidar@^3.5.3:
version "3.5.3"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
Expand Down Expand Up @@ -389,6 +394,11 @@ cross-spawn@^7.0.3:
shebang-command "^2.0.0"
which "^2.0.1"

"crypt@>= 0.0.1":
version "0.0.2"
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==

[email protected]:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
Expand Down Expand Up @@ -457,6 +467,11 @@ domutils@^2.8.0:
domelementtype "^2.2.0"
domhandler "^4.2.0"

duration-converter@^1.3.6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/duration-converter/-/duration-converter-1.3.6.tgz#35ec753df2400a5f90e9103ac9084ac7ac994348"
integrity sha512-D65I2CvcD6dtLwCkN1dBrumJcJrcUi5rpsqxGylD/F5ZQ4TDlJTZsSePSl+LUlWm8wt8PbPuulfhTC+Y+aElIA==

[email protected]:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
Expand Down Expand Up @@ -536,6 +551,11 @@ fastq@^1.6.0:
dependencies:
reusify "^1.0.4"

fflate@^0.7.3:
version "0.7.4"
resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.7.4.tgz#61587e5d958fdabb5a9368a302c25363f4f69f50"
integrity sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw==

filelist@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.4.tgz#f78978a1e944775ff9e62e744424f215e58352b5"
Expand Down Expand Up @@ -578,6 +598,15 @@ function-bind@^1.1.2:
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c"
integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==

gd.js@^0.2.13:
version "0.2.13"
resolved "https://registry.yarnpkg.com/gd.js/-/gd.js-0.2.13.tgz#11fb76379822995159ca2f3b1721add687f93c68"
integrity sha512-CnSYf/B7UMcKldd9B5PsqfS2Zf3mARLCOJb1wIHN7B6k+1ODoWN3xqkut2eScPFfnZsKmyBZoPTvSnj367CWrg==
dependencies:
duration-converter "^1.3.6"
fflate "^0.7.3"
sha1 "^1.1.1"

get-intrinsic@^1.1.3, get-intrinsic@^1.2.1, get-intrinsic@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.2.tgz#281b7622971123e1ef4b3c90fd7539306da93f3b"
Expand Down Expand Up @@ -1319,6 +1348,14 @@ set-function-length@^1.1.1:
gopd "^1.0.1"
has-property-descriptors "^1.0.0"

sha1@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/sha1/-/sha1-1.1.1.tgz#addaa7a93168f393f19eb2b15091618e2700f848"
integrity sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA==
dependencies:
charenc ">= 0.0.1"
crypt ">= 0.0.1"

shebang-command@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
Expand Down

0 comments on commit 90cd681

Please sign in to comment.