Movatterモバイル変換


[0]ホーム

URL:


はてラボはてな匿名ダイアリー
ようこそ ゲスト さんログインユーザー登録
< 個人的にすき家・餃子... |anond:20250322221709 >

2025-03-22

anond:20250322220222

id を手動でコピーしてくるのが面倒だったから、削除ボタンが画面に出るようにした

押すと即削除

const rkm = "(トークン的なもの)"constuser = "(ユーザ名)"const delmasda = (id) =&gt;    fetch(`https://anond.hatelabo.jp/${user}/edit`, {        "headers": {            "content-type": "application/x-www-form-urlencoded",        },        "referrer": "https://anond.hatelabo.jp/",        "referrerPolicy": "origin",        "body": new URLSearchParams({            "rkm": rkm,            "mode": "confirm",            "id":id,            "delete": "削除する"        }).toString(),        "method": "POST",    })for (constsec of document.querySelectorAll(".section")) {constid =sec.querySelector("a").href.match(/&#92;/(&#92;d{14})/)[1]const delbtn = document.createElement("button")    delbtn.textContent = "削除"    delbtn.onclick = async () =&gt; {        await delmasda(id)sec.remove()    }sec.querySelector(".edit").after(delbtn)}

Permalink |記事への反応(0) | 22:21

このエントリーをはてなブックマークに追加ツイートシェア

記事への反応 -
  • 増田の削除をひとつひとつ詳細画面開いてするのが面倒だからまとめて消すスクリプトやで   const rkm = &quot;(トークン的なもの)&quot;const ids = [&quot;(削除する増田ID)&quot;]const user = &quot;(ユ...

    • id を手動でコピーしてくるのが面倒だったから、削除ボタンが画面に出るようにした 押すと即削除 const rkm = &quot;(トークン的なもの)&quot;const user = &quot;(ユーザ名)&quot;const delmasda = (id) =&gt;...

記事への反応(ブックマークコメント)

全てのコメントを見る

人気エントリ

注目エントリ

ログインユーザー登録
ようこそ ゲスト さん
Copyright (C) 2001-2025 hatena. All Rights Reserved.

[8]ページ先頭

©2009-2025 Movatter.jp