organize data into year/month directories

This commit is contained in:
jake committed 2021-09-10 09:06:08 -04:00
1 parent debc6ac58f
commit 0bc216eb4a
70 files changed
+68 -54

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
versioning-strategy: increase
+1 -1
View File
@@ -14,4 +14,4 @@ jobs:
with:
node-version: 16
- run: yarn install
- run: yarn run daily
- run: yarn run snapshot
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,147 +1,147 @@
[
{
"slug": "notes/how-to-pull-request-fork-github",
"hits": 90376,
"hits": 90442,
"title": "How To: Fork a GitHub Repository & Submit a Pull Request",
"url": "https://jarv.is/notes/how-to-pull-request-fork-github/",
"date": "2019-04-09T06:17:03.000Z"
},
{
"slug": "notes/how-to-backup-linux-server",
"hits": 57088,
"hits": 57095,
"title": "How To: Automatically Backup a Linux VPS to a Separate Cloud Storage Service",
"url": "https://jarv.is/notes/how-to-backup-linux-server/",
"date": "2019-06-09T23:03:10.000Z"
},
{
"slug": "notes/shodan-search-queries",
"hits": 30999,
"hits": 31029,
"title": "Fascinating & Frightening Shodan Search Queries (AKA: The Internet of Sh*t)",
"url": "https://jarv.is/notes/shodan-search-queries/",
"date": "2019-09-19T13:56:10.000Z"
},
{
"slug": "notes/github-rename-master",
"hits": 16643,
"hits": 16674,
"title": "How To: Safely Rename master Branch on GitHub ✊🏾",
"url": "https://jarv.is/notes/github-rename-master/",
"date": "2020-06-28T13:28:52.000Z"
},
{
"slug": "notes/coronavirus-open-source",
"hits": 11033,
"hits": 11034,
"title": "COVID-19 vs. the Open Source Community ⚔️",
"url": "https://jarv.is/notes/coronavirus-open-source/",
"date": "2020-03-23T19:17:09.000Z"
},
{
"slug": "notes/cloudflare-dns-archive-is-blocked",
"hits": 9923,
"hits": 9937,
"title": "Does Cloudflare's 1.1.1.1 DNS Block Archive.is?",
"url": "https://jarv.is/notes/cloudflare-dns-archive-is-blocked/",
"date": "2019-05-04T13:35:12.000Z"
},
{
"slug": "notes/how-to-shrink-linux-virtual-disk-vmware",
"hits": 6686,
"hits": 6701,
"title": "How To: Shrink a Linux Virtual Machine Disk with VMware",
"url": "https://jarv.is/notes/how-to-shrink-linux-virtual-disk-vmware/",
"date": "2018-12-04T23:10:04.000Z"
},
{
"slug": "notes/finding-candidates-subdomain-takeovers",
"hits": 6477,
"hits": 6480,
"title": "Finding Candidates for Subdomain Takeovers",
"url": "https://jarv.is/notes/finding-candidates-subdomain-takeovers/",
"date": "2019-03-10T15:19:48.000Z"
},
{
"slug": "notes/css-waving-hand-emoji",
"hits": 4876,
"hits": 4896,
"title": "Animated Waving Hand Emoji 👋 Using CSS",
"url": "https://jarv.is/notes/css-waving-hand-emoji/",
"date": "2019-04-17T18:20:10.000Z"
},
{
"slug": "notes/dark-mode",
"hits": 3691,
"hits": 3692,
"title": "How To: Add Dark Mode to a Website 🌓",
"url": "https://jarv.is/notes/dark-mode/",
"date": "2020-04-29T16:14:09.000Z"
},
{
"slug": "notes/netlify-analytics-review",
"hits": 1690,
"hits": 1691,
"title": "Netlify Analytics Review",
"url": "https://jarv.is/notes/netlify-analytics-review/",
"date": "2019-11-13T13:21:22.000Z"
},
{
"slug": "notes/y2k-sandbox",
"hits": 1447,
"hits": 1451,
"title": "I Made A Thing, Powered by Windows Me™",
"url": "https://jarv.is/notes/y2k-sandbox/",
"date": "2020-06-06T14:05:23.000Z"
},
{
"slug": "notes/dropping-dropbox",
"hits": 1413,
"hits": 1418,
"title": "Why I'm Dropping Dropbox",
"url": "https://jarv.is/notes/dropping-dropbox/",
"date": "2019-11-20T21:22:43.000Z"
},
{
"slug": "notes/github-actions",
"hits": 1126,
"hits": 1134,
"title": "I ❤️ GitHub Actions",
"url": "https://jarv.is/notes/github-actions/",
"date": "2019-10-25T17:58:39.000Z"
},
{
"slug": "notes/presidential-candidates-404-pages",
"hits": 1021,
"hits": 1022,
"title": "Ranking 2020 Presidential Candidates's 404 Pages",
"url": "https://jarv.is/notes/presidential-candidates-404-pages/",
"date": "2019-10-30T17:58:39.000Z"
},
{
"slug": "notes/security-headers-cloudflare-workers",
"hits": 977,
"hits": 980,
"title": "Adding Security Headers Using Cloudflare Workers",
"url": "https://jarv.is/notes/security-headers-cloudflare-workers/",
"date": "2019-02-28T07:18:10.000Z"
},
{
"slug": "notes/bernie-sanders-bern-app-data",
"hits": 800,
"hits": 801,
"title": "Bernie Sanders' Creepy \"BERN\" App Wants Your Data...From Your Best Friends",
"url": "https://jarv.is/notes/bernie-sanders-bern-app-data/",
"date": "2019-05-08T14:31:02.000Z"
},
{
"slug": "notes/cool-bash-tricks-for-your-terminal-dotfiles",
"hits": 367,
"hits": 368,
"title": "Cool Bash Tricks for Your Terminal's \"Dotfiles\"",
"url": "https://jarv.is/notes/cool-bash-tricks-for-your-terminal-dotfiles/",
"date": "2018-12-11T00:01:50.000Z"
},
{
"slug": "notes/my-first-code",
"hits": 359,
"hits": 360,
"title": "My First Code: Jake's Bulletin Board",
"url": "https://jarv.is/notes/my-first-code/",
"date": "2019-10-01T12:34:25.000Z"
},
{
"slug": "notes/millenial-with-hillary-clinton",
"hits": 314,
"hits": 315,
"title": "Why This Millennial Is With Hillary Clinton Now — and Why We All Need To Be In November",
"url": "https://jarv.is/notes/millenial-with-hillary-clinton/",
"date": "2016-02-29T04:10:26.000Z"
},
{
"slug": "notes/no-homo-still-raps-motto",
"hits": 163,
"hits": 164,
"title": "\"No Homo!\" — Still Rap's Motto in 2012?",
"url": "https://jarv.is/notes/no-homo-still-raps-motto/",
"date": "2013-11-22T15:58:20.000Z"
File renamed without changes.
File renamed without changes.
+3 -3
View File
@@ -5,14 +5,14 @@
"author": "Jake Jarvis <jake@jarv.is>",
"private": true,
"scripts": {
"daily": "node scripts/daily.js"
"snapshot": "node scripts/snapshot.js"
},
"dependencies": {
"fs-extra": "^10.0.0",
"got": "^11.8.2",
"luxon": "^1.27.0",
"luxon": "^2.0.2",
"pkg-dir": "^5.0.0",
"prettier": "^2.3.2",
"simple-git": "^2.40.0"
"simple-git": "^2.45.1"
}
}
+12 -6
View File
@@ -12,17 +12,23 @@ const API_ENDPOINT = "https://jarv.is/api/hits/";
(async () => {
// find our bearings
const rootDir = await pkgDir(__dirname);
const today = DateTime.now().toISODate();
const jsonFile = path.join(rootDir, "data", `${today}.json`);
const fullDate = DateTime.now().toISODate();
const jsonPath = path.join(
rootDir,
"data",
DateTime.now().toFormat('yyyy'), // year
DateTime.now().toFormat('LL'), // month
`${fullDate}.json` // year-month-day.json
);
// pull the latest stats from API
console.info("📡 Fetching latest data from API...");
const { body } = await got(API_ENDPOINT, { responseType: "json" });
// write pretty JSON to timestamped file
console.info(`✏️ Writing data to ${jsonFile} ...`);
console.info(`✏️ Writing data to ${jsonPath} ...`);
await fs.outputFile(
jsonFile,
jsonPath,
prettier.format(JSON.stringify(body.pages), { parser: "json" })
);
@@ -39,8 +45,8 @@ const API_ENDPOINT = "https://jarv.is/api/hits/";
git.addConfig("user.email", "41898282+github-actions[bot]@users.noreply.github.com");
// do the normal git stuff
await git.add([ jsonFile ]);
await git.commit(`📈 Add new snapshot for ${today}`);
await git.add([ jsonPath ]);
await git.commit(`📈 Add new snapshot for ${fullDate}`);
await git.push("origin", "main");
} else {
console.info("🤖 Didn't detect CI: skipping Git steps...");
+23 -23
View File
@@ -20,9 +20,9 @@
integrity sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g==
"@szmarczak/http-timer@^4.0.5":
version "4.0.5"
resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.5.tgz#bfbd50211e9dfa51ba07da58a14cdfd333205152"
integrity sha512-PyRA9sm1Yayuj5OIoJ1hGt2YISX45w9WcFbh6ddT0Z/0yaFxOtGLInr4jUfU1EAFVs0Yfyfev4RNwBlUaHdlDQ==
version "4.0.6"
resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807"
integrity sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==
dependencies:
defer-to-connect "^2.0.0"
@@ -42,16 +42,16 @@
integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==
"@types/keyv@*":
version "3.1.2"
resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.2.tgz#5d97bb65526c20b6e0845f6b0d2ade4f28604ee5"
integrity sha512-/FvAK2p4jQOaJ6CGDHJTqZcUtbZe820qIeTg7o0Shg7drB4JHeL+V/dhSaly7NXx6u8eSee+r7coT+yuJEvDLg==
version "3.1.3"
resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.3.tgz#1c9aae32872ec1f20dcdaee89a9f3ba88f465e41"
integrity sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg==
dependencies:
"@types/node" "*"
"@types/node@*":
version "16.3.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.3.0.tgz#1836664e4fad13b51b07eb6e882a53925e6543c4"
integrity sha512-OydMCocGMGqw/1BnWbhtK+AtwyWTOigtrQlRe57OQmTNcI3HKlVI5FGlh+c4mSqInMPLynFrTlYjfajPu9O/eQ==
version "16.7.13"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.7.13.tgz#86fae356b03b5a12f2506c6cf6cd9287b205973f"
integrity sha512-pLUPDn+YG3FYEt/pHI74HmnJOWzeR+tOIQzUx93pi9M7D8OE7PSLr97HboXwk5F+JS+TLtWuzCOW97AHjmOXXA==
"@types/responselike@*", "@types/responselike@^1.0.0":
version "1.0.0"
@@ -153,9 +153,9 @@ got@^11.8.2:
responselike "^2.0.0"
graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.6"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee"
integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==
version "4.2.8"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a"
integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==
http-cache-semantics@^4.0.0:
version "4.1.0"
@@ -203,10 +203,10 @@ lowercase-keys@^2.0.0:
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479"
integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==
luxon@^1.27.0:
version "1.27.0"
resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.27.0.tgz#ae10c69113d85dab8f15f5e8390d0cbeddf4f00f"
integrity sha512-VKsFsPggTA0DvnxtJdiExAucKdAnwbCCNlMM5ENvHlxubqWd0xhZcdb4XgZ7QFNhaRhilXCFxHuoObP5BNA4PA==
luxon@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/luxon/-/luxon-2.0.2.tgz#11f2cd4a11655fdf92e076b5782d7ede5bcdd133"
integrity sha512-ZRioYLCgRHrtTORaZX1mx+jtxKtKuI5ZDvHNAmqpUzGqSrR+tL4FVLn/CUGMA3h0+AKD1MAxGI5GnCqR5txNqg==
mimic-response@^1.0.0:
version "1.0.1"
@@ -285,9 +285,9 @@ quick-lru@^5.1.1:
integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==
resolve-alpn@^1.0.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.1.2.tgz#30b60cfbb0c0b8dc897940fe13fe255afcdd4d28"
integrity sha512-8OyfzhAtA32LVUsJSke3auIyINcwdh5l3cvYKdKO0nvsYSKuiLfTM5i78PJswFPT8y6cPW+L1v6/hE95chcpDA==
version "1.2.1"
resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9"
integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==
responselike@^2.0.0:
version "2.0.0"
@@ -296,10 +296,10 @@ responselike@^2.0.0:
dependencies:
lowercase-keys "^2.0.0"
simple-git@^2.40.0:
version "2.40.0"
resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-2.40.0.tgz#1f9da964caa032290ec25cb06ccacc2c17d99d75"
integrity sha512-7IO/eQwrN5kvS38TTu9ljhG9tx2nn0BTqZOmqpPpp51TvE44YIvLA6fETqEVA8w/SeEfPaVv6mk7Tsk9Jns+ag==
simple-git@^2.45.1:
version "2.45.1"
resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-2.45.1.tgz#27d26ae59f734ffd7e1dea16a1ee3b309d68f5ef"
integrity sha512-NmEoThiLTJxl26WNtZxtJTue18ReTcSrf3so5vJG/O8KY9uMxH+yAhXV/DElBJyOYZrrBbVsH8JOFxgENdc9Xg==
dependencies:
"@kwsites/file-exists" "^1.1.1"
"@kwsites/promise-deferred" "^1.1.1"