Skip to content

Instantly share code, notes, and snippets.

@twobob
Last active January 30, 2025 11:54
Show Gist options
  • Save twobob/59142ab609c36868239efc79768ccb20 to your computer and use it in GitHub Desktop.
Save twobob/59142ab609c36868239efc79768ccb20 to your computer and use it in GitHub Desktop.
shun bluesky poster and post in one click
javascript:(function(){function r(){return Math.floor(300*Math.random()+300)}function l(c){if("undefined"==typeof jQuery){var e=document.createElement("script");e.src="https://code.jquery.com/jquery-3.6.0.min.js";e.onload=function(){n("%E2%9C%85%20jQuery%20loaded");c&&c()};document.head.appendChild(e)}else{n("%E2%9C%85%20jQuery%20present");c&&c()}}function u(){if(!document.getElementById("s-status")){var e=document.createElement("div");e.id="s-status";e.style.cssText="position:fixed;bottom:10px;right:10px;padding:10px;background:#000;color:#fff;font-size:14px;border-radius:5px;opacity:.9;z-index:9999;max-width:300px";e.innerHTML='<strong>Shun%20Status:</strong><div%20id="s-log"></div>';document.body.appendChild(e)}}function n(e){u();var c=document.getElementById("s-log");c&&(c.innerHTML+=e+"<br>",clearTimeout(window.sTimeout),window.sTimeout=setTimeout(function(){c.innerHTML=""},1e4))}function t(){var e=$('[data-testid^="feedItem-by-"]');e.length?(e.each(function(){$(this).find(".s-btn").length||$(this).append($('<button>',{text:"↑%20Shun%20↑",class:"s-btn",style:"margin-left:0;padding:5px;background:#212931;border:0;cursor:pointer",click:function(c){c.preventDefault();c.stopPropagation();n("%F0%9F%9B%91%20Shunning...");d($(this).closest('[data-testid^="feedItem-by-"]'))}}))}),n("%E2%9C%85%20Added%20to%20"+e.length+"%20posts")):n("%E2%9A%A0%EF%B8%8F%20No%20posts")}function o(e,c){var a=e.find('[data-testid="postDropdownBtn"]');a.length?(a[0].click(),setTimeout(c,r())):n("%E2%9A%A0%EF%B8%8F%20Menu%20missing")}function d(e){o(e,function(){var c=$('[data-testid="postDropdownShowLessBtn"]');c.length?(n("%F0%9F%94%BD%20Show%20less"),c[0].click(),setTimeout(function(){o(e,function(){var c=$('[data-testid="postDropdownBlockBtn"]');c.length?(n("%F0%9F%9A%AB%20Blocking"),c[0].click(),setTimeout(function(){var c=$('[data-testid="confirmBtn"]');c.length?(n("%E2%9C%85%20Confirmed%20block"),c[0].click(),setTimeout(function(){o(e,function(){var c=$('[data-testid="postDropdownHideBtn"]');c.length?(n("%F0%9F%99%88%20Hiding"),c[0].click(),setTimeout(function(){var c=$('[data-testid="confirmBtn"]');c.length?(n("%E2%9C%85%20Confirmed%20hide"),c[0].click(),setTimeout(function(){n("%F0%9F%8E%89%20Complete")},r())):n("%E2%9A%A0%EF%B8%8F%20Hide%20confirm%20missing")},r())):n("%E2%9A%A0%EF%B8%8F%20Hide%20missing")})},r())):n("%E2%9A%A0%EF%B8%8F%20Block%20confirm%20missing")},r())):n("%E2%9A%A0%EF%B8%8F%20Block%20missing")})},r())):n("%E2%9A%A0%EF%B8%8F%20Show%20less%20missing")})}l(t)})();
@twobob
Copy link
Author

twobob commented Jan 29, 2025

its a bookmarklet

@twobob
Copy link
Author

twobob commented Jan 29, 2025

image

@twobob
Copy link
Author

twobob commented Jan 29, 2025

made the button blue and work 30 ish % faster

@twobob
Copy link
Author

twobob commented Jan 30, 2025

added auto cleardown of the logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment