├── images └── logo.png ├── README.md ├── LICENSE └── library └── userscript └── sociallike.user.js /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darkwood-com/wysiwyl/main/images/logo.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | Flow 4 | 5 |

6 | 7 | # wysiwyl 8 | 9 | What you see is what you like 10 | 11 | ## Introduction 12 | 13 | Inspirated from [WYSIWYG : What you see is what you get](https://fr.wikipedia.org/wiki/What_you_see_is_what_you_get). 14 | This project is a simple web application to like your favorite links, means, you should have read the content of the link before liking it. 15 | 16 | ## Installation 17 | 18 | According to this thread : [https://superuser.com/questions/252046/how-do-i-install-a-userscript](https://superuser.com/questions/252046/how-do-i-install-a-userscript) 19 | You can install `sociallike.user.js` script with [Tampermonkey](https://www.tampermonkey.net/) or [Greasemonkey](https://addons.mozilla.org/fr/firefox/addon/greasemonkey/) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Mathieu Ledru 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /library/userscript/sociallike.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Social Like 3 | // @namespace https://darkwood.fr 4 | // @version v0.0.2 5 | // @description What you see is what you like 6 | // @author matyo91 7 | // @match https://twitter.com/* 8 | // @match https://odysee.com/* 9 | // @match https://www.youtube.com/* 10 | // @match https://github.com/* 11 | // @match https://www.esa.int/* 12 | // @match https://www.linkedin.com/* 13 | // @license MIT 14 | // ==/UserScript== 15 | 16 | "use strict"; 17 | 18 | // autolike what you read 19 | 20 | ((readStrategy, timeout = 1000) => { 21 | var readStrategies = { 22 | 'greedy': (readSelector) => { 23 | return readSelector 24 | }, 25 | 'random': (readSelector) => { 26 | return Math.random() >= 0.5 ? readSelector : null 27 | } 28 | } 29 | 30 | var functions = { 31 | likeClick(likeSelector) { 32 | likeSelector.forEach((e) => {e.click()}) 33 | }, 34 | likeSelector(readSelector) { 35 | return [...readSelector].map(element => element.querySelectorAll([ 36 | '[role="button"][data-testid="like"]', // twitter 37 | '.file-page__video .media__actions button.button-like:not(.button--fire)', // odysee 38 | '#above-the-fold .ytLikeButtonViewModelHost button[aria-pressed="false"]', // youtube videos 39 | '#comments ytd-toggle-button-renderer#like-button button[aria-pressed="false"]', // youtube comments 40 | 'ytd-reel-video-renderer[is-active] ytd-toggle-button-renderer#like-button yt-button-shape button.yt-spec-button-shape-next[aria-pressed="false"]', // youtube shorts 41 | '.js-social-container:not(.on) .unstarred .js-social-form .btn.btn-sm:not(.btn-primary)', // github 42 | '.share button:not(.active)', // esa 43 | '.feed-shared-social-actions button[aria-pressed="false"]', // linkedin 44 | ].join(', '))).flat().reduce((acc, nodeList) => acc.concat([...nodeList]), []) 45 | }, 46 | readSelector() { 47 | return document.querySelectorAll([ 48 | 'article', // twitter 49 | '.file-page__video', // odysee 50 | '#primary-inner', // youtube 51 | '#shorts-container', // youtube shorts 52 | '.js-repo-pjax-container', // github 53 | '.article', // esa 54 | '.feed-shared-update-v2__description-wrapper', // linkedin 55 | ].join(', ')) 56 | }, 57 | like() { 58 | let readSelector = functions.readSelector(); 59 | readSelector = readStrategies[readStrategy](readSelector); 60 | if(readSelector) { 61 | functions.likeClick(functions.likeSelector(readSelector)); 62 | } 63 | 64 | setTimeout(() => { 65 | functions.like() 66 | }, timeout) 67 | }, 68 | } 69 | 70 | functions.like() 71 | })('greedy'); 72 | --------------------------------------------------------------------------------