tkgshn/scrapbox-Duplicator: Scrapboxの非公開・公開プロジェクトを分けて運用する際に面倒な「ページの転送」を自動で行うツールを試す

✅Scrapbox Bot用のアカウントを作る

tkgshn/scrapbox-Duplicatorに戻ってDeploy Herokuする image App nameは世界でユニークじゃないといけない

image ここにさっきメモしたSIDを入れる。 将来的には転送元プロジェクトは柔軟にしたいが、まあまずは実験。

デプロイ待ちの間にテストページを作っておく image

/bluemountain-theme/ページ転送する拡張script あ、これはbodyに積むタイプか。長さ上限がどの程度なのか気になる。

$ heroku run -a scrapbox-duplicator-nishio npm run transfer :

Running npm run transfer on ⬢ scrapbox-duplicator-nishio... up, run.1786 (Free)

> @ transfer /app
> node index.js

(node:21) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
  ...

うーん、よくわからないのでまずはローカルで動かすか $ git clone https://github.com/tkgshn/scrapbox-Duplicator.git $ npm install $ node --trace-warnings index.js

ちゃんとボットアカウントでcsrfTokenを得てるがエクスポートのリクエストで失敗してるな… あ、わかった、Scrapboxのエクスポートはプロジェクトのオーナーしかできないのか

いや、インポートもオーナーだけか

  • image

自分のSIDを使ったらできた imageimage

@blu3mo: サブアカウントにadmin権限を与えればエクスポート等できると思います!

なるほど! image

できたー! image

memo waitFor is deprecated and will be removed in a future release. See https://github.com/puppeteer/puppeteer/issues/6214 for details and how to migrate your code.