diff --git a/Github User Search/Github Search/index.html b/Github User Search/Github Search/index.html new file mode 100644 index 0000000..9964ed0 --- /dev/null +++ b/Github User Search/Github Search/index.html @@ -0,0 +1,27 @@ + + + + + + Bootstrap demo + + + +
+
+

Github User Search

+
+
+
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/Github User Search/Github Search/index.js b/Github User Search/Github Search/index.js new file mode 100644 index 0000000..ca5ae91 --- /dev/null +++ b/Github User Search/Github Search/index.js @@ -0,0 +1,21 @@ +var form = document.getElementById("myform") + + + + +form.addEventListener("submit",function(e){ + e.preventDefault() + var search = document.getElementById("search").value + var original = search.split(' ').join('') + fetch("https://api.github.com/users/"+original) + .then((result) => result.json()) + .then((data) => { + console.log(data) + + document.getElementById("result").innerHTML = ` +
+

Created at: ${data.created_at}

+

User's url: https://github.com/${original}

+ ` + }) +}) \ No newline at end of file diff --git a/Github User Search/index.html b/Github User Search/index.html new file mode 100644 index 0000000..9964ed0 --- /dev/null +++ b/Github User Search/index.html @@ -0,0 +1,27 @@ + + + + + + Bootstrap demo + + + +
+
+

Github User Search

+
+
+
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/Github User Search/index.js b/Github User Search/index.js new file mode 100644 index 0000000..ca5ae91 --- /dev/null +++ b/Github User Search/index.js @@ -0,0 +1,21 @@ +var form = document.getElementById("myform") + + + + +form.addEventListener("submit",function(e){ + e.preventDefault() + var search = document.getElementById("search").value + var original = search.split(' ').join('') + fetch("https://api.github.com/users/"+original) + .then((result) => result.json()) + .then((data) => { + console.log(data) + + document.getElementById("result").innerHTML = ` +
+

Created at: ${data.created_at}

+

User's url: https://github.com/${original}

+ ` + }) +}) \ No newline at end of file