Skip to content

Instantly share code, notes, and snippets.

@mamemomonga
Last active July 2, 2023 02:54
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 mamemomonga/6b34d0ab18fff66e03811dadfad17c6e to your computer and use it in GitHub Desktop.
Save mamemomonga/6b34d0ab18fff66e03811dadfad17c6e to your computer and use it in GitHub Desktop.
ブラウザ拡張を使ってリタイーツをさらに便利にする

タイッツー拡張: ブラウザ拡張を使ってリタイーツをとりあえずそれっぽく動くようにする

タイッツーのリタイーツボタンをとりあえず使えるようにするユーザスクリプトです。 この機能は内部が変わると動作しなくなる場合があります。タイッツーは現在鋭意開発中なため、すぐに使えなくなる可能性があります。ご了承ください。 7月2日 0:00 現在は利用可能です。

インストール方法

  1. Tampermonkeyをブラウザにインストールする
  2. Tampermonkeyアイコンを押し、「新規スクリプト追加」を押す
  3. 全部消して下の retaittsuu.user.js の内容をペーストする
  4. 保存する
  5. タイッツーをリロードして、リタイーツボタンが大括弧で囲まれていたら成功。
// ==UserScript==
// @name タイッツー拡張_リタイーツ機能
// @namespace https://gist.github.com/mamemomonga/6b34d0ab18fff66e03811dadfad17c6e
// @version 0.1.5
// @description タイッツーのリタイーツをとりあえず動くようにしました
// @author mamemomonga
// @match https://taittsuu.com/home
// @match https://taittsuu.com/users/*
// @icon https://taittsuu.com/image/sozai/taitsu.png
// @grant none
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js
// ==/UserScript==
(function() {
'use strict';
// Your code here...
window.reTaittsuu=function(t) {
const ft=$(t).parent().parent()
const username = ft.find(".post-link-user .post-user-name .post-user-name-value").text()
const tid = ft.find(".post-link-user .post-infos .post-user-tid").text()
const posttime = ft.find(".post-link-user .post-infos .post-time").text()
const postcontent = ft.find(".post-link-post .post-content").html().replace(/\<br\>/g,'\n')
const taiitsu="♻リタイーツ\n"
+username+" ("+tid+" "+posttime+")\n"
+postcontent
$("#taiitsuInput").val(taiitsu)
Taittsuu.Post.showTaiitsuDialog()
}
window.postShowTaiitsuDialog=function() {
$("#taiitsuInput").val("")
Taittsuu.Post.showTaiitsuDialog()
}
const rt_button = $(".post-rt-button")
rt_button.html('[<i class="fas fa-retweet"></i>]')
rt_button.attr("onClick","window.reTaittsuu(this)")
// $(".btn-primary").attr("onClick","window.postShowTaiitsuDialog();")
})();
@mamemomonga
Copy link
Author

v0.1.3
ホーム以外からもリタイーツできるようにした

@mamemomonga
Copy link
Author

mamemomonga commented Jul 1, 2023

v0.1.4
改行がいい感じになるようになりました (https://taittsuu.com/users/ynkmr/status/14375)

@mamemomonga
Copy link
Author

v0.1.5
authorなど修正

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