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
2 週間で Twitter Bot を作ってみた
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Daisuke Garaike
April 23, 2024
Programming
1.3k
0
Share
2 週間で Twitter Bot を作ってみた
"TechBrew in 東京〜業務外で取り組む 個人開発での学び〜" での LT で用いたスライド。
https://findy.connpass.com/event/313271/
Daisuke Garaike
April 23, 2024
More Decks by Daisuke Garaike
See All by Daisuke Garaike
AR グラス + ミニ PC で実現する新しいモバイル環境
contour_gara
0
290
TDD 実践ミニトーク
contour_gara
1
400
Spring Boot と AWS S3 を使ったアプリケーションのテスト
contour_gara
0
120
ノート PC に Linux 入れてみたけど結構良かった
contour_gara
0
3.4k
JUnit5 から Kotest へ
contour_gara
0
200
社外での学びを社内に還元したい
contour_gara
1
530
Database Rider を用いたデータベーステスト
contour_gara
0
460
Other Decks in Programming
See All in Programming
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
550
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.3k
Spec Driven Development: The End Of Vibe Coding | DevLand 2026
danielsogl
PRO
0
110
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
440
Nuxt Server Components
wattanx
0
250
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
170
実践CRDT
tamadeveloper
0
250
感情を設計する
ichimichi
5
1.2k
The free-lunch guide to idea circularity
hollycummins
0
420
Migration to Signals, Signal Forms, Resource API, and NgRx Signal Store @Angular Days 03/2026 Munich
manfredsteyer
PRO
0
240
実践ハーネスエンジニアリング #MOSHTech
kajitack
7
5.9k
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
320
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
For a Future-Friendly Web
brad_frost
183
10k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
Building Adaptive Systems
keathley
44
3k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
340
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
260
Making the Leap to Tech Lead
cromwellryan
135
9.8k
Transcript
2 週間で Twitter Bot を作ってみた 2024-04-23 TechBrew in 東京 Daisuke
Garaike
自己紹介 gara Twitter: @contour_gara GitHub: contour-gara 大学院では大気海洋相互作用の研究 Python, Fortran 23
年に新卒で入社 Java でサーバーサイドの開発 業務外では Kotlin
写真を毎日投稿してくれる Bot 写真が趣味なので、 毎日写真を投稿したい。 投稿時間、文章は毎回同じなのに、 毎回設定するのは面倒。 決まった所に写真を置いておけば 投稿してくれる Bot があると助かる。
https://github.com/contour-gara/ gara-photo-spring-boot
実は...... Python で自動化コードを書いたものが動かなくなった。 https://x.com/XDevelopers/status/1641222782594990080 だらだら書くコーディングスタイルだったため、 リファクタリングできなかった。
技術選定で悩んだ • Kotlin • ライブラリに依存しない設計 • バージョン管理、自動化、テスト • Spring Boot,
Ktor • Mybatis, Expose • Docker, Kubernates 素早い価値提供 (LT) のためにも、 左の慣れている技術を採用した 必ずやりたかったこと 諦めたこと
アーキテクチャ? • 手続き型の書き方でスクリプトを書く • 決められた Path に写真を置いておく • cron で定時にプログラムを実行
これまで これから • オブジェクト指向で保守性の高いアプリケーション開発 • 自宅のサーバーでコンテナを起動 • Dropbox に写真を置いておく • cron で定時に Dropbox のファイルをコピー • cron で定時に API を叩く https://little-hands.hatenablog.com/entry/2 018/12/10/ddd-architecture
2 週間 → 2 日間 土日はサボってしまう。 テストで悩んでしまう。 https://github.com/contour-gara/gara- photo-spring-boot/commits/main/ 動くプロダクトを作るために
LT に申し込んだ。 旅行 検証 モデリング 資料 作成 クライアントの テストどうするん? 開発 開発 申込
Twitter クライアントのテスト Twitter4J と twitter4j-v2 を使用 https://github.com/Twitter4J/Twitter4J https://github.com/takke/twitter4j-v2 適切なリクエストと適切なレスポンスがある以上、 テストすべきではないだろうか?
ライブラリ API End Point Twitter4J: 変更可能 → モック可能 v2: ハードコーディング 既存のドメインに対してのリクエストを テストする方法はあるのだろうか...... リクエスト レスポンス
まとめと今後 2 週間後に LT をするというケツを設定することで、 なんとか作りきることができた。 技術選定で悩み、諦めたことを挑戦していきたい。 ライブラリをフォークして、テストしやすくしたい。 自分というユーザーがいる プロダクトを大切に開発を続けたい