Last active
March 31, 2022 15:05
-
-
Save putsan/cb6b9826d5a0052c4ef507e3c63aacb3 to your computer and use it in GitHub Desktop.
Tampermonkey scripts for different sites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Export / Import app data (localStorage) for Johnny-Decimal-generator.netlify.app | |
// v0.0.1 | |
// Run this in console where you need to export, | |
// it copies localstorage content along with code to clipboard and just paste it in the console where you want to import. | |
copy( | |
"let data = " + | |
JSON.stringify(localStorage) + | |
";Object.keys(data).forEach(function (k){localStorage.setItem(k, data[k]);});" | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name To archive mover | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author @putsan | |
// @match https://mate.academy/vacancies | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=mate.academy | |
// @grant none | |
// ==/UserScript== | |
(async function() { | |
// NOT WORKED !!! | |
'use strict'; | |
const cvColumn = document.querySelector('[title="Відправлено CV"]'); | |
let vacanciesCount = 3 //cvColumn.querySelector('.vertical').children.length; | |
let delayTime = 0; | |
while (vacanciesCount > 0) { | |
const vacancies = cvColumn.querySelector('.vertical'); | |
const vacancy = vacancies.firstElementChild.firstElementChild; | |
vacancy.click(); | |
await delay(2000); | |
//ma-select__control--menu-is-open | |
//ma-select__control ma-select__control--is-focused ma-select__control--menu-is-open css-1pahdxg-control | |
//ma-select__indicator ma-select__dropdown-indicator css-1gtu0rj-indicatorContainer | |
const editorContainer = document.querySelector('.editor-enter-done'); | |
console.log('editorContainer: ', editorContainer); | |
const statusInput = editorContainer.children[1].querySelector('[name="status"]'); | |
console.log('statusInput: ', statusInput); | |
delayTime += getRandomNumberBetween(5, 11) * 1000; | |
setTimeout(() => { | |
statusInput.value = 'REJECTED'; | |
console.log(28, statusInput); | |
editorContainer.children[0].querySelector('button').click; | |
vacanciesCount--; | |
}, delayTime); | |
} | |
// vacancies.forEach(elem => { | |
// elem.firstElementChild.click(); | |
// console.log(21, 'click: '); | |
// const editorContainer = document.querySelector('.editor-enter-done'); | |
// const statusInput = editorContainer.children[1].querySelector('[name="status"]'); | |
// console.log('statusInput: ', statusInput); | |
// delay += getRandomNumberBetween(5, 11) * 1000; | |
// setTimeout(() => { | |
// statusInput.value = 'REJECTED'; | |
// console.log(28, statusInput); | |
// editorContainer.children[0].querySelector('button').click; | |
// }, delay) | |
// }); | |
console.log(29, 'end'); | |
})(); | |
function getRandomNumberBetween(min, max) { | |
return Math.floor(Math.random() * (max - min + 1) + min); | |
} | |
function delay(ms) { | |
return new Promise((resolve) => setTimeout(resolve, ms)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Strava auto liker | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description try to take over the world! | |
// @author putsan | |
// @match https://www.strava.com/dashboard* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=strava.com | |
// @source https://gist.github.com/putsan/cb6b9826d5a0052c4ef507e3c63aacb3 | |
// @updateURL https://gist.github.com/putsan/cb6b9826d5a0052c4ef507e3c63aacb3/raw/3a76117c30da6e55145ba7fa6564054408b75564/Strava_auto_liker.meta.js | |
// @downloadURL https://gist.github.com/putsan/cb6b9826d5a0052c4ef507e3c63aacb3/raw/3a76117c30da6e55145ba7fa6564054408b75564/Strava_auto_liker.user.js | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Strava auto liker | |
// @namespace http://tampermonkey.net/ | |
// @version 0.3 | |
// @description try to take over the world! | |
// @author putsan | |
// @match https://www.strava.com/dashboard* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=strava.com | |
// @source https://gist.github.com/putsan/cb6b9826d5a0052c4ef507e3c63aacb3 | |
// @updateURL https://github.com/putsan/Tampermonkey_scripts/raw/main/strava_auto_liker.user.js | |
// @downloadURL https://github.com/putsan/Tampermonkey_scripts/raw/main/strava_auto_liker.user.js | |
// @grant none | |
// ==/UserScript== | |
(function () { | |
"use strict"; | |
console.clear(); | |
var currentCard = document.querySelector(".react-card-container"); | |
const startLikingProcess = () => { | |
const timesToRepeat = prompt('Скільки вподобайок поставити? (Враховуючи проміжні блоки!)', 0); | |
let interval = 0; | |
for (let i = 0; i < timesToRepeat; i++) { | |
interval += getRandomNumberBetween(5, 15) * 1000; | |
(function (i) { | |
setTimeout(function () { | |
likePost(currentCard); | |
}, interval); | |
})(i); | |
} | |
setTimeout(() => alert("Success"), interval); | |
} | |
const filterRow = document.getElementById('feed-filter').parentElement; | |
const startButton = document.createElement('button'); | |
startButton.innerText = 'Вподобати активності друзів'; | |
filterRow.appendChild(startButton); | |
startButton.addEventListener('click', () => startLikingProcess()); | |
startButton.classList.add('btn', 'experiment'); | |
startButton.style.background = '#005BBB'; | |
startButton.style.color = '#FFD500'; | |
function getRandomNumberBetween(min, max) { | |
return Math.floor(Math.random() * (max - min + 1) + min); | |
} | |
const getNextPost = () => { | |
currentCard = currentCard?.nextElementSibling; | |
}; | |
function likePost(post) { | |
console.log("Try to like", new Date()); | |
const innterHTML = post?.firstElementChild.innerHTML; | |
const isItUserActivity = innterHTML?.includes("owners-name"); | |
if (isItUserActivity) { | |
const titleData = post?.querySelector( | |
'[data-testid="name-and-location"]' | |
); | |
const userName = titleData.firstElementChild.textContent; | |
const activityTime = titleData.lastElementChild.textContent; | |
const likeButton = post?.querySelector('[data-testid="kudos_button"]'); | |
const likeStatus = likeButton.firstElementChild.dataset.testid; | |
const isPostLiked = likeStatus === "filled_kudos"; | |
console.log(36, "Name: ", userName); | |
console.log("Time: ", activityTime); | |
post?.querySelector('[data-testid="entry-images"]')?.remove(); | |
!isPostLiked && likeButton.click(); | |
} else if (post) { | |
post.style.display = "none"; | |
} | |
getNextPost(); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment