Links to tweets for SkyScraperCity

Adds clickable links to quoted tweets. Useful if you block 3rd party content.

As of 2019-09-30. See the latest version.

// ==UserScript==
// @name          Links to tweets for SkyScraperCity
// @name:pl       Linki do tweetów w SkyScraperCity
// @description   Adds clickable links to quoted tweets.  Useful if you block 3rd party content.
// @description:pl Dodaje klikalne linki do tweetów.  Przydatne kiedy blokujesz zawartość witryn trzecich.
// @version       1
// @author        me
// @namespace     https://github.com/skalee/ssc-grease
// @license       CC0
// @homepageURL   https://github.com/skalee/ssc-grease
// @supportURL    https://www.skyscrapercity.com/showthread.php?t=2017475
// @grant    none
// @include       https://www.skyscrapercity.com/showthread.php?*
// @include       https://www.skyscrapercity.com/showpost.php?*
// ==/UserScript==

document.querySelectorAll("blockquote.twitter-tweet").forEach(function(tweet) {
  var tweetLink = tweet.querySelector("a[href]")
  var clonedLink = tweetLink.cloneNode()
  clonedLink.target = "_blank"
  clonedLink.innerText = "tweet"
  var wrapperElement = document.createElement("p")
  wrapperElement.append("(")
  wrapperElement.append(clonedLink)
  wrapperElement.append(")")
  tweet.parentElement.insertBefore(wrapperElement, tweet.nextSibling)
})