LoginSignup
0
0

More than 1 year has passed since last update.

Mac はてなブログ記事 一括でダウンロード

Posted at
①はてなブログの管理画面→
②設定→
③詳細設定→
④エクスポートの記事のバックアップと製本サービス→
⑤ダウンロード

で取得したXXXXXX.export.txtファイルをデスクトップに置いて、
空のimgフォルダを作成します。XXXXXXは正式な名称に変えて下さい。

ターミナルを立ち上げて、デスクトップに移動します。

cd Desktop/

grepコマンド-oオプションで検索にマッチした部分のみをphoto.txtファイルに出力します。

grep "https\:\/\/cdn-.*png\|https\:\/\/cdn-.*jpg" -o XXXXXX.export.txt > photo.txt

この時にzsh: no matches found:で怒られたら、別シェル画面を立ち上げてホームの位置で

open ~/.zshrc

.zshrcを開いて
スクリーンショット 2022-12-23 14.32.17.png

setopt +o nomatch

を加えてcommand + sで保存して

source ~/.zshrc

して設定を反映させて下さい。それでも怒られるようでしたらzshをインストールしてない可能性があります。

brew install zsh

無事にphoto.txtファイルに出力できた場合は、下記コマンドでimgフォルダに移します。

cd img/
xargs -n 1 curl -O < ../photo.txt

マイグレードされ、imgフォルダに画像が流れ込みます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0