From d87528f43161b184754a812cb8603b81bfec8867 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Sat, 31 Jul 2021 13:02:30 +0200 Subject: fixes --- phttps __www.accuweather.com_ .json | 1 - phttps __www.rgs.org_about_our-collections_online-exhibitions_ .json | 1 - phttps___odysee.com.json | 2 +- phttps___www.accuweather.com__.json | 1 + phttps___www.rgs.org_about_our-collections_online-exhibitions__.json | 1 + 5 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 phttps __www.accuweather.com_ .json delete mode 100644 phttps __www.rgs.org_about_our-collections_online-exhibitions_ .json create mode 100644 phttps___www.accuweather.com__.json create mode 100644 phttps___www.rgs.org_about_our-collections_online-exhibitions__.json diff --git a/phttps __www.accuweather.com_ .json b/phttps __www.accuweather.com_ .json deleted file mode 100644 index bd40f49..0000000 --- a/phttps __www.accuweather.com_ .json +++ /dev/null @@ -1 +0,0 @@ -[{"sAccuWeather":{"url":"","hash":"","text":"/*\n\tCopyright © 2021 jahoti (jahoti@tilde.team)\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\nfor (var nonAd of document.querySelectorAll('.ads-not-loaded .non-ad')) nonAd.style.visibility = 'visible';"}},{"phttps://www.accuweather.com/***":{"components":["s","AccuWeather"],"allow":false}}] \ No newline at end of file diff --git a/phttps __www.rgs.org_about_our-collections_online-exhibitions_ .json b/phttps __www.rgs.org_about_our-collections_online-exhibitions_ .json deleted file mode 100644 index 06e75a6..0000000 --- a/phttps __www.rgs.org_about_our-collections_online-exhibitions_ .json +++ /dev/null @@ -1 +0,0 @@ -[{"sRoyal Geographical Society":{"url":"","hash":"","text":"/*\n\tCopyright © 2021 jahoti (jahoti@tilde.team)\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\ndocument.documentElement.style.visibility = 'visible';\ndocument.documentElement.style.opacity = '100';"}},{"phttps://www.rgs.org/about/our-collections/online-exhibitions/***":{"components":["s","Royal Geographical Society"],"allow":false}}] \ No newline at end of file diff --git a/phttps___odysee.com.json b/phttps___odysee.com.json index e6a66e5..0f4c1ed 100644 --- a/phttps___odysee.com.json +++ b/phttps___odysee.com.json @@ -1 +1 @@ -[{"sodysee":{"url":"","hash":"","text":"/**\n * Copyright 2021 Wojtek Kosior\n *\n * This program is free software; you can redistribute it\n * and/or modify it under the terms of either:\n * - the GNU General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at\n * your option) any later version, or\n * - the \"A\" license: ; explained\n * at: \n *\n * As additional permission under GNU GPL version 3 section 7, you\n * may distribute forms of that code without the copy of the GNU\n * GPL normally required by section 4, provided you include this\n * license notice and, in case of non-source distribution, a URL\n * through which recipients can access the Corresponding Source.\n * If you modify file(s) with this exception, you may extend this\n * exception to your version of the file(s), but you are not\n * obligated to do so. If you do not wish to do so, delete this\n * exception statement from your version. If you delete this\n * exception statement from all source files in the program, then\n * also delete it here.\n *\n * As a special exception to the GPL, any HTML file which merely\n * makes function calls to this code, and for that purpose\n * includes it by reference shall be deemed a separate work for\n * copyright law purposes. If you modify this code, you may extend\n * this exception to your version of the code, but you are not\n * obligated to do so. If you do not wish to do so, delete this\n * exception statement from your version.\n */\n\n/* use with https://odysee.com/*** */\n\n/* If we're on a video page, show the video. */\n\nlet data = null;\n\nfunction process_json_script(json_script)\n{\n try {\n\tdata = JSON.parse(json_script.textContent);\n } catch (e) {\n\tconsole.log(\"Error parsing content data\", e);\n }\n}\n\nfor (const json_script of document.querySelectorAll(\"head script\")) {\n if (json_script.getAttribute(\"blocked-type\") === \"application/ld+json\")\n\tprocess_json_script(json_script);\n}\n\nconst body = document.createElement(\"body\");\n\nif (data) {\n if (data[\"@type\"] === \"VideoObject\" && data.contentUrl) {\n\tconst video = document.createElement(\"video\");\n\tconst source = document.createElement(\"source\");\n\n\tsource.src = data.contentUrl;\n\n\tvideo.setAttribute(\"width\", \"100%\");\n\tvideo.setAttribute(\"height\", \"auto\");\n\tvideo.setAttribute(\"controls\", \"\");\n\n\tvideo.appendChild(source);\n\n\tbody.appendChild(video);\n }\n\n if (data.name) {\n\tconst h1 = document.createElement(\"h1\");\n\n\th1.textContent = data.name;\n\th1.setAttribute(\"style\", \"color: #555;\");\n\n\tbody.appendChild(h1);\n }\n\n if (data.uploadDate) {\n\ttry {\n\t const date = new Date(data.uploadDate).toString();\n\t const date_div = document.createElement(\"div\");\n\n\t date_div.textContent = `Uploaded: ${date}`;\n\t date_div.setAttribute(\"style\", \"font-size: 8; font-weight: bold;\");\n\n\t body.appendChild(date_div);\n\t} catch(e) {\n\t console.log(\"Error parsing content upload date\", e);\n\t}\n }\n\n if (data.description) {\n\tconst description_div = document.createElement(\"div\");\n\n\tdescription_div.textContent = data.description;\n\n\tbody.appendChild(description_div);\n }\n}\n\n/* Show search. */\n\nconst search_input = document.createElement(\"input\");\nconst search_submit = document.createElement(\"button\");\nconst search_form = document.createElement(\"form\");\nconst error_div = document.createElement(\"div\");\n\nsearch_submit.textContent = \"Search Odysee\";\n\nsearch_form.setAttribute(\"style\", \"margin: 15px 0 0 0;\");\n\nsearch_form.appendChild(search_input);\nsearch_form.appendChild(search_submit);\n\nerror_div.textContent = \"Failed to perform search :c\";\nerror_div.setAttribute(\"style\", \"display: none;\");\n\nbody.appendChild(search_form);\nbody.appendChild(error_div);\n\n/* Replace the UI. */\n\ndocument.documentElement.replaceChild(body, document.body);\n\n/* Add the logic of performing search and showing results. */\n\nlet results_div = null;\n\nfunction ajax_callback(xhttp, cb)\n{\n if (xhttp.readyState === 4)\n\tcb(xhttp.response);\n}\n\nfunction show_search_entries(new_results_div, response)\n{\n try {\n\tvar response_data = JSON.parse(response);\n } catch (e) {\n\terror_div.setAttribute(\"style\", \"color: #b44;\");\n\tconsole.log(\"Failed to parse search response :c\", e);\n\treturn;\n }\n\n if (results_div)\n\tresults_div.remove();\n\n error_div.setAttribute(\"style\", \"display: none;\");\n\n results_div = new_results_div;\n new_results_div.textContent = response;\n\n body.appendChild(results_div);\n}\n\nfunction get_search_entries(new_results_div, query)\n{\n const callback = r => show_search_entries(new_results_div, r);\n const url = `https://lighthouse.odysee.com/search?s=${encodeURIComponent(query)}&size=20&from=0&claimType=file,channel&nsfw=false&free_only=true`;\n\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = () => ajax_callback(xhttp, callback);\n xhttp.open(\"GET\", url, true);\n try {\n\txhttp.send();\n } catch(e) {\n\tconsole.log(\"Failed to query search server :c\", e);\n\terror_div.setAttribute(\"style\", \"color: #b44;\");\n }\n}\n\nfunction search(event)\n{\n if (event)\n\tevent.preventDefault();\n console.log(\"search\", search_input.value);\n if (!/[^\\s]/.test(search_input.value))\n\treturn;\n\n const new_results_div = document.createElement(\"div\");\n\n get_search_entries(new_results_div, search_input.value);\n}\n\nsearch_form.addEventListener(\"submit\", search);\n\n\nconst match = /^[^?]*search\\?q=([^&]+)/.exec(document.URL)\nif (match) {\n search_input.value = decodeURIComponent(match[1]);\n search();\n}\n"}},{"phttps://odysee.com":{"components":["s","odysee"],"allow":false}},{"phttps://odysee.com/***":{"components":["s","odysee"],"allow":false}}] +[{"sodysee":{"url":"","hash":"","text":"/**\n * Copyright 2021 Wojtek Kosior\n *\n * This program is free software; you can redistribute it\n * and/or modify it under the terms of either:\n * - the GNU General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at\n * your option) any later version, or\n * - the \"A\" license: ; explained\n * at: \n *\n * As additional permission under GNU GPL version 3 section 7, you\n * may distribute forms of that code without the copy of the GNU\n * GPL normally required by section 4, provided you include this\n * license notice and, in case of non-source distribution, a URL\n * through which recipients can access the Corresponding Source.\n * If you modify file(s) with this exception, you may extend this\n * exception to your version of the file(s), but you are not\n * obligated to do so. If you do not wish to do so, delete this\n * exception statement from your version. If you delete this\n * exception statement from all source files in the program, then\n * also delete it here.\n *\n * As a special exception to the GPL, any HTML file which merely\n * makes function calls to this code, and for that purpose\n * includes it by reference shall be deemed a separate work for\n * copyright law purposes. If you modify this code, you may extend\n * this exception to your version of the code, but you are not\n * obligated to do so. If you do not wish to do so, delete this\n * exception statement from your version.\n */\n\n/* use with https://odysee.com/*** */\n\n/* If we're on a video page, show the video. */\n\nlet data = null;\n\nfunction process_json_script(json_script)\n{\n try {\n\tdata = JSON.parse(json_script.textContent);\n } catch (e) {\n\tconsole.log(\"Error parsing content data\", e);\n }\n}\n\nfor (const json_script of document.querySelectorAll(\"head script\")) {\n if ([\"blocked-type\", \"type\"].map(a => json_script.getAttribute(a))\n\t.includes(\"application/ld+json\"))\n\tprocess_json_script(json_script);\n}\n\nconst body = document.createElement(\"body\");\n\nif (data) {\n if (data[\"@type\"] === \"VideoObject\" && data.contentUrl) {\n\tconst video = document.createElement(\"video\");\n\tconst source = document.createElement(\"source\");\n\n\tsource.src = data.contentUrl;\n\n\tvideo.setAttribute(\"width\", \"100%\");\n\tvideo.setAttribute(\"height\", \"auto\");\n\tvideo.setAttribute(\"controls\", \"\");\n\n\tvideo.appendChild(source);\n\n\tbody.appendChild(video);\n }\n\n if (data.name) {\n\tconst h1 = document.createElement(\"h1\");\n\n\th1.textContent = data.name;\n\th1.setAttribute(\"style\", \"color: #555;\");\n\n\tbody.appendChild(h1);\n }\n\n if (data.uploadDate) {\n\ttry {\n\t const date = new Date(data.uploadDate).toString();\n\t const date_div = document.createElement(\"div\");\n\n\t date_div.textContent = `Uploaded: ${date}`;\n\t date_div.setAttribute(\"style\", \"font-size: 8; font-weight: bold;\");\n\n\t body.appendChild(date_div);\n\t} catch(e) {\n\t console.log(\"Error parsing content upload date\", e);\n\t}\n }\n\n if (data.description) {\n\tconst description_div = document.createElement(\"div\");\n\n\tdescription_div.textContent = data.description;\n\n\tbody.appendChild(description_div);\n }\n}\n\n/* Show search. */\n\nconst search_input = document.createElement(\"input\");\nconst search_submit = document.createElement(\"button\");\nconst search_form = document.createElement(\"form\");\nconst error_div = document.createElement(\"div\");\n\nsearch_submit.textContent = \"Search Odysee\";\n\nsearch_form.setAttribute(\"style\", \"margin: 15px 0 0 0;\");\n\nsearch_form.appendChild(search_input);\nsearch_form.appendChild(search_submit);\n\nerror_div.textContent = \"Failed to perform search :c\";\nerror_div.setAttribute(\"style\", \"display: none;\");\n\nbody.appendChild(search_form);\nbody.appendChild(error_div);\n\n/* Replace the UI. */\n\ndocument.documentElement.replaceChild(body, document.body);\n\n/* Add the logic of performing search and showing results. */\n\nlet results_div = null;\n\nfunction ajax_callback(xhttp, cb)\n{\n if (xhttp.readyState === 4)\n\tcb(xhttp.response);\n}\n\nfunction show_search_entries(new_results_div, response)\n{\n try {\n\tvar response_data = JSON.parse(response);\n } catch (e) {\n\terror_div.setAttribute(\"style\", \"color: #b44;\");\n\tconsole.log(\"Failed to parse search response :c\", e);\n\treturn;\n }\n\n if (results_div)\n\tresults_div.remove();\n\n error_div.setAttribute(\"style\", \"display: none;\");\n\n results_div = new_results_div;\n new_results_div.textContent = response;\n\n body.appendChild(results_div);\n}\n\nfunction get_search_entries(new_results_div, query)\n{\n const callback = r => show_search_entries(new_results_div, r);\n const url = `https://lighthouse.odysee.com/search?s=${encodeURIComponent(query)}&size=20&from=0&claimType=file,channel&nsfw=false&free_only=true`;\n\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = () => ajax_callback(xhttp, callback);\n xhttp.open(\"GET\", url, true);\n try {\n\txhttp.send();\n } catch(e) {\n\tconsole.log(\"Failed to query search server :c\", e);\n\terror_div.setAttribute(\"style\", \"color: #b44;\");\n }\n}\n\nfunction search(event)\n{\n if (event)\n\tevent.preventDefault();\n console.log(\"search\", search_input.value);\n if (!/[^\\s]/.test(search_input.value))\n\treturn;\n\n const new_results_div = document.createElement(\"div\");\n\n get_search_entries(new_results_div, search_input.value);\n}\n\nsearch_form.addEventListener(\"submit\", search);\n\n\nconst match = /^[^?]*search\\?q=([^&]+)/.exec(document.URL)\nif (match) {\n search_input.value = decodeURIComponent(match[1]);\n search();\n}\n"}},{"phttps://odysee.com":{"components":["s","odysee"],"allow":false}},{"phttps://odysee.com/***":{"components":["s","odysee"],"allow":false}}] diff --git a/phttps___www.accuweather.com__.json b/phttps___www.accuweather.com__.json new file mode 100644 index 0000000..bd40f49 --- /dev/null +++ b/phttps___www.accuweather.com__.json @@ -0,0 +1 @@ +[{"sAccuWeather":{"url":"","hash":"","text":"/*\n\tCopyright © 2021 jahoti (jahoti@tilde.team)\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\nfor (var nonAd of document.querySelectorAll('.ads-not-loaded .non-ad')) nonAd.style.visibility = 'visible';"}},{"phttps://www.accuweather.com/***":{"components":["s","AccuWeather"],"allow":false}}] \ No newline at end of file diff --git a/phttps___www.rgs.org_about_our-collections_online-exhibitions__.json b/phttps___www.rgs.org_about_our-collections_online-exhibitions__.json new file mode 100644 index 0000000..06e75a6 --- /dev/null +++ b/phttps___www.rgs.org_about_our-collections_online-exhibitions__.json @@ -0,0 +1 @@ +[{"sRoyal Geographical Society":{"url":"","hash":"","text":"/*\n\tCopyright © 2021 jahoti (jahoti@tilde.team)\n\t\n\tLicensed under the Apache License, Version 2.0 (the \"License\");\n\tyou may not use this file except in compliance with the License.\n\tYou may obtain a copy of the License at\n\t\n\t http://www.apache.org/licenses/LICENSE-2.0\n\t\n\tUnless required by applicable law or agreed to in writing, software\n\tdistributed under the License is distributed on an \"AS IS\" BASIS,\n\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\tSee the License for the specific language governing permissions and\n\tlimitations under the License.\n*/\n\ndocument.documentElement.style.visibility = 'visible';\ndocument.documentElement.style.opacity = '100';"}},{"phttps://www.rgs.org/about/our-collections/online-exhibitions/***":{"components":["s","Royal Geographical Society"],"allow":false}}] \ No newline at end of file -- cgit v1.2.3