POST "content" for discord webhook from GET request
PHP5.3以上(動作確認はPHP7以降のみ)
poster.phpをHTTPサーバー上でPHPが実行可能なディレクトリに任意の名前で設置してください.
your-default-discord-webhook-urlを書き換えることで投稿先のwebhookを設定できます.
http://example.com/poster.php?content=投稿内容(必須)&url=webhook-url(省略時は設定したアドレス)
これでGETリクエスト,つまりブラウザでページを開く処理と同じ処理でPOSTを使うDiscordのWebhookを扱えます. javascriptで扱う場合は文字列をencodeURIComponent()でエンコードする必要があります.
javascript:window.open("http://example.com/poster.php?content=%22+encodeURIComponent(document.title)+" "+encodeURIComponent(location.href);void(0);