Fetch Webmentions
This commit is contained in:
parent
f46436578a
commit
30350030aa
4 changed files with 56 additions and 11 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -3,3 +3,4 @@ dist
|
|||
|
||||
# Local Netlify folder
|
||||
.netlify
|
||||
.cache
|
||||
|
|
|
|||
52
package-lock.json
generated
52
package-lock.json
generated
|
|
@ -111,12 +111,12 @@
|
|||
}
|
||||
},
|
||||
"@11ty/eleventy-fetch": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@11ty/eleventy-fetch/-/eleventy-fetch-3.0.0.tgz",
|
||||
"integrity": "sha512-qJvfb331rYQAmlCS71Ygg0/XHUdB4/qXBOLsG0DJ1m61WL5JNha52OtKVeQq34u2J2Nfzim+X4TIL/+QyesB7Q==",
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@11ty/eleventy-fetch/-/eleventy-fetch-4.0.1.tgz",
|
||||
"integrity": "sha512-yIiLM5ziBmg86i4TlXpBdcIygJHvh/GgPJyAiFOckO9H4y9cQDM8eIcJCUQ4Mum0NEVui/OjhEut2R08xw0vlQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "^4.3.3",
|
||||
"debug": "^4.3.4",
|
||||
"flat-cache": "^3.0.4",
|
||||
"node-fetch": "^2.6.7",
|
||||
"p-queue": "^6.6.2"
|
||||
|
|
@ -133,6 +133,20 @@
|
|||
"image-size": "^1.0.1",
|
||||
"p-queue": "^6.6.2",
|
||||
"sharp": "^0.30.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@11ty/eleventy-fetch": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@11ty/eleventy-fetch/-/eleventy-fetch-3.0.0.tgz",
|
||||
"integrity": "sha512-qJvfb331rYQAmlCS71Ygg0/XHUdB4/qXBOLsG0DJ1m61WL5JNha52OtKVeQq34u2J2Nfzim+X4TIL/+QyesB7Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "^4.3.3",
|
||||
"flat-cache": "^3.0.4",
|
||||
"node-fetch": "^2.6.7",
|
||||
"p-queue": "^6.6.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@11ty/eleventy-plugin-rss": {
|
||||
|
|
@ -1274,12 +1288,13 @@
|
|||
}
|
||||
},
|
||||
"flat-cache": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
|
||||
"integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
|
||||
"integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"flatted": "^3.1.0",
|
||||
"flatted": "^3.2.9",
|
||||
"keyv": "^4.5.3",
|
||||
"rimraf": "^3.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
@ -1295,9 +1310,9 @@
|
|||
}
|
||||
},
|
||||
"flatted": {
|
||||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz",
|
||||
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==",
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz",
|
||||
"integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
|
||||
"dev": true
|
||||
},
|
||||
"follow-redirects": {
|
||||
|
|
@ -1662,6 +1677,12 @@
|
|||
"esprima": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"json-buffer": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
|
||||
"integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
|
||||
"dev": true
|
||||
},
|
||||
"jstransformer": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jstransformer/-/jstransformer-1.0.0.tgz",
|
||||
|
|
@ -1678,6 +1699,15 @@
|
|||
"integrity": "sha512-3KF80UaaSSxo8jVnRYtMKNGFOoVPBdkkVPsw+Ad0y4oxKXPduS6G6iHkrf69yJVff/VAaYXkV42rtZ7daJxU3w==",
|
||||
"dev": true
|
||||
},
|
||||
"keyv": {
|
||||
"version": "4.5.4",
|
||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
|
||||
"integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"json-buffer": "3.0.1"
|
||||
}
|
||||
},
|
||||
"kind-of": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@11ty/eleventy": "^2.0.1",
|
||||
"@11ty/eleventy-fetch": "^4.0.1",
|
||||
"@11ty/eleventy-plugin-rss": "^1.2.0",
|
||||
"@remy/webmention": "^1.5.0",
|
||||
"@sindresorhus/slugify": "^1.1.0",
|
||||
|
|
|
|||
13
src/_data/webmentions.js
Normal file
13
src/_data/webmentions.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
const EleventyFetch = require("@11ty/eleventy-fetch");
|
||||
|
||||
module.exports = async function fetchMentions() {
|
||||
const url = `https://webmention.io/api/mentions.jf2?domain=devon.lol&token=${process.env.WEBMENTIONSIO_TOKEN}`;
|
||||
|
||||
const mentions = await EleventyFetch(url, {
|
||||
duration: "1s",
|
||||
type: "json",
|
||||
});
|
||||
console.log('mentions:', mentions);
|
||||
console.log('mentions.children:', mentions.children);
|
||||
return mentions.children;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue