CoderDojo Japan の PR TIMES RSS フィードを News セクションに登録 #1762
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
概要
CoderDojo Japan の PR TIMES 公式 RSS フィードをニュース取得システムに追加しました。これにより、PR TIMES で配信されるプレスリリースが自動的にトップページのニュースセクション(「最近の CoderDojo」)に表示されるようになります。
実装内容
1. RSS フィード統合
https://prtimes.jp/companyrdf.php?company_id=38935PR_TIMES_FEEDとして定義RSS_FEED_LISTに既存の CoderDojo News フィードと共に追加2. RSS 形式の互換性対応
PR TIMES と CoderDojo News で異なる RSS 形式を使用しているため、両方に対応:
dc:date<rdf:RDF>pubDate<rss version="2.0">実装:
3. 日付形式の統一
published_atを ISO 8601 形式に統一(例:2025-10-24T20:00:07+09:00).iso8601メソッドで変換4. Fail-Fast 原則の適用
実施したステップ
PR_TIMES_FEEDに統一bundle exec rake news:fetchを実行今後の予定
このPRで(マージ時)
将来の改善(別PR)
?paged=2パラメータ)動作の仕組み
news:fetchタスクを実行db/news.ymlに保存後、news:upsertタスクでデータベースに同期テスト環境での動作
テスト環境および staging 環境では、従来通り
spec/fixtures/sample_news.rssを使用するため、既存のテストには影響ありません。参考情報