tkgshn/scrapbox-Duplicator: Scrapboxの非公開・公開プロジェクトを分けて運用する際に面倒な「ページの転送」を自動で行うツールを試す
tkgshn/scrapbox-Duplicatorに戻ってDeploy Herokuする App nameは世界でユニークじゃないといけない
ここにさっきメモしたSIDを入れる。 将来的には転送元プロジェクトは柔軟にしたいが、まあまずは実験。
デプロイ待ちの間にテストページを作っておく
/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のエクスポートはプロジェクトのオーナーしかできないのか
- うーん、ページリストAPIで直近100件の投稿を取得する形に変えるかな
いや、インポートもオーナーだけか
自分のSIDを使ったらできた
@blu3mo: サブアカウントにadmin権限を与えればエクスポート等できると思います!
なるほど!
できたー!
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.