Skip to content

Instantly share code, notes, and snippets.

@aiwas
Created July 2, 2020 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aiwas/bc0a265e86bfb963ceec54264fe9e994 to your computer and use it in GitHub Desktop.
Save aiwas/bc0a265e86bfb963ceec54264fe9e994 to your computer and use it in GitHub Desktop.
Twitterの共有ページから自動で遷移するやつ
// ==UserScript==
// @name Twitter Share Intent Auto Transition
// @namespace http://tampermonkey.net/
// @version 2.0
// @description Twitterの共有ページから自動で遷移するやつ
// @author Miyako Kuwano <aiwas@arg.vc>
// @match https://twitter.com/intent/tweet*
// @match https://twitter.com/share*
// @grant none
// ==/UserScript==
(function() {
'use strict';
const url = "https://yysk.icu/share?text=";
const params = (new URL(document.location)).searchParams;
const tweet_text = params.get('text') + "\n";
const tweet_url = params.get('url') + "\n";
const tweet_hashtags = (params.get('hashtags') != null) ? "#" + params.get('hashtags') + "\n" : "";
const tweet_via = (params.get('via') != null) ? "via @" + params.get('via') + "@twitter.com" : "";
location.replace(url + encodeURIComponent(tweet_text + tweet_url + tweet_hashtags + tweet_via));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment