Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
2 週間で Twitter Bot を作ってみた
Search
Daisuke Garaike
April 23, 2024
Programming
1.3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
440
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
930
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
780
立川で超かぐや姫!について話したい / Talking Cosmic Princess Kaguya! in Tachikawa
contour_gara
1
490
AR グラス + ミニ PC で実現する新しいモバイル環境
contour_gara
0
410
TDD 実践ミニトーク
contour_gara
1
440
Spring Boot と AWS S3 を使ったアプリケーションのテスト
contour_gara
0
170
ノート PC に Linux 入れてみたけど結構良かった
contour_gara
0
3.7k
JUnit5 から Kotest へ
contour_gara
0
220
Other Decks in Programming
See All in Programming
Jetpack Compose Mechanisms
skydoves
2
710
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
160
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
400
The Rails Doctrine Decade
koic
2
560
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
150
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
8
5.7k
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
130
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
190
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
200
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
490
setup-vp GitLab対応の裏側
naokihaba
0
160
Featured
See All Featured
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Producing Creativity
orderedlist
PRO
348
41k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Building Applications with DynamoDB
mza
96
7.2k
Product Roadmaps are Hard
iamctodd
55
13k
The Limits of Empathy - UXLibs8
cassininazir
2
710
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Odyssey Design
rkendrick25
PRO
2
870
Fireside Chat
paigeccino
43
4.1k
ラッコキーワード サービス紹介資料
rakko
1
5.3M
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
770
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 をするというケツを設定することで、 なんとか作りきることができた。 技術選定で悩み、諦めたことを挑戦していきたい。 ライブラリをフォークして、テストしやすくしたい。 自分というユーザーがいる プロダクトを大切に開発を続けたい