Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ http://localhost:9000

## Requirements

- [Node 17](https://nodejs.org/en/blog/release/v17.0.0/)
- [Node 24](https://nodejs.org/en/blog/release/v24.0.0/)
- [Yarn](https://yarnpkg.com/cli/install)

## Contributions
Expand All @@ -65,4 +65,4 @@ If you find bugs, have feature requests or questions, please

Microformats Parser Website Node is dedicated to the public domain using Creative Commons -- CC0 1.0 Universal.

http://creativecommons.org/publicdomain/zero/1.0
http://creativecommons.org/publicdomain/zero/1.0
6 changes: 2 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const express = require("express");
const { mf2 } = require("microformats-parser");
const undici = require("undici");
const pkg = require("./package.json");
const app = express();
const port = process.env.PORT || 9000;
Expand Down Expand Up @@ -28,14 +27,13 @@ app.use(express.static("public"));
app.get("/", async (req, res) => {
if (req.query.url) {
const url = req.query.url;
const { body } = await undici.request(url, {
maxRedirections: 2,
const response = await fetch(url, {
headers: {
accept: "text/html, text/mf2+html",
},
method: "GET",
});
const text = await body.text();
const text = await response.text();
htmlToMf2(url, text, res);
} else {
res.render("index.html.ejs", {
Expand Down
Loading