Are you sure you want to go to an external site to donate a monetary value?
WARNING: Some countries laws may supersede the payment processors policy such as the GDPR and PayPal. While it is highly appreciated to donate, please check with your countries privacy and identity laws regarding privacy of information first. Use at your utmost discretion.
When on YouTube click button to search for channel links on SocialBlade. This is what I have so far, but no button appears in bottom right corner that I can click to visit socialblade stats...
(function() { 'use strict'; getChannelId(); if (channelId) { let div = document.createElement('div'); div.innerHTML = '<a id="socialbladeSearchButton">SocialBlade</a>'; div.style.display = "inline-block"; div.style.position = "fixed"; div.style.right = "2%"; div.style.bottom = "2%"; div.style.zIndex = '9999'; document.body.append(div); let icon = document.getElementById('socialbladeSearchButton'); icon.style.background = 'white'; icon.style.color = 'blue'; icon.style.fontWeight = '800'; icon.style.padding = '5px'; icon.style.border = 'solid 2px black'; icon.style.textDecoration = 'none'; icon.style.fontSize = '14px'; icon.href = 'https://socialblade.com/youtube/channel/' + channelId; icon.target = '_blank'; } var channelId; function getChannelId() { let x = window.location.pathname; let arr = x.split('/'); for (let i = 0; i < arr.length; i++){ if (arr[i].substring(0,2) === 'channel' || arr[i].substring(0,2) === 'CHANNEL') { channelId = arr[i]; } } } })();
I'm having issues or hard time understanding the
function getChannelId() {
part.It looks like youtube generates 3 different types of URLs