Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web上にある青空文庫ファイル・zipファイルを直接サポート #8

Merged
merged 2 commits into from
Nov 3, 2015

Conversation

takahashim
Copy link
Contributor

入力ファイルとしてWeb上にある青空文庫形式のファイルや、zipファイルを指定して、それをダウンロード&HTMLに変換できるようにしてみました。

下記のように、第1引数にファイル名ではなくhttp://... みたいなURLを与えた場合、そのURLのファイルと判断して、ダウンロードしてくれます。

$ aozora2html http://www.aozora.gr.jp/cards/001670/files/54584_ruby_57435.zip aozora.html

もっとも、青空文庫で公開されているファイルであれば変換済みのHTMLをダウンロードした方が早そうですが、自前で変換したい場合や作成途中のファイル用には便利そうです。

ARGV[0] -> src_file
ARGV[1] -> dest_file
get remote file and convert into html with open-uri
takahashim added a commit that referenced this pull request Nov 3, 2015
Web上にある青空文庫ファイル・zipファイルを直接サポート
@takahashim takahashim merged commit cb1e4e1 into master Nov 3, 2015
@takahashim takahashim deleted the get_http branch November 3, 2015 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant