From 4e7bcfc0e877fcecd300f13b6e18741dfb57edb4 Mon Sep 17 00:00:00 2001 From: Muhammad Daffa <36522826+daffainfo@users.noreply.github.com> Date: Sat, 25 Dec 2021 14:24:22 +0700 Subject: [PATCH] First Commit --- data.json | 26 ++++++++++++++++++++++++++ index.html | 33 +++++++++++++++++++++++++++++++++ script.js | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 data.json create mode 100644 index.html create mode 100644 script.js diff --git a/data.json b/data.json new file mode 100644 index 0000000..418b23b --- /dev/null +++ b/data.json @@ -0,0 +1,26 @@ +[ + { + "name": "AdotpAPet API Key", + "url": "https://github.com/daffainfo/all-about-apikey/blob/main/Animals/AdoptAPet.md", + "description": "Resource to help get pets adopted", + "regex": "^([a-z0-9]{33})$" + }, + { + "name": "Petfinder API Key", + "url": "https://github.com/daffainfo/all-about-apikey/blob/main/Animals/Petfinder.md", + "description": "Petfinder is dedicated to helping pets find homes, another resource to get pets adopted", + "regex": "^([a-zA-Z0-9]{50})$" + }, + { + "name": "Clearbit API Key", + "url": "https://github.com/daffainfo/all-about-apikey/blob/main/Business/Clearbit.md", + "description": "Search for company logos and embed them in your projects", + "regex": "^(sk_[a-z0-9]{32})$" + }, + { + "name": "ImprovMX API Key", + "url": "https://github.com/daffainfo/all-about-apikey/blob/main/Business/ImprovMX.md", + "description": "API for free email forwarding service", + "regex": "^(sk_[a-z0-9]{32})$" + } +] \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..da2c206 --- /dev/null +++ b/index.html @@ -0,0 +1,33 @@ + + + + API Guesser + + + + + + + + + + +
+

API Guesser

+
Made by Muhammad Daffa
+ +

+ +
+
+
+ + \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..30a97ce --- /dev/null +++ b/script.js @@ -0,0 +1,35 @@ +$(document).ready(function () { + $.ajaxSetup({ cache: false }); + $("#search").keyup(function () { + if (!$(this).val().length) { + $("#result").html(""); + $("#count").html(""); + } else { + let count = 0; + $("#result").html(""); + $("#state").val(""); + let searchField = $("#search").val(); + $.getJSON("data.json", function (data) { + $.each(data, function (key, value) { + // console.log(array_count.length) + let regex_result = new RegExp(value.regex, "g"); + if (searchField.match(regex_result)) { + count++; + $("#result").append(` +
+
+
+
` + value.name + `
+

` + value.description + `

+ More Information +
+
+
` + ); + } + $("#count").text(count + " results of " + searchField); + }); + }); + } + }); +});