Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
業務改善の面白さ~毎日更新されるビジュアルコンテンツの差分を わかりやすくするためのプロトタイ...
Search
Marina Nakagawa
October 13, 2022
Technology
4
6.2k
業務改善の面白さ~毎日更新されるビジュアルコンテンツの差分を わかりやすくするためのプロトタイプを作るまで~
PyCon JP
2022 2022/10/14
業務改善の面白さ
毎日更新されるビジュアルコンテンツの差分を
わかりやすくするためのプロトタイプを作るまで
Marina Nakagawa
October 13, 2022
Tweet
Share
More Decks by Marina Nakagawa
See All by Marina Nakagawa
通知にプレースホルダーを入れてみたら開封率がちょっと良くなった話
marina1017
1
1.8k
アプリ流入用広告のデータ分析基盤を整える ~FirebaseとiAd.frameworkの連携~
marina1017
2
3.5k
ABテストが上手く行かなかった話
marina1017
1
560
「開発初心者は何がわからないのか」 わからないを言語化するヒント
marina1017
2
910
Appleのアニメーションはなぜ美しいか考える
marina1017
1
2.1k
Appleのアニメーション.pdf
marina1017
0
45
gitの裏側をさぐる
marina1017
0
460
Lottieによるリッチアニメーション実装のためのAfterEffectsハマりどころ
marina1017
3
11k
Bitriseことはじめ
marina1017
12
3.4k
Other Decks in Technology
See All in Technology
Oracle Base Database Service:サービス概要のご紹介
oracle4engineer
PRO
1
16k
AIアプリケーション開発でAzure AI Searchを使いこなすためには
isidaitc
0
110
2025年のARグラスの潮流
kotauchisunsun
0
790
20250116_自部署内でAmazon Nova体験会をやってみた話
riz3f7
1
100
Amazon Q Developerで.NET Frameworkプロジェクトをモダナイズしてみた
kenichirokimura
1
200
Accessibility Inspectorを活用した アプリのアクセシビリティ向上方法
hinakko
0
180
実践! ソフトウェアエンジニアリングの価値の計測 ── Effort、Output、Outcome、Impact
nomuson
0
2.1k
KMP with Crashlytics
sansantech
PRO
0
240
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
6
54k
Cloudflareで実現する AIエージェント ワークフロー基盤
kmd09
0
290
Amazon Route 53, 待ちに待った TLSAレコードのサポート開始
kenichinakamura
0
170
Building Scalable Backend Services with Firebase
wisdommatt
0
110
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Bash Introduction
62gerente
610
210k
Writing Fast Ruby
sferik
628
61k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
A better future with KSS
kneath
238
17k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Git: the NoSQL Database
bkeepers
PRO
427
64k
The Cost Of JavaScript in 2023
addyosmani
46
7.2k
Transcript
1 ۀվળͷ໘ന͞ ຖߋ৽͞ΕΔϏδϡΞϧίϯςϯπͷࠩΛ Θ͔Γ͘͢͢ΔͨΊͷϓϩτλΠϓΛ࡞Δ·Ͱ ຊܦࡁ৽ฉࣾɹத ສᣦಸ PyCon JP 2022 2022/10/14
2 Marina Nakagawa ຊܦࡁ৽ฉࣾͷΤϯδχΞ ܦϏδϡΞϧσʔλͷίϯςϯπ੍࡞ ΠϯϑϥपΓͷվળͳͲͳͲ ࣗಈԽ͕͖Ͱ͢ʂ
3 ຊ͢͜ͱ ఆظతʹߋ৽͞ΕΔίϯςϯπͷ՝ ܦϏδϡΞϧσʔλͱ 1 2 3 ࠩݕͷϓϩτλΠϓΛ࡞Δ ݁Ռͱ·ͱΊ 4
4 ܦϏδϡΞϧσʔλͱ 1
5
6 จষ ਤઆ σʔλ Πϥετ ࣸਅ ͋ΒΏΔදݱΛۦͯ͠ etc… χϡʔεΛΘ͔Γ͑͘͢Δ
7 https://vdata.nikkei.com/newsgraphics/sanin2022-analysis/
8 https://vdata.nikkei.com/newsgraphics/party-poll-votes-map/
9 https://vdata.nikkei.com/newsgraphics/coronavirus-world-map/
10 https://vdata.nikkei.com/newsgraphics/clear-accounting/clear-accounting/
11 https://vdata.nikkei.com/
12 ɾײతʹΘ͔Γ͘͢ɺ࣌ؒͰಡΊΔίϯςϯπ ɾैདྷͷใಓදݱΛਐԽͤ͞ΔࢼΈ ɾϢʔβʔʹͱཱͬͯͭίϯςϯπ ɾଉͷ͍ίϯςϯπ ɾطଘͷํ๏Ҏ֎ͷίϯςϯπͷྲྀ௨ํ๏ͱϊϋ ͦΕΒΛ࡞Δ͕ ܦϏδϡΞϧσʔλ
13 هऀ ͑Δ͖͜ͱ σβΠφʔ ͑ํ ΤϯδχΞ ͑ΔͨΊͷΈ
14 هऀ ͑Δ͖͜ͱ σβΠφʔ ͑ํ ΤϯδχΞ ͑ΔͨΊͷΈ
15 هऀ هࣄίϯςϯπͷ༰ɾσʔλ σβΠφʔ ίϯςϯπͷઃܭɾσβΠϯ ΤϯδχΞ ৴ͷΈ Ϣʔβʔ͔ΒͷΠϯλϥΫγϣϯΛؚΉ࡞Γ
16 هऀ σβΠφʔ ΤϯδχΞ
17 ఆظతʹߋ৽͞ΕΔίϯςϯπͷ՝ 2
18 ఆظతʹߋ৽͞ΕΔίϯςϯπͷ جຊతͳ੍࡞ͷྲྀΕ
None
هऀνʔϜ εϓϨουγʔτͰ ຖσʔλूܭˍνΣοΫ هऀνʔϜͷऀ͕ެ։Λஅ $*Λ༻͍ͨσϓϩΠϑϩʔͱ ҟͳΔϑϩʔͰຊ൪ʹө
هऀνʔϜ εϓϨουγʔτͰ ຖσʔλूܭˍνΣοΫ هऀνʔϜͷ ऀ͕ެ։Λஅ هऀ͕Λ࣋ͭσʔλ جຊతʹຖߋ৽͞ΕΔ
σβΠφʔɾΤϯδχΞνʔϜ վम͕͋Δ߹ (JU)VCͰϦιʔεཧ $*ͰϦϦʔε
σβΠφʔɾΤϯδχΞνʔϜ վम͕͋Δ߹ (JU)VCͰϦιʔεཧ $*ͰϦϦʔε ࣌ظʹΑͬͯݟͤΔσʔλ ݟͤํΛมߋ͢Δͱ͖ʹߋ৽
هऀνʔϜ σβΠφʔɾΤϯδχΞνʔϜ εϓϨουγʔτͰ ຖσʔλूܭˍνΣοΫ վम͕͋Δ߹ (JU)VCͰϦιʔεཧ $*ͰϦϦʔε هऀνʔϜͷσʔλͱ σβΠφʔɾΤϯδχΞνʔϜͷՌ͕ ߹Θ͞Δͷຊ൪ڥ
˞ͪΖΜ։ൃڥଘࡏ͢Δ
None
26
ࠓͷάϥϑ ߋ৽͞Ε͍ͯΔʁ هࣄίϯςϯπͷ ࣈਖ਼͘͠ දࣔ͞Ε͍ͯΔʁ άϧʔϓԽ͞Εͨ ԣάϥϑେৎʁ େ෯վमͨ͠ͱ͜Ζ ͖ͪΜͱදࣔ͞Ε͍ͯΔʁ
ߋ৽͞Ε͍ͯΔʁ
ࠓͷάϥϑ ߋ৽͞Ε͍ͯΔʁ هࣄίϯςϯπͷ ࣈਖ਼͘͠ දࣔ͞Ε͍ͯΔʁ άϧʔϓԽ͞Εͨ ԣάϥϑେৎʁ େ෯վमͨ͠ͱ͜Ζ ͖ͪΜͱදࣔ͞Ε͍ͯΔʁ ຖߋ৽͞ΕΔ
σʔλܥ ߋ৽͞Ε͍ͯΔʁ
ࠓͷάϥϑ ߋ৽͞Ε͍ͯΔʁ هࣄίϯςϯπͷ ࣈਖ਼͘͠ දࣔ͞Ε͍ͯΔʁ άϧʔϓԽ͞Εͨ ԣάϥϑେৎʁ େ෯վमͨ͠ͱ͜Ζ ͖ͪΜͱදࣔ͞Ε͍ͯΔʁ վम࣌ʹ
ߋ৽͞ΕΔܥ
ࠓͷάϥϑ ߋ৽͞Ε͍ͯΔʁ هࣄίϯςϯπͷ ࣈਖ਼͘͠ දࣔ͞Ε͍ͯΔʁ άϧʔϓԽ͞Εͨ ԣάϥϑେৎʁ େ෯վमͨ͠ͱ͜Ζ ͖ͪΜͱදࣔ͞Ε͍ͯΔʁ ֬ೝ͢ΔϙΠϯτ͕ଟ͍
& ݟΔϙΠϯτ͕ҟͳΔ ใಓػؔͱͯ͠σʔλͷνΣοΫݫ͘͢͠Δඞཁ͕͋Δ͕ɾɾɾ
31
32
33 diff!!!! (͜ΕσΟϨΫλʔ͕ਏ͍)
34 diffؒҧ͍୳͠
35 diffؒҧ͍୳͠
36 ࠷ऴతͳஅίϯϐϡʔλͰͳ͘ਓ͕ؒߦ͏͕ ͤΊͯ ֬ೝ͢ΔՕॴ͕໌֬ʹͳΕ͍͍ͷʹɾɾɾɾ
37 ͦ͏ͩʂ ϏδϡΞϧϦάϨογϣϯςετΛԠ༻ͯ͠ ͏·͍͜ͱΈԽͰ͖ͳ͍ͩΖ͏͔ʁʁʁ
38 ࠩݕͷϓϩτλΠϓΛ࡞Δ 3
39 Try1 ϏδϡΞϧϦάϨογϣϯςετπʔϧreg-suit ͰͬͯΈΑ͏
40 https://github.com/reg-viz/reg-suitΑΓҾ༻
NBTUFSϒϥϯν NBTUFS͔Β ͬͨ࣌ͷϖʔδ QVTIͯ͠ ߋ৽͞Εͨϖʔδ ൺֱͯࠩ͠Λग़͢
(JU)VCʹQVTI͢Δ $*্Ͱ ϖʔδͷεΫϦʔϯγϣοτΛ࡞ SFHTVJUͰ εΫϦʔϯγϣοτೖͬͨσΟϨΫτϦΛࢦఆ 4ʹੜͨ͠ϖʔδΛ্͛Δ (JU)VCͷίϝϯτʹ ௨͕ඈͿ
(JU)VCʹQVTI͢Δ $*্Ͱ ϖʔδͷεΫϦʔϯγϣοτΛ࡞ SFHTVJUͰ εΫϦʔϯγϣοτೖͬͨσΟϨΫτϦΛࢦఆ 4ʹੜͨ͠ϖʔδΛ্͛Δ (JU)VCͷίϝϯτʹ ௨͕ඈͿ ؤுͬͯίʔυΛॻ͘ͷ ͚ͩ͜͜ʂ
(JU)VCʹQVTI͢Δ $*্Ͱ ϖʔδͷεΫϦʔϯγϣοτΛ࡞ SFHTVJUͰ εΫϦʔϯγϣοτೖͬͨσΟϨΫτϦΛࢦఆ 4ʹੜͨ͠ϖʔδΛ্͛Δ (JU)VCͷίϝϯτʹ ௨͕ඈͿ ͜ΕҎ߱ SFHTVJU͕ࣗಈͰͬͯ͘Ε·͢
13্ʹϦάϨογϣϯςετͷ ݁ՌΛදࣔ͢Δػೳ EJ ff ͷϨϙʔτ ࣗಈੜͰ͖Δ
ઃఆͨ͠4ʹ Ϩϙʔτ͕ੜ͞ΕΔ ҰཡͱͳͬͯΘ͔Γ͍͢
ࠩͷݟͤํ ύλʔϯ༻ҙ͞Ε͍ͯΔ
48 ͏·͍͔͘ͳ͔ͬͨϙΠϯτ1 ͜ͷίϯςϯπͰreg-suitΛ͑ͳ͍ࣄ͕͋ͬͨ
(JU)VCͰཧ͍ͯ͠ͳ͍ͷ දࣔ͢Δσʔλࣗମ εϓϨουγʔτͰཧ (JU)VCͰཧ͍ͯ͠Δͷ )5.-$44ը૾ͳͲͷϦιʔε
هऀνʔϜ σβΠφʔɾΤϯδχΞνʔϜ εϓϨουγʔτͰ ຖσʔλूܭˍνΣοΫ վम͕͋Δ߹ (JU)VCͰϦιʔεཧ $JSDMF$*ͰϦϦʔε هऀνʔϜͷσʔλͱ σβΠφʔɾΤϯδχΞνʔϜͷՌ͕ ߹Θ͞Δͷຊ൪ڥ
˞ͪΖΜ։ൃڥଘࡏ͢Δ هऀνʔϜͷ ऀ͕ެ։Λஅ
هऀνʔϜ σβΠφʔɾΤϯδχΞνʔϜ εϓϨουγʔτͰ ຖσʔλूܭˍνΣοΫ վम͕͋Δ߹ (JU)VCͰϦιʔεཧ $JSDMF$*ͰϦϦʔε ຖͷσʔλूܭͨ݁͠Ռ͕ (JU)VCͰཧ͞Ε͍ͯͳ͍
هऀνʔϜ σβΠφʔɾΤϯδχΞνʔϜ εϓϨουγʔτͰ ຖσʔλूܭˍνΣοΫ վम͕͋Δ߹ (JU)VCͰϦιʔεཧ $JSDMF$*ͰϦϦʔε ຊ൪ڥͷϖʔδͰ ࠓݱࡏදࣔ͞Ε͍ͯΔͷͱ աڈදࣔ͞Ε͍ͯͨͷΛൺֱ͍ͨ͠
53 ͏·͍͔͘ͳ͔ͬͨϙΠϯτ2 ຊʹͬͯΒ͑Δ͔࣮༻ੑͷݒ೦ - GitHubʹ͔͠௨͕͜ͳ͍ɻ - هऀʹGitHubΞΧϯτ͕ඞཁ - ࠩΛݟΔ·Ͱͷ4ΫϦοΫͷนΛӽ͑Δ -
Slack νϟϯωϧ,GitHubͷPR,reg-suit,reg-suitͷத
54 ͏·͍͔͘ͳ͔ͬͨϙΠϯτ2 ຊʹͬͯΒ͑Δ͔࣮༻ੑͷݒ೦ - GitHubʹ͔͠௨͕͜ͳ͍ɻ - هऀʹGitHubΞΧϯτ͕ඞཁ - ࠩΛݟΔ·Ͱͷ4ΫϦοΫͷนΛӽ͑Δ -
Slack νϟϯωϧ,GitHubͷPR,reg-suit,reg-suitͷத ຊʹճΫϦοΫͯ͘͠ΕΔʁʁʁ Θ͟Θ͟ݟΔͷΊΜͲ͘͘͞ͳ͍ʁʁʁ
55 ͜͏ͳͬͨΒ͍͍ͳͱໝͯͨ͜͠ͱ Nikkei ———— ———— ———— ———— ௨νϟϯωϧ ௨bot 1Click
ͲΜͳ৬छͰ ͚ͩ͜͜ݟ͓͚͍͍ͯʂ ͱ͍͏ঢ়ଶΛ࡞Γ͍ͨ ———— ———— ————
56 ͜͏ͳͬͨΒ͍͍ͳͱໝͯͨ͜͠ͱ Nikkei ———— ———— ———— ———— ௨νϟϯωϧ ௨bot 1Click
ͲΜͳ৬छͰ ͚ͩ͜͜ݟ͓͚͍͍ͯʂ ঢ়ଶΛ࡞Γ͍ͨ ֬ೝ͢Δ͖Օॴ͕໌֬ʹʂ ࠷ऴతͳਓؒͷஅͷิॿʹͳΔʂ(ͣ)
57 ཁ݅Λߟ͑Δ ɾهऀνʔϜଆ͕σʔλΛߋ৽͢Δͱ͖ʹɺࣗಈͰલͷঢ়ଶͱࠓͷঢ়ଶͱͦͷ͕ࠩදࣔ͢Δ ɾ৬छΘͣɺ୭͕ͦͷࠩΛ֬ೝ͢Δ͜ͱ͕Ͱ͖Δঢ়ଶʹ͢Δ ɾ࿈བྷखஈʹSlackΛར༻͍ͯ͠ΔͷͰɺͦͷ݁Ռ͕Slackʹ·ͱΊΒΕΔͱΑ͍
58 αΫοͱϓϩτλΠϓΛ ࡞ͬͯΈΔ SFHTVJUͰֶΜͩ͜ͱΛ׆͔ͯ͠
59 ࠩΛݕग़ͯ͠ɺSlackʹԼ͢Δ͘͠ΈΛߟ͑ͨ 1.ར༻͢ΔπʔϧϥΠϒϥϦྨΛબఆ͢Δ 2.࣮ߦํ๏ΛܾΊΔ 3.ൺֱը૾Λ༻ҙ͢Δ 4.ը૾ͷߴ͞Λἧ͑ͯɺൺֱՃ͘͢͢͠Δ 5.ը૾ͷࠩΛݕग़͢ΔͨΊͷ४උΛ͢Δ 6.ը૾ͷࠩΛݕग़͢Δ 7.͕ࠩ͋Ε࡞ͨ͠εΫϦʔϯγϣοτΛS3ʹΞοϓϩʔυ͢Δ 8.Slackߘ༻ʹը૾Λ߹͢Δ
9.Slackʹߘ͢Δ
60 1.ར༻͢ΔπʔϧϥΠϒϥϦྨΛબఆ͢Δ ը૾ͰࠩΛݕग़͢ΔͳΒ →OpenCV͕͑ͯ Webը૾ΛεΫγϣ͢ΔͳΒˠWebࣗಈԽπʔϧͰεΫγϣΛͱΖ͏ աڈը૾Λอଘ͢ΔͳΒˠS3͕ྑͦ͞͏ ·͋ɺϓϩτλΠϓͩͬ͠͞ͱPythonͰࢼͦ͏ʂ Ұ୴Google ColaboratoryͰϛχϛχϓϩτλΠϓΛ࡞ͬͯΈΔ →ΠέΔʂΛ֬৴
61 2.࣮ߦํ๏ΛܾΊΔ Google Colaboratory Ͱܾ·ͬͨ࣌ؒʹىಈͰ͖ͨΒ͍͍ͷʹ ࠓͷܖͩͱͰ͖ͳ͔ͬͨͷͰ GitHubͱ࿈ܞ͍ͯ͠ΔCircleCIͰɺ σʔλܗͱө͕ऴΘΔޕޙ̑࣌ʹ࣮ߦ͢Δ͜ͱʹ ※Pro+ͩͱεέδϡʔϧػೳ͕͋Γ·͢ (https://github.com/googlecolab/colabtools/wiki/Scheduled-notebooks)
$JSDMF$*Ͱ ϖʔδͷεΫγϣΛੜ 4͔Βલճߋ৽࣌ʹࡱӨͨ͠ εΫγϣΛμϯϩʔυ 62 3.ൺֱը૾Λ༻ҙ͢Δ
$JSDMF$*Ͱ ϖʔδͷεΫγϣΛੜ 4͔Βલճߋ৽࣌ʹࡱӨͨ͠ εΫγϣΛμϯϩʔυ 63 3.ൺֱը૾Λ༻ҙ͢Δ
64 SCREENSHOT_WIDTH_SIZE = 800 SCREENSHOT_HIGHT_SIZE = 12000 TARGET_URL = "https://vdata.nikkei.com/newsgraphics/coronavirus-japan-vaccine-
status/" WAIT_TIME = 10 # ΣϒυϥΠόʔͱΦϓγϣϯͷઃఆ options = webdriver.ChromeOptions() options.add_argument('--headless') options.add_argument('--incognito') options.add_argument('--no-sandbox') options.add_argument('--disable-dev-shm-usage') driver = webdriver.Chrome(ChromeDriverManager().install(), options=options) driver.get(TARGET_URL) driver.set_window_size(SCREENSHOT_WIDTH_SIZE, SCREENSHOT_HIGHT_SIZE) time.sleep(WAIT_TIME) driver.save_screenshot("test-reports/current_page_screenshot.png") ※ίʔυҰ෦ൈਮ
$JSDMF$*Ͱ ϖʔδͷεΫγϣΛੜ 4͔Βલճߋ৽࣌ʹࡱӨͨ͠ εΫγϣΛμϯϩʔυ 65 3.ൺֱը૾Λ༻ҙ͢Δ
66 # S3ʹΞοϓϩʔυ import boto3 # S3ͷϑΝΠϧμϯϩʔυɺΞοϓϩʔυͷઃఆ client = boto3.client(
's3', aws_access_key_id= {AWS ΞΫηεΩʔID}, aws_secret_access_key= {AWS γʔΫϨοτΩʔ}, ) client.download_file( '{S3໊}', '{S3ͷύε໊}/screenshot.png', 'test-reports/past_page_screenshot.png' ) ※ίʔυҰ෦ൈਮ
Γͳ͍͞0QFO$7Ͱ ന৭෦ΛՃͯ͠ௐ 4.ը૾ͷߴ͞Λἧ͑ͯɺൺֱՃ͘͢͢͠Δ
68 #=============================================== #ɹಉ͡αΠζʹͳΔΑ͏ʹԼʹۭനΛೖΕͯϦαΠζ #=============================================== color = (255, 255, 255) if
img_current.shape[0] <= img_past.shape[0]: bottom = img_past.shape[0] - img_current.shape[0] img_current = cv2.copyMakeBorder(img_current, 0,bottom, 0, 0, cv2.BORDER_CONSTANT, value=color, ) else: bottom = img_current.shape[0] - img_past.shape[0] img_past = cv2.copyMakeBorder(img_past, 0, bottom, 0, 0, cv2.BORDER_CONSTANT, value=color, ) ※ίʔυҰ෦ൈਮ
มߋલͱมߋޙΛൺֱͯ͠ ࠩϚεΫΛ࡞͢Δ 5.ը૾ͷࠩΛݕग़͢ΔͨΊͷ४උΛ͢Δ
70 #=============================================== # ը૾ͷࠩΛ࡞Δ #=============================================== fgbg = cv2.bgsegm.createBackgroundSubtractorMOG(history=2) #ϚεΫͷܭࢉ fgmask
= fgbg.apply(img_current) fgmask = fgbg.apply(img_past) cv2.imwrite('test-reports/mask.png', fgmask) ※ίʔυҰ෦ൈਮ
6.ը૾ͷࠩΛΘ͔Γ͘͢͢Δ ϚεΫ͚ͩͩͱ͕ࠩΘ͔Βͳ͍ͷͰ ը૾Λ҉ͯ͘͠ॏͶΔ
72 #=============================================== # ը૾Λ҉ͯࠩ͘͠ϚεΫΛॏͶɺ # ࠩͷݕग़ͷ݁Ռ͕͔ΔΑ͏ʹग़ྗ͢Δ #=============================================== # ݱࡏͷεΫγϣΛগ͠҉͘͢Δ img_result
= img_current // 4 # ϚεΫͰࠩͷ͋Δͱ͜Ζ͚ͩΛࡌͤΔ img_result[fgmask==255] = (0, 255, 0) cv2.imwrite('test-reports/result.png', img_result) ※ίʔυҰ෦ൈਮ
8.Slackߘ༻ʹը૾Λ߹͢Δ 4MBDLͰ௨ͨ͠ͱ͖ʹΘ͔Γ͍͢Α͏ʹ มߋલɺมߋޙɺࠩͷ̏ͭΛ͠߹Θͤ Ұͭͷը૾ʹ͢Δ
8.Slackߘ༻ʹը૾Λ߹͢Δ ͜͏ͳΔͱɺ Կ͕Ͳ͏มΘ͍ͬͯΔͷ͔Θ͔Βͳ͍
75 #============================= # ը૾ͷ߹(Slackߘ༻) #============================= percentage_to_resize = 0.5 img_summary =
cv2.hconcat([img_current, img_past, img_result]) img_summary = cv2.resize( img_summary , (int(img_summary.shape[1] * percentage_to_resize), int(img_summary.shape[0] * percentage_to_resize)) ) cv2.imwrite('test-reports/summary.png', img_summary) ※ίʔυҰ෦ൈਮ
7.͕ࠩ͋Ε࣍ճͷൺֱ༻ʹ࡞ͨ͠εΫϦʔϯ γϣοτΛS3ʹΞοϓϩʔυ͢Δ Կ͠ͳ͍ ࠩ͋Γʂ 4 ࠩͳ͠ʂ
77 #======================================================= # S3ʹը૾ΛΞοϓϩʔυ͢Δ #======================================================= client.upload_file( 'test-reports/current_page_screenshot.png', '{S3໊}', ‘{S3ͷύε໊}/screenshot.png' )
※ίʔυҰ෦ൈਮ
9.Slackʹߘ͢Δ Ұຕʹ·ͱΊͨํ͕ݟ͍͢ʂ
มߋޙ มߋલ ࠩ
80 diffؒҧ͍୳͠(αϙʔτ͖)
81 #====================================================== # ͕ࠩ͋Εfiles uploadAPIͰSlackʹ௨ #====================================================== def postMessageWithFiles(message, fileList, channel):
slack_client = slack_sdk.WebClient(token=SLACK_TOKEN) for file in fileList: upload = slack_client.files_upload(file=file, filename=file) message = message + ”<“ + upload['file']['permalink'] + "| >" outPut = slack_client.chat_postMessage( channel = channel, text = message ) #======================================================= # มߋΛݕͨ࣌͠ #======================================================= if np.array_equal(img_current, img_past): postMessageWithFiles( message = " `ίϩφຊϫΫνϯίϯςϯπͷࠩΛݕ͠·ͨ͠ʂ”, fileList = ['test-reports/summary.png'], channel = "{௨͍ͨ͠νϟϯωϧ໊}", ) ※ίʔυҰ෦ൈਮ
82 ※ίʔυҰ෦ൈਮ ͠ະདྷͰɺ ࠩΛݟ͍ͨϖʔδ͕ෳʹ૿͑ͨ࣌
83 ݁Ռͱ·ͱΊ 3
84 هऀ σβΠφʔ ΤϯδχΞ ศརͳΈΛ ͋Γ͕ͱ͏͍͟͝·͢ ໌Β͔ʹ͓͔͍͠Օॴ͕ͳ͍͔ ؆୯ʹผͰ͖Δͷ͋Γ͕͍ͨ σʔλͷܻʹΑͬͯϨΠΞτ͕ มΘΔཁૉ͕͋Δɻ
ҙਤ͍ͯ͠ͳ͍ϨΠΞτʹ ͳ͍ͬͯͳ͍͔͕ҰͰ͔Δͷ͕ ྑ͍ ಋೖޙͷ
85 هऀ σβΠφʔ ΤϯδχΞ ศརͳΈΛ ͋Γ͕ͱ͏͍͟͝·͢ ໌Β͔ʹ͓͔͍͠Օॴ͕ͳ͍͔ ؆୯ʹผͰ͖Δͷ͋Γ͕͍ͨ σʔλͷܻʹΑͬͯϨΠΞτ͕ มΘΔཁૉ͕͋Δɻ
ҙਤ͍ͯ͠ͳ͍ϨΠΞτʹ ͳ͍ͬͯͳ͍͔͕ҰͰ͔Δͷ͕ྑ͍ ಋೖޙͷ Ͱɾɾɾɾ ͩΜͩΜݟΒΕͳ͘ͳͬͯ͠·͏
86 هऀ σβΠφʔ ΤϯδχΞ ޕޙ̑࣌ఆظ࣮ߦ͡Όͳͯ͘ ग़͢લʹνΣοΫͰ͖ΔΑ͏ͳػߏ ͕Α͔ͬͨ վળϙΠϯτ
هऀνʔϜ σβΠφʔɾΤϯδχΞνʔϜ εϓϨουγʔτͰ ຖσʔλूܭˍνΣοΫ վम͕͋Δ߹ (JU)VCͰϦιʔεཧ $*ͰϦϦʔε ͜ͷ࣌Ͱެ։ͱಉ࣌ʹ -BNCEBΛىಈ ͞Βʹվળ͢ΔͳΒ
88 هऀ σβΠφʔ ΤϯδχΞ ผͷϒϥβϞόΠϧαΠζͳͲ ͍Ζ͍Ζͳը໘ύλʔϯͰ ݕূͰ͖ͨ΄͏͕҆৺ײ͕ߴ·Δɻ վળϙΠϯτ ίϯςϯπͷ্෦ͷจষ͕ มߋ͞Εͯɺߦ͕มΘͬͯ͠
·͏ͱϨΠΞτ͕ͯ͢Լʹ ͣΕͨͱݕग़͞ΕΔͱ͍͏߹ ͕͋Δɻ
هऀνʔϜ σβΠφʔɾΤϯδχΞνʔϜ εϓϨουγʔτͰ ຖσʔλूܭˍνΣοΫ վम͕͋Δ߹ (JU)VCͰϦιʔεཧ $*ͰϦϦʔε άϥϑͷը૾ͷݕग़͚ͩʹಛԽ ͞Βʹվળ͢ΔͳΒ
90 Pythonͷศར͞ Γ͍ͨ͜ͱʹରͯ͠ɺπʔϧ͕ἧ͍ͬͯͯ ेߦͰ͙͢ʹࢼ͢͜ͱ͕Ͱ͖Δշద͕͞࠷ߴ
91 هऀ σβΠφʔ ΤϯδχΞ ۀվળͷ໘ന͍ϙΠϯτ ͍͍ͭͬͯΔ ಉ͡ܗࣜ֬ೝ࡞ۀ ͍ͭͬͯΔ͚Ͳ ຊ൪Ͱຖ ֬ೝ͢Δ͔͠ͳ͍ͷ͔ͳʙ
92 هऀ σβΠφʔ ΤϯδχΞ ۀվળͷ໘ന͍ϙΠϯτ ͍͍ͭͬͯΔ ಉ͡ܗࣜ֬ೝ࡞ۀ ͍ͭͬͯΔ͚Ͳ ຊ൪Ͱຖ ֬ೝ͢Δ͔͠ͳ͍ͷ͔ͳʙ
ʮ͜͏ͳͬͨΒ͍͍ͷʹͳʙʯɺࠔ͍ͬͯΔຊਓ͔Β ϐϯϙΠϯτͰདྷͳ͍
93 هऀ σβΠφʔ ΤϯδχΞ ۀվળͷ໘ന͍ϙΠϯτ ͲΜͳײ͡Ͱ ࡞ۀ͍ͯ͠ΔΜͰ͔͢ʁʁ
94 هऀ σβΠφʔ ΤϯδχΞ ۀվળͷ໘ന͍ϙΠϯτ ͜Μͳखஈ͋Γ·͢Αʁ ͜͏ͨ͠Β͍͍͔ʁ ͦΜͳ͜ͱͰ͖Δͷʁʁʂʂ ศརʂͦΕ΄͍͠ʂ
95 ·ͱΊ νʔϜͷಇ͖ํΛ͞Βʹշదʹ͢ΔͨΊͷछ͕ ʑͷίϛϡχέʔγϣϯͷதʹ͋Δ͔ʁʂ
96 https://hack.nikkei.com/
97 ͋Γ͕ͱ͏͍͟͝·ͨ͠