<!DOCTYPE html>
<html>
<head>
<title>Tweet Button</title>
<script>
function tweet() {
var tweetText = "😎";
if (Math.random() < 0.01) {
tweetText = "💩";
}
var appURL = window.location.href;
var tweetURL = "https://twitter.com/intent/tweet?text=" + encodeURIComponent(tweetText) + "&url=" + encodeURIComponent(appURL);
alert("ウィンドウを開く処理がブロックされました");
}
</script>
</head>
<body>
<button onclick="tweet()">ツイートする</button>
</body>
</html>
アプリのURLに関連するジョークは以下の通りです。
Q: ツイートボタンはツイートするたびにお金がかかりますか?
A: いいえ、ツイートは無料ですが、💩をツイートする確率は1/100です!