Last active
January 19, 2018 22:46
-
-
Save hyuki0000/3f06c7868ddaef6a228e02899276f728 to your computer and use it in GitHub Desktop.
TipmonaTipBookmarklet.js - Pay monacoin via @tipmona
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* TipmonaTipBookmarklet.js | |
* | |
* When you see | |
* https://twitter.com/EXAMPLEUSER/... | |
* Then you jump to | |
* https://twitter.com/intent/tweet?text=@tipmona%20tip%20@EXAMPLEUSER%201%20Mona%20を贈ります。 | |
* And when you see | |
* https://twitter.com/EXAMPLEUSER/status/xxxxxxxx | |
* Then you jump to | |
* https://twitter.com/intent/tweet?in_reply_to=xxxxxxxx&text=@tipmona%20tip%20@EXAMPLEUSER%201%20Mona%20を贈ります。 | |
* | |
* Written by Hiroshi Yuki. | |
* Licensed under CC0. | |
* https://creativecommons.org/publicdomain/zero/1.0/ | |
* | |
*/ | |
function start() { | |
var url = location.href; | |
var ar = url.match(/^https:\/\/twitter\.com\/([^\/]+)\/status\/(\d+)/); | |
var br = url.match(/^https:\/\/twitter\.com\/([^\/]+)/); | |
if (br) { | |
var username = br[1]; | |
var optional = ''; | |
if (ar) { | |
var status_id = ar[2]; | |
optional = 'in_reply_to=' + status_id + '&'; | |
} | |
location = 'https://twitter.com/intent/tweet?' + optional + 'text=@tipmona%20tip%20@' + username + '%201%20Mona%20を贈ります。'; | |
} else { | |
alert("Username is not found."); | |
} | |
} | |
start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
0.39 Thank you! バージョン