]> git.mxchange.org Git - fba.git/commitdiff
changed url to domain
authorEnju Aihara <5-EnjuAihara@users.noreply.gitlab.varis.social>
Fri, 4 Mar 2022 21:01:44 +0000 (22:01 +0100)
committerEnju Aihara <5-EnjuAihara@users.noreply.gitlab.varis.social>
Fri, 4 Mar 2022 21:01:44 +0000 (22:01 +0100)
mastodon_api/index.js

index cba25e9baec2fe89da41dae8c33c5296ef4cc67a..aca15fafa468ff8454453465e5c0000b40a8eda1 100644 (file)
@@ -2,12 +2,12 @@ const puppeteer = require("puppeteer");
 const app = require("express")();
 const PORT = 8069;
 
-async function main(url, _callback) {
+async function main(domain, _callback) {
     const browser = await puppeteer.launch();
     const page = await browser.newPage();
     let data;
     try {
-        await page.goto("https://"+url+"/about/more", {waitUntil: "networkidle2"});
+        await page.goto("https://"+domain+"/about/more", {waitUntil: "networkidle2"});
         data = await page.evaluate(() => {
             let reject = []; // Suspended servers
             let media_removal = []; // Filtered media
@@ -57,9 +57,9 @@ app.listen(PORT, "127.0.0.1", () => console.log("API started on http://127.0.0.1
 app.get("/", (req, res) => {
     res.status(400).send({"message":"insert a domain"});
 });
-app.get("/:url", (req, res) => {
-    const {url} = req.params;
-    main(url, data => res.status(200).send({
+app.get("/:domain", (req, res) => {
+    const {domain} = req.params;
+    main(domain, data => res.status(200).send({
         "reject": data.reject,
         "media_removal": data.media_removal,
         "federated_timeline_removal": data.federated_timeline_removal,