Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Androidでスクレイピングした話 / Talk of scraping with Android
futabooo
February 01, 2018
Technology
0
4.6k
Androidでスクレイピングした話 / Talk of scraping with Android
futabooo
February 01, 2018
Tweet
Share
More Decks by futabooo
See All by futabooo
Android Jetpack Navigation Deep Links Tips
futaboooo
0
420
チームの学びを活かす全社での取り組み / company wide efforts to make use of team's learning
futaboooo
1
480
ペアプロ・モブプロを広めるのに役立ったControl Chartの使い方 / How to use Control Chart which helped spread Pair or Mob Programing
futaboooo
2
210
スクラムチームをやめて、20人でカンバン運用してきた半年間の軌跡 / Stop Scrum Start Kanban
futaboooo
19
17k
InvisionのAndroidアプリでみる4つのデザイン基本原則 / Four design basic principles seen in Invision's Android application
futaboooo
2
1.9k
Pairsの開発のすべて / all of Pairs development
futaboooo
1
2.1k
モブプログラミングという開発スタイル、あるいは生産性について / On development style called mob programming, or productivity
futaboooo
5
7.8k
新人スクラムマスターが開発者と兼任しながらやってきた事と成果/What the newcomer Scrum Master came while concurrently serving as a developer and the result
futaboooo
1
1.6k
What I did for Google IO since then
futaboooo
1
250
Other Decks in Technology
See All in Technology
もし本番ネットワークをまるごと仮想環境に”コピー”できたらうれしいですか? / janog51
corestate55
0
400
Periodic Multi-Agent Path Planning
hziwara
0
160
CES_2023_FleetWise_demo.pdf
sparkgene
0
130
あつめたデータをどう扱うか
skrb
2
180
01_ユーザーリサーチ実施の進め方
kouzoukaikaku
0
900
AI Services 概要 / AI Services overview
oracle4engineer
PRO
0
180
インフラ技術基礎勉強会 開催概要
toru_kubota
0
190
S3とCloudWatch Logsの見直しから始めるコスト削減 / Cost saving S3 and CloudWatch Logs
shonansurvivors
0
280
機械学習を実用化するエンジニアリングスキル
shibuiwilliam
3
220
Hatena Engineer Seminar #23 「チームとプロダクトを育てる Mackerel 開発合宿」
arthur1
0
660
OpenShiftでスポットVMを使おう.pdf
jpishikawa
1
420
ECテックカンファレンス2023 EC事業部のモバイル開発2023
tatsumi0000
0
350
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
87
12k
5 minutes of I Can Smell Your CMS
philhawksworth
198
18k
In The Pink: A Labor of Love
frogandcode
132
21k
Navigating Team Friction
lara
177
12k
From Idea to $5000 a Month in 5 Months
shpigford
374
44k
GraphQLの誤解/rethinking-graphql
sonatard
39
7.8k
Designing for humans not robots
tammielis
245
24k
Teambox: Starting and Learning
jrom
124
7.9k
Web Components: a chance to create the future
zenorocha
304
40k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
349
27k
The Language of Interfaces
destraynor
149
21k
Code Review Best Practice
trishagee
50
11k
Transcript
@futabooo Connehito Marché #1ʙAndroidࢢʙ #ConnehitoMarche AndroidͰεΫϨΠϐϯάͨ͠
2 About me 4FOJPS&OHJOFFS4DSVN.BTUFSBUFVSFLB *OD +BWB ,PUMJO (PMBOH
5ZQF4DSJQU "OHVMBS+4 'BOUBTZ&BSUI;FSP T$3:FE 4QMBUPPO GVUBCPPP ɹɹɹೋ ོߒʢTakahiro Futagawaʣ
3 About eureka ैۀһ ໊ʢฏۉྸࡀʣ ࣄۀ༰
ࣗࣾαʔϏεاըɾ։ൃɾӡӦ 1BJST $PVQMFT ձࣾ֓ཁ
4 About eureka
ࠓͷ
https://droidkaigi.jp/2018/proposals
Έͳ͞ΜຊΛಡΜͩ͋ͱͲ͏͠·͔͢ʁ
ಡΜͩ༰Λه͓͖ͯͨ͘͠ͳΓ·ͤΜ͔ʁ
https://bookmeter.com/
10 ಡॻϝʔλʔ ಡΜͩຊΛײͱͱʹهͰ͖Δ ಡΜͩྔΛཧ͢Δ͜ͱ͕Ͱ͖Δ
AndroidΞϓϦ͕ͳ͍
ͳ͚Εͭ͘Ε͍͍
࡞ͬͨ
࣮ͷհ
15 ࣮ͷհ KIZKTPVQ +BWB)5.-1BSTFS XJUICFTUPG%0. $44 BOEKRVFSZ
ϩάΠϯը໘
interface LoginService { @GET("/login") fun get(): Observable<ResponseBody> @FormUrlEncoded @POST("/login") fun
login( @Field("session[email_address]") mail: String, @Field("session[password]") password: String, @Field("authenticity_token") authenticityToken: String): Observable<ResponseBody> }
retrofit.create(LoginService::class.java).get() .flatMap { val reader = BufferedReader(InputStreamReader(it.byteStream())) val result =
reader.readLines().filter(String::isNotBlank).toList() val token = Jsoup.parse(result.toString()) .select("form input[name=authenticity_token]").attr("value") } .subscribeBy( onNext = { val reader = BufferedReader(InputStreamReader(it.byteStream())) val result = reader.readLines().filter(String::isNotBlank).toList() val alert = Jsoup.parse(result.toString()) .select(“div.container li.bm-flash-item—alert").isNotEmpty() if (alert) { Timber.i("E-mail or Password is wrong") contract.failureLogin()
[email protected]
} }, onError = { Timber.e(it, it.message) } )
ར༻ͨ͠πʔϧ
postman, Charles, Chrome dev tool
ϋϚͬͨͱ͜Ζ
ಥવͷ༷มߋ❗
23 ಥવͷ༷มߋ ظٳΈ໌͚ʹΞϓϦʹϩάΠϯͰ͖ͳ͘ͳͬͨ ৽͍͠ηΩϡϦςΟରࡦͰ3FRVFTUʹ5PLFO͕ඞཁʹͳ͍ͬͯͨ εΫϨΠϐϯάͳͷͰͳΤϥʔ͕ฦ͞ΕΔΘ͚Ͱͳ͍ ௐࠪʹ̍ि͔͚ؒͯमਖ਼
·ͱΊ
25 ·ͱΊ "OESPJEΞϓϦ͕ແ͍͚Ͳ͍͍ͨαʔϏε͕͋ͬͨΒ࡞ͬͪΌ͑ྑ͍ ͱ͍͑εΫϨΠϐϯάಥવͷ༷มߋͰ͙͢ࢮ͵ ΞϓϦͷίʔυHJUIVCެ։ͯ͠·͢ GVUBCPPP#PPL-JGF
Credit: NASA Earth Observatory/NOAA NGDC Thank you :)