Skip to content

Instantly share code, notes, and snippets.

View fuji-nakahara's full-sized avatar

Fuji Nakahara fuji-nakahara

View GitHub Profile
@fuji-nakahara
fuji-nakahara / genron-sf-2018-data-analysis-appendix.ipynb
Last active March 28, 2019 13:28
データで見る ゲンロン 大森望 SF創作講座 2018 付録
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fuji-nakahara
fuji-nakahara / genron-sf-2018-data-analysis.ipynb
Last active March 29, 2019 01:51
データで見る ゲンロン 大森望 SF創作講座 2018
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fuji-nakahara
fuji-nakahara / genron_sf_work_list.md
Last active June 29, 2018 17:12
ゲンロン 大森望 SF創作講座 作品リスト
@fuji-nakahara
fuji-nakahara / scrape_kougais.rb
Created June 17, 2018 03:24
SF創作講座のある課題について提出された梗概をまとめて1つのファイルに出力する
require 'open-uri'
require 'nokogiri'
KADAI_URL = 'http://school.genron.co.jp/works/sf/2018/subjects/1/'
doc = Nokogiri::HTML(open(KADAI_URL))
urls = subject_doc.css('.student-list .written a').map { |e| e['href'] }
kougais = urls.each { |url| Nokogiri::HTML(open(url)).at_css('.summary-content').content }
File.write('kougai.txt', kougais.map { |kougai| kougai.sub(/文字数:\d+\s*\Z/, '').strip }.join("\n\n"))