Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
o771e committed Jun 25, 2024
2 parents f995e56 + 80401c0 commit 485461b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
4 changes: 0 additions & 4 deletions README

This file was deleted.

12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SoPe Bookmarlets

## Instagram: Automatically click 'next post' every 5 sec

## Instagram: Automatically scroll down every 3 sec

## YouTube: Display recent videos as a playlist sorted by views

## YouTube: Display recent videos as a playlist



11 changes: 4 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@ <h1>Bookmarlets from Sound Peaks</h1>
<p>Drag'n'drop links onto your bookmar toolbar of the internet browser.</p>


<h2>TikTok - pop-up with most viewed</h2>
<a href="javascript: function f67() {/** POP UP with vids sorted by views*/(function () {let videos = new Array();let url;let views;let elements = document.getElementsByClassName('e19c29qe8');[...elements].forEach(element => {let url = element.querySelector('a');let views = element.getElementsByClassName('video-count')[0].innerHTML;if (views.includes('K')) {views = parseFloat(views) * 1000} else if(views.includes('M')) {views = parseFloat(views) * 1000000} else if(views.includes('B')) {views = parseFloat(views) * 1000000000};videos.push({u: url, v: views});});videos.sort((a, b) => (a.v > b.v) ? -1 : 1);const style = document.createElement('style');style.textContent = `.popup {display: none; /* Hidden by default */position: absolute;left: 0;top: 0;width: 100%;height: 100%;background-color: rgba(0, 0, 0, 0.5);justify-content: center;align-items: flex-start;}.popup-content {background-color: white;padding: 80px 20px 20px 20px;border-radius: 5px;text-align: center;min-width: 300px;}#arrayList {list-style-type: none;padding: 0;}#arrayList a {font-family: monospace;}#arrayList a:visited {color: red !important;}#closePopupBtn {margin-top: 20px;padding: 10px 20px;font-size: 16px;cursor: pointer;}`;document.head.appendChild(style);const popup = document.createElement('div');popup.id = 'popup';popup.className = 'popup';const popupContent = document.createElement('div');popupContent.className = 'popup-content';const arrayList = document.createElement('ul');arrayList.id = 'arrayList';const closePopupBtn = document.createElement('button');closePopupBtn.id = 'closePopupBtn';closePopupBtn.textContent = 'OK';popupContent.appendChild(arrayList);popupContent.appendChild(closePopupBtn);popup.appendChild(popupContent);document.body.appendChild(popup);arrayList.innerHTML = '';videos.forEach(item => {const li = document.createElement('li');const link = document.createElement('a');link.href = item['u'];link.textContent = item['v'];link.target = '_blank';li.appendChild(link);arrayList.appendChild(li);});popup.style.display = 'flex';closePopupBtn.addEventListener('click', function() {popup.style.display = 'none';});})();} f67();">TT πŸ” Viewed</a>

