arakawatomonori / covid19-surveyor Goto Github PK
View Code? Open in Web Editor NEW主要省庁と都道府県や自治体の経済支援制度をまとめる
Home Page: https://help.stopcovid19.jp/
License: Do What The F*ck You Want To Public License
主要省庁と都道府県や自治体の経済支援制度をまとめる
Home Page: https://help.stopcovid19.jp/
License: Do What The F*ck You Want To Public License
「解答ありがとうございます!」は「解答」ではなく「回答」の方がより良いのではないか
https://github.com/yuiseki/vscovid-crawler/blob/7336b05d037f3c04be04db5f5547a9727fbddc78/www-data/slack-interact.sh#L45
CI で make test
が通るかを確認できる変更をレポジトリに加える。
案
とりあえず CloudFront の Invalidate 権限を持つ IAM ユーザーを作りました。
今は deploy には CircleCI を使っているんですかね。
どのように deploy されているのかよくわからないのですが、どうするのが良いでしょうか。
aws CLI を CircleCI の VM から実行できれば、シェルスクリプト作って Makefile から実行すれば良さそうですが。
make test
で動作確認をしていたのですが、
$ make test
~~(wget の出力)~~
終了しました --2020-04-15 21:39:45--
経過時間: 19m 55s
ダウンロード完了: 8924 ファイル、3.2G バイトを 7m 45s で取得 (7.15 MB/s)
Makefile:36: recipe for target 'test' failed
make: *** [test] Error 123
と、途中でジョブが落ちました。
grep.sh が落ちているようで、grep
は検索がマッチしなかった場合、終了コード1を返すので、スクリプトの失敗となりジョブが途中で落ちるようです。
以下は set -ex
付きの出力
$ make grep
./crawler/grep.sh
++ cat
+ words='助成
補助
給付
収入
減額
支援
資金
税金
税制
納税
県税
融資
貸付
制度
相談
窓口
猶予
延長
学校
授業
労働
特例
措置
雇用
事業
休業
リモートワーク
テレワーク'
+ rm -f www-data/index.html
+ sed '/^.\{1,200\}$/!d'
+ sed 's/ //g'
+ grep -r コロナ '--include=*.html' ./www-data
+ sed s/ //g
+ sed 's/[ \t]*//g'
+ sed -e 's/<[^>]*>//g'
+ for word in ${words}
+ echo 助成
助成
+ grep 助成 ./tmp/grep_コロナ.txt.tmp
+ for word in ${words}
+ echo 補助
補助
+ grep 補助 ./tmp/grep_コロナ.txt.tmp
+ for word in ${words}
+ echo 給付
給付
+ grep 給付 ./tmp/grep_コロナ.txt.tmp
+ for word in ${words}
+ echo 収入
収入
+ grep 収入 ./tmp/grep_コロナ.txt.tmp
+ for word in ${words}
+ echo 減額
減額
+ grep 減額 ./tmp/grep_コロナ.txt.tmp
Makefile:45: recipe for target 'grep' failed
make: *** [grep] Error 1
0 になってる。
$ ./wget.sh
xargs: max. processes must be >0
./wget.sh: line 10: ./grep.sh: No such file or directory
./index.sh: line 48: -1: substring expression < 0
data/
に city.csv
みたいなファイルを追加してくれる人を急募
Python でいう if __name__ == '__main__'
のような構文をを加えたい。
. ./crawler/wget.sh
などで読み込んでいる
slack-bot/url-map.sh
の下記のコードがテスト時にも実行されているchannels_id=`get_channels_id`
members_list=`get_members_list $channels_id`
echo members num ${#members_list[@]}
for member in $members_list; do
member_id=${member:1:-1}
send_message $member_id
done
これを
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
# ... 実行コマンド
fi
などとすればスクリプトとして実行されたときのみ実行され、source されたときには実行されない。はず。(未確認)
参考: https://stackoverflow.com/questions/29966449/what-is-the-bash-equivalent-to-pythons-if-name-main
いろいろ同時にいじっているのでこの問題は後回し。
備忘のためにチケットを切りました。
Slack #covid19-surveyor-dev
chrome 1:13 PM, 2020-04-18
make wget、50GBくらい容量食うと聞いてましたが、150GB以上空いてたSSDがいっぱいになって止まっちゃいましたね…
内容見ると謎の画像キャッシュみたいなので数GB食ってたりするので
wget で画像をダウンロードしないとか、拡張子を制限すれば少し減りますかね
https://hacknote.jp/archives/28518/
これを参考にすればできるはず
全く急ぎではないですが、現在ライセンスの指定がないので何か決めたほうが良いと思います。
カレントディレクトリにダウンロードすると見通しが悪くなるので www-data
ディレクトリにダウンロードする。
やりたいこと
before
🧸 sarabi-mastiff.lan:covid19-surveyor
$ git push
remote: Permission to arakawatomonori/covid19-surveyor.git denied to tamakiii.
fatal: unable to access 'https://github.com/arakawatomonori/covid19-surveyor.git/': The requested URL returned error: 403
grep -r コロナ --include="*.html" ./
ってやってしまっているので拡張子がhtmlじゃないとgrep対象にならない
結果がカレントディレクトリに出力されると見通しが悪くなる。
どのテストが失敗してどのテストが成功しているのかを集計する ./test/test.sh
のようなものを書いたほうがよさそう。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.