From c6d407cbc2a35fe1051397118cee7a91a3c23f1c Mon Sep 17 00:00:00 2001 From: MaKe_UnIV3rS Date: Thu, 2 Jan 2020 20:42:42 +0100 Subject: [PATCH] first working version --- getimg.js | 20 ++++++++++++++++++++ index.html | 25 +++++++++++++++++++++++++ styles.css | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 getimg.js create mode 100644 index.html create mode 100644 styles.css diff --git a/getimg.js b/getimg.js new file mode 100644 index 0000000..47dc602 --- /dev/null +++ b/getimg.js @@ -0,0 +1,20 @@ +function getImage(a) { + var regex = new RegExp(/^(?!.*\.\.)(?!.*\.$)[^\W][\w.]{0,29}$/); + var validation = regex.test(a); + + if(validation) { + $.get("https://www.instagram.com/"+a+"/?__a=1") + .done(function(data) { + + var imageURL = data["graphql"]["user"]["profile_pic_url_hd"]; + + $("#imageReturn").attr("src",imageURL) + + }) + .fail(function() { + alert('Nutzername wurde nicht gefunden!') + }) + } else { + alert('Der Nutzername ist ungültig!') + } +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..c7088b1 --- /dev/null +++ b/index.html @@ -0,0 +1,25 @@ + + + + + + + + + + + + +
+ + +
+ +
+ +
+ +
+ + + \ No newline at end of file diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..df605a9 --- /dev/null +++ b/styles.css @@ -0,0 +1,34 @@ +#container1 { + left: 50%; + position: absolute; + transform: translate3d(-50%, 0, 0); +} + +#container2 { + position: absolute; + left: 50%; + top: 200px; + transform: translate3d(-50%, 0, 0); +} + +#nameInput { + width: 600px; + padding: 14px 6px; + margin: 8px 0; + box-sizing: border-box; + border: 3px solid #ccc; + -webkit-transition: 0.5s; + transition: 0.5s; + outline: none; + border-radius: 8px; +} + +#goButton { + width: 100px; + padding: 14px; + margin: 8px 0; + box-sizing: border-box; + border: 3px solid #ccc; + outline: none; + border-radius: 8px; +} \ No newline at end of file