random bun scripts that dont fit anywhere else

feat: replace bluesky verification badge with custom and add default verifiers

dunkirk.sh 669b1fd7 8f53cc98

verified
+29 -1
+29 -1
bluesky-community-verifications.user.js
··· 79 79 localStorage.setItem(TRUSTED_USERS_STORAGE_KEY, JSON.stringify(users)); 80 80 }; 81 81 82 + // Populate default trusted users if not already set 83 + if (!localStorage.getItem(TRUSTED_USERS_STORAGE_KEY)) { 84 + const defaultTrustedUsers = [ 85 + "bsky.app", 86 + "nytimes.com", 87 + "wired.com", 88 + "theathletic.bsky.social", 89 + ]; 90 + saveTrustedUsers(defaultTrustedUsers); 91 + console.log("Added default trusted users:", defaultTrustedUsers); 92 + } 93 + 82 94 // Function to add a trusted user 83 95 const addTrustedUser = (handle) => { 84 96 const users = getTrustedUsers(); ··· 276 288 277 289 // Set badge content based on type 278 290 badge.innerHTML = getBadgeContent(badgeType); 291 + 292 + // check if there is a div with button underneath 293 + // Check if this user is verified by Bluesky 294 + const isBlueskyVerified = nameElement.querySelector("div button"); 295 + if (isBlueskyVerified) isBlueskyVerified.remove(); 279 296 280 297 // Create tooltip text with all verifiers 281 298 const verifiersText = ··· 1219 1236 parent.firstChild.after(smallBadge); 1220 1237 parent.style.flexDirection = "row"; 1221 1238 parent.style.alignItems = "center"; 1239 + 1240 + // Look for verification SVG icon in the parent and remove it if it exists 1241 + const badgeSvgIcon = Array.from(parent.childNodes).find( 1242 + (node) => 1243 + node.nodeType === Node.ELEMENT_NODE && 1244 + node.tagName === "DIV" && 1245 + node.querySelector("svg"), 1246 + ); 1247 + if (badgeSvgIcon) { 1248 + badgeSvgIcon.remove(); 1249 + } 1222 1250 } 1223 1251 } catch (error) { 1224 1252 console.error(`Error checking verification for ${handle}:`, error); ··· 1281 1309 checkUserLinksOnPage(); 1282 1310 1283 1311 // Initial check 1284 - setInterval(checkCurrentProfile, 2000); 1312 + setTimeout(checkCurrentProfile, 2000); 1285 1313 1286 1314 // Add settings button if we're on the settings page 1287 1315 if (window.location.href.includes("bsky.app/settings")) {