Skip to content

Commit

Permalink
Merge pull request #25 from sebiboga/UI-changes
Browse files Browse the repository at this point in the history
Update index.html
  • Loading branch information
sebiboga committed Oct 21, 2023
2 parents 005bb29 + 6fe29c5 commit 20e1134
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
const response = await fetch(apiUrl);

if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
return false;
}

const data = await response.json(); // Assuming the response is in JSON format
return data["humans.txt"] ? "true" : "false";
const data = await response.text(); // Assuming the response is in JSON format
return data;
} catch (error) {
console.error("Fetch error:", error);
}
Expand All @@ -37,8 +37,8 @@
const humansTxt = await fetchData(domain);
// Pass the domain to the engine or display it
domainElement.textContent = "Extracted Domain: " + domain;
humansElement.textContent = `humans.txt: ${humansTxt}`;
humansElement.style.color = humansTxt === "true" ? "green" : "red";
humansElement.textContent = humansTxt ? humansTxt : `humans.txt: false`;
humansElement.style.color = humansTxt ? "black" : "red";
// You can also redirect to the engine URL with the extracted domain
// window.location.href = "https://your-engine-url/?domain=" + domain;
} else {
Expand All @@ -60,4 +60,4 @@ <h1>Domain Name Extractor</h1>
<p id="domain"></p>
<p id="humans"></p>
</body>
</html>
</html>

0 comments on commit 20e1134

Please sign in to comment.