{"id":20880,"date":"2021-07-18T11:59:10","date_gmt":"2021-07-18T06:29:10","guid":{"rendered":"https:\/\/learnsteer.sasnaka.org\/science\/?p=20880"},"modified":"2021-07-18T11:59:14","modified_gmt":"2021-07-18T06:29:14","slug":"google-drive-link","status":"publish","type":"post","link":"https:\/\/learnsteer.sasnaka.org\/science\/advanced-level-science\/google-drive-link\/","title":{"rendered":"Google drive link"},"content":{"rendered":"\n<p>&nbsp;<\/p>\n\n\n\n<html>\n<div class=\"link-generate\">\n    <link href=\"https:\/\/fonts.googleapis.com\/css2?family=Roboto+Condensed&amp;display=swap\" rel=\"stylesheet\">\n    <script language=\"javascript\">\n        window.onload = setup;\n\n        function setup(){\n            document.getElementById(\"button\").addEventListener(\"click\", go);\n            document.getElementById(\"button1\").addEventListener(\"click\", clearsh);\n            document.getElementById(\"output\").addEventListener(\"click\", copy);\n        }\n        \n        function setStatus(status, error = false) {\n            var helpText = document.getElementById(\"help-text\");\n            \n            helpText.innerText = status;\n            \n            if (error) {\n                helpText.style.color = \"darkred\";\n            } else {\n                helpText.style.color = \"#227300\";\n            }\n        }\n          \n        function go(){\n            var linkId = document.getElementById(\"input\").value;\n            var idExtractor = \/\\\/d\\\/(.+?)(?:\\\/|#|\\?|$)\/;\n            var result = idExtractor.exec(linkId);\n            \n            var outputBox = document.getElementById(\"output\");\n            \n            \n            if (!result) {\n                outputBox.value = \"\";\n                setStatus(\"Error: Invalid URL\", true);\n                outputBox.disabled = true;\n                return;\n            }\n            \n            var finalLink = \"https:\/\/drive.google.com\/uc?export=download&id=\" + result[1];\n            outputBox.disabled = false;\n            outputBox.value = finalLink;\n            setStatus(\"Success! Click the output link to copy it to your clipboard\");\n        }\n        \n        function copy() {\n            if (this.disabled) {\n                return;\n            }\n            \n            this.select();\n            var copied = document.execCommand(\"copy\");\n            \n            if (copied) {\n                setStatus(\"Link copied to clipboard!\");\n            } else {\n                setStatus(\"Couldn't copy link to clipboard. Please copy it manually.\", true);\n            }\n        }\nfunction clearsh()\n{\ndocument.getElementById(\"output\").value = \" \";\ndocument.getElementById(\"input\").value = \" \";\nsetStatus(\"Please Copy new link to Sharing URL\");\n}\n    <\/script>\n    <style>\n        .link-generate {\n            font-family: 'Roboto Condensed', sans-serif;\n        }\n    \n        .title {\n            font-size: 1.6em;\n            margin: 15px 0 10px;\n        }\n        \n        .sub {\n            font-size: 0.5em;\n            color: #444;\n            vertical-align: middle;\n        }\n        \n        #button {\n            display: block;\n            font-family: 'Roboto Condensed', sans-serif;\n            font-size: 1.2em;\n            padding: 10px 18px;\n            margin: 15px auto;\n            border: none;\n            border-radius: 3px;\n            background: #ffd54f;\n            color: #111;\n            cursor: pointer;\n            box-shadow: 0 2px 3px 0px #b5b5b5;\n            transition: background 200ms;\n        }\n        \n        #button:hover {\n            background: #ffe48e;\n        }\n        \n        #button:active {\n            background: #ffd54f;\n            box-shadow: 0 2px 3px -1px #b5b5b5;\n        }\n        #button1 {\n            display: block;\n            font-family: 'Roboto Condensed', sans-serif;\n            font-size: 1.2em;\n            padding: 10px 18px;\n            margin: 15px auto;\n            border: none;\n            border-radius: 3px;\n            background: #ffd54f;\n            color: #111;\n            cursor: pointer;\n            box-shadow: 0 2px 3px 0px #b5b5b5;\n            transition: background 200ms;\n        }\n        \n        #button1:hover {\n            background: #ffe48e;\n        }\n        \n        #button1:active {\n            background: #ffd54f;\n            box-shadow: 0 2px 3px -1px #b5b5b5;\n        }\n        \n        #input, #output {\n            font-size: 1.1em;\n            display:block;\n            width:100%;\n            padding: 10px;\n            border: 1px solid #b5b5b5;\n            border-radius: 3px;\n        }\n        \n        #help-text {\n            font-weight: 600;\n            margin: 10px;\n        }\n    <\/style>\n    <div class=\"title\">Enter your sharing URL:&nbsp;<span class=\"sub\"><\/span><\/div>\n    <input id=\"input\" type=\"text\">\n    <button id=\"button\">Create Direct Link<\/button>\n    <div class=\"title\">Output link:<\/div>\n    <input id=\"output\" type=\"text\" readonly=\"\" disabled=\"\">\n\n    <div id=\"help-text\"><\/div>\n     <button id=\"button1\">New Link<\/button>\n<\/div>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Enter your sharing URL:&nbsp; Create Direct Link Output link: New Link<\/p>\n","protected":false},"author":70,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"tdm_status":"","tdm_grid_status":"","footnotes":""},"categories":[42],"tags":[],"class_list":{"0":"post-20880","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-advanced-level-science"},"_links":{"self":[{"href":"https:\/\/learnsteer.sasnaka.org\/science\/wp-json\/wp\/v2\/posts\/20880"}],"collection":[{"href":"https:\/\/learnsteer.sasnaka.org\/science\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learnsteer.sasnaka.org\/science\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learnsteer.sasnaka.org\/science\/wp-json\/wp\/v2\/users\/70"}],"replies":[{"embeddable":true,"href":"https:\/\/learnsteer.sasnaka.org\/science\/wp-json\/wp\/v2\/comments?post=20880"}],"version-history":[{"count":3,"href":"https:\/\/learnsteer.sasnaka.org\/science\/wp-json\/wp\/v2\/posts\/20880\/revisions"}],"predecessor-version":[{"id":21105,"href":"https:\/\/learnsteer.sasnaka.org\/science\/wp-json\/wp\/v2\/posts\/20880\/revisions\/21105"}],"wp:attachment":[{"href":"https:\/\/learnsteer.sasnaka.org\/science\/wp-json\/wp\/v2\/media?parent=20880"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learnsteer.sasnaka.org\/science\/wp-json\/wp\/v2\/categories?post=20880"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learnsteer.sasnaka.org\/science\/wp-json\/wp\/v2\/tags?post=20880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}