<h2>Creates a playlist of recent videos sorted by popularity</h2>
<a href="javascript: function f19() {/** POP UP with vids sorted by views*/(function () {let videos = new Array();let url;let views;let elements = document.getElementsByTagName('ytd-rich-item-renderer');[...elements].forEach(element => {let url = element.querySelector('a').getAttribute('href');let name = element.querySelector('#video-title').innerHTML;let views = element.getElementsByClassName('inline-metadata-item style-scope ytd-video-meta-block')[0].innerHTML;views = views.replace(' views', '');if (views.includes('K')) {views = parseFloat(views) * 1000} else if(views.includes('M')) {views = parseFloat(views) * 1000000} else if(views.includes('B')) {views = parseFloat(views) * 1000000000};videos.push({u: url, v: views, n: name});});videos.sort((a, b) => (a.v > b.v) ? -1 : 1);const style = document.createElement('style');style.textContent = `.popup {display: none; /* Hidden by default */position: absolute;left: 0;top: 0;width: 100%;height: 100%;background-color: rgba(0, 0, 0, 0.5);justify-content: center;align-items: flex-start;z-index: 3000;}.popup-content {background-color: white;padding: 80px 20px 20px 20px;border-radius: 5px;text-align: center;min-width: 300px;}#arrayList {list-style-type: none;padding: 0;text-align: left;}#arrayList a {font-family: monospace;font-size: 16px !important;}#arrayList a:visited {color: red !important;}#closePopupBtn {margin-top: 20px;padding: 10px 20px;font-size: 16px;cursor: pointer;}`;document.head.appendChild(style);const popup = document.createElement('div');popup.id = 'popup';popup.className = 'popup';const popupContent = document.createElement('div');popupContent.className = 'popup-content';const arrayList = document.createElement('ul');arrayList.id = 'arrayList';const closePopupBtn = document.createElement('button');closePopupBtn.id = 'closePopupBtn';closePopupBtn.textContent = 'OK';popupContent.appendChild(arrayList);popupContent.appendChild(closePopupBtn);popup.appendChild(popupContent);document.body.appendChild(popup);arrayList.innerHTML = '';videos.forEach(item => {const li = document.createElement('li');const link = document.createElement('a');link.href = item['u'];link.textContent = item['v'] + ' ' + item['n'];link.target = '_blank';li.appendChild(link);arrayList.appendChild(li);});popup.style.display = 'flex';closePopupBtn.addEventListener('click', function() {popup.style.display = 'none';});})();} f19();">πŸ” YouTube Recent Most Viewed</a>
<a href="javascript: function f75() {/** Sorts all videos at the channel's page by views,* creates a playlist and opens it in current tab.*/var script = document.createElement('script');script.src = 'https://code.jquery.com/jquery-3.5.1.min.js';document.body.appendChild(script);function loadAfter$() {var str = 'https://www.youtube.com/watch_videos?feature=c4-overview&type=0&video_ids=';var videos = new Array();var elements = new Array();elements = $('ytd-rich-item-renderer').each(function(){var url = $(this).find('[id=\'thumbnail\'][rel=\'null\']').attr('href').replace('/watch?v=', '').replace('/shorts/', '').split('&')[0];var views = $(this).find('span[class=\'inline-metadata-item style-scope ytd-video-meta-block\']').first().text();if (views.length <= 0) {window.alert('Wrong path.');return;}views = views.replace(' views', '');if (views.includes('K')) {views = parseFloat(views) * 1000} else if(views.includes('M')) {views = parseFloat(views) * 1000000} else if(views.includes('B')) {views = parseFloat(views) * 1000000000};videos.push({u: url, v: views});});videos.sort((a, b) => (a.v > b.v) ? -1 : 1);for (var i in videos) {str = str + videos[i]['u'] + ',';}alert(str);window.location = str;}const t = setTimeout(loadAfter$, 1000);} f75();">πŸ” YouTube Recent Most Viewed</a>

<h2>Creates a playlist of recent videos that are visible on the page at the moment</h2>
<a href="javascript: function f41() {/** Sorts all videos at the channel's page by views,* creates a playlist and opens it in current tab.*/var script = document.createElement('script');script.src = 'https://code.jquery.com/jquery-3.5.1.min.js';document.body.appendChild(script);function loadAfter$() {var str = 'https://www.youtube.com/watch_videos?feature=c4-overview&type=0&video_ids=';var videos = new Array();var elements = new Array();elements = $('ytd-rich-item-renderer').each(function(){var url = $(this).find('[id=\'thumbnail\'][rel=\'null\']').attr('href').replace('/watch?v=', '').replace('/shorts/', '').split('&')[0];videos.push({u: url});});for (var i in videos) {str = str + videos[i]['u'] + ',';}alert(str);window.location = str;}const t = setTimeout(loadAfter$, 1000);} f41();">▢️ YouTube Play Recent</a>
<a href="javascript: function f0() {/** Sorts all videos at the channel's page by views,* creates a playlist and opens it in current tab.*/var script = document.createElement('script');script.src = 'https://code.jquery.com/jquery-3.5.1.min.js';document.body.appendChild(script);function loadAfter$() {var str = 'https://www.youtube.com/watch_videos?feature=c4-overview&type=0&video_ids=';var videos = new Array();var elements = new Array();elements = $('ytd-rich-item-renderer').each(function(){var url = $(this).find('[id=\'thumbnail\'][rel=\'null\']').attr('href').replace('/watch?v=', '').replace('/shorts/', '').split('&')[0];videos.push({u: url});});for (var i in videos) {str = str + videos[i]['u'] + ',';}alert(str);window.location = str;}const t = setTimeout(loadAfter$, 1000);} f0();">▢️ YouTube Play Recent</a>

