{"id":1186,"date":"2023-02-16T09:49:15","date_gmt":"2023-02-16T09:49:15","guid":{"rendered":"https:\/\/www.tools.keywordfinder.us\/?page_id=1186"},"modified":"2023-02-16T09:49:15","modified_gmt":"2023-02-16T09:49:15","slug":"hyper-link-generator","status":"publish","type":"page","link":"https:\/\/tools.billionsideas.com\/fr\/hyper-link-generator\/","title":{"rendered":"URL To Hyper Link Generator"},"content":{"rendered":"<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column has-base-3-background-color has-background is-layout-flow wp-block-column-is-layout-flow\">\n<section><h1>URL to Hyperlink Generator<\/h1>\n    <link rel=\"stylesheet\" type=\"text\/css\" href=\"style.css\">\n  \n    <form action=\"\">\n      <label>Paste simple url links here:<\/label>\n      <br>\n      <textarea id=\"textInput\"><\/textarea>\n      <br><br>\n      <button type=\"button\" onclick=\"processText()\">Process Text<\/button>\n      <br><br>\n      <label>Or upload a file:<\/label>\n      <input type=\"file\" id=\"fileInput\" accept=\".txt,.csv,.doc,.docx,.xls,.xlsx,.json,.html\"><br><br>\n      <button type=\"button\" onclick=\"processFile()\">Process File<\/button>\n    <input type=\"hidden\" name=\"trp-form-language\" value=\"fr\"\/><\/form>\n    <br><br><br>\n    <div id=\"output\"><\/div><br><br><br>\n    <button onclick=\"copyLinks()\">Copy All Links<\/button>\n    <button onclick=\"downloadLinks()\">Download All Links<\/button><br><br>\n    <script src=\"script.js\"><\/script>\n<\/section>\n<script>\n\/\/ Function to generate a single hyperlink from a URL\nfunction generateLink(url) {\n  return \"<a href='\" + url + \"'>\" + url + \"<\/a> <br>\";\n}\n\n\/\/ Function to process text and extract URLs\nfunction processText() {\n  var text = document.getElementById(\"textInput\").value;\n  var urls = text.match(\/(https?:\\\/\\\/[^\\s]+)\/g);\n  var links = \"\";\n  for (var i = 0; i < urls.length; i++) {\n    links += generateLink(urls[i]);\n  }\n  document.getElementById(\"output\").innerHTML = links;\n}\n\n\/\/ Function to process a file and extract URLs\nfunction processFile() {\n  var file = document.getElementById(\"fileInput\").files[0];\n  var fileReader = new FileReader();\n  fileReader.onload = function() {\n    var urls = this.result.match(\/(https?:\\\/\\\/[^\\s]+)\/g);\n    var links = \"\";\n    for (var i = 0; i < urls.length; i++) {\n      links += generateLink(urls[i]);\n    }\n    document.getElementById(\"output\").innerHTML = links;\n  }\n  fileReader.readAsText(file);\n}\n\n\/\/ Function to copy all links to the clipboard\nfunction copyLinks() {\n  var links = document.getElementById(\"output\").innerHTML;\n  navigator.clipboard.writeText(links).then(function() {\n    alert(\"Links copied to clipboard!\");\n  });\n}\n\n\/\/ Function to download all links in a Word or Excel file\nfunction downloadLinks() {\n    var links = document.getElementById(\"output\").innerHTML;\n    var fileExtension = prompt(\"Enter file extension (doc, docx, xls, xlsx)\").toLowerCase();\n    var blob = new Blob([links], { type: \"application\/msword\" });\n    if(fileExtension === \"xls\" || fileExtension === \"xlsx\")\n        blob = new Blob([links], { type: \"application\/vnd.ms-excel\" });\n    var link = document.createElement(\"a\");\n    link.href = URL.createObjectURL(blob);\n    link.download = \"hyperlinks.\" + fileExtension;\n    link.click();\n}\n\n<\/script>\n\n<hr>\n\n<style>\n      section{\n         margin-top:60px;\n        width: 100%;\n        max-width: 970px;\n        background-color: #fff;\n        border: 1px solid #ddd;\n        padding: 25px;\n      }\ninput [type=\"text\"]{width:100%;}\n#output{height:200px;background:#f2f2f2;}\n<\/style>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>URL to Hyperlink Generator Paste simple url links here: Process Text Or upload a file: Process File Copy All Links Download All Links<\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","footnotes":""},"class_list":["post-1186","page","type-page","status-publish"],"taxonomy_info":[],"featured_image_src_large":false,"author_info":{"display_name":"Billions Ideas","author_link":"https:\/\/tools.billionsideas.com\/fr\/author\/loginbillionsideas-com\/"},"comment_info":0,"jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tools.billionsideas.com\/fr\/wp-json\/wp\/v2\/pages\/1186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tools.billionsideas.com\/fr\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/tools.billionsideas.com\/fr\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/tools.billionsideas.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tools.billionsideas.com\/fr\/wp-json\/wp\/v2\/comments?post=1186"}],"version-history":[{"count":0,"href":"https:\/\/tools.billionsideas.com\/fr\/wp-json\/wp\/v2\/pages\/1186\/revisions"}],"wp:attachment":[{"href":"https:\/\/tools.billionsideas.com\/fr\/wp-json\/wp\/v2\/media?parent=1186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}