<h2>Open an instagram photo and it will click next for you</h2>
<a href="javascript: function f34() {var bn = 3;var clickEvent = new MouseEvent('click', {'view': window,'bubbles': true,'cancelable': false});var el = document.getElementsByClassName('_abl-');el[bn].addEventListener(clickEvent, function (e) { /* ... */ }, false);el[bn].dispatchEvent(clickEvent);var tmrID = setInterval(function() {el[bn+1].dispatchEvent(clickEvent)}, 5000);var btn = document.createElement('BUTTON');btn.innerHTML = 'STOP';btn.id = 'cscr';btn.style.cssText = 'position: fixed; top:55px; right:0; z-index: 999;';btn.onclick = function() {clearTimeout(tmrID), btn.remove()};document.body.appendChild(btn);var sheet = window.document.styleSheets[0];sheet.insertRule('._ae65 {display: none !important}', sheet.cssRules.length);sheet.insertRule('._aas7 {display: none !important}', sheet.cssRules.length);/*sheet.insertRule('.M9sTE {width: 100%} ', sheet.cssRules.length);sheet.insertRule('.EtaWk {display: none} ', sheet.cssRules.length);sheet.insertRule('.JyscU ._97aPb {margin-right: 0 !important} ', sheet.cssRules.length);sheet.insertRule('.JyscU.ePUX4 .eo2As {display: none} ', sheet.cssRules.length);*/} f34();">πŸ‘‰ Instagram - Auto Next</a>
<a href="javascript: function f53() {var bn = 0;var clickEvent = new MouseEvent('click', {'view': window,'bubbles': true,'cancelable': false});var el = document.getElementsByClassName('_abl-');el[bn].addEventListener(clickEvent, function (e) { /* ... */ }, false);el[bn].dispatchEvent(clickEvent);var tmrID = setInterval(function() {el[bn+1].dispatchEvent(clickEvent)}, 5000);var btn = document.createElement('BUTTON');btn.innerHTML = 'STOP';btn.id = 'cscr';btn.style.cssText = 'position: fixed; top:55px; right:0; z-index: 999;';btn.onclick = function() {clearTimeout(tmrID), btn.remove()};document.body.appendChild(btn);var sheet = window.document.styleSheets[0];sheet.insertRule('._ae65 {display: none !important}', sheet.cssRules.length);sheet.insertRule('._aas7 {display: none !important}', sheet.cssRules.length);/*sheet.insertRule('.M9sTE {width: 100%} ', sheet.cssRules.length);sheet.insertRule('.EtaWk {display: none} ', sheet.cssRules.length);sheet.insertRule('.JyscU ._97aPb {margin-right: 0 !important} ', sheet.cssRules.length);sheet.insertRule('.JyscU.ePUX4 .eo2As {display: none} ', sheet.cssRules.length);*/} f53();">πŸ‘‰ Instagram - Auto Next</a>

<h2>Srolls page down every X seconds</h2>
<a href="javascript: function f54() {var tmrID = setInterval(function() {window.scrollBy({ top: 600, left: 0, behavior: 'smooth' })}, 3000);var btn = document.createElement('BUTTON');btn.innerHTML = 'STOP';btn.id = 'cscr';btn.style.cssText = 'position: fixed; top:55px; right:0; z-index: 999;';btn.onclick = function() {clearTimeout(tmrID), btn.remove()};document.body.appendChild(btn);} f54();">πŸ‘‡ Auto Scroll Down</a>
<a href="javascript: function f1() {var tmrID = setInterval(function() {window.scrollBy({ top: 600, left: 0, behavior: 'smooth' })}, 3000);var btn = document.createElement('BUTTON');btn.innerHTML = 'STOP';btn.id = 'cscr';btn.style.cssText = 'position: fixed; top:55px; right:0; z-index: 999;';btn.onclick = function() {clearTimeout(tmrID), btn.remove()};document.body.appendChild(btn);} f1();">πŸ‘‡ Auto Scroll Down</a>
2 changes: 1 addition & 1 deletion instagram-press-next.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var bn = 3;
var bn = 0;
var clickEvent = new MouseEvent('click', {
'view': window,
'bubbles': true,
Expand Down

0 comments on commit 485461b

Please sign in to comment.