-
-
Notifications
You must be signed in to change notification settings - Fork 108
RSSフィード作成 #387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RSSフィード作成 #387
Changes from 4 commits
a6942b6
620ccac
eb00c31
0e54ed1
0053ba5
a378348
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
xml.instruct! :xml, :version => "1.0" | ||
xml.rss :version => "2.0", "xmlns:itunes" => "http://www.itunes.com/dtds/Podcast-1.0.dtd" do | ||
xml.channel do | ||
xml.title full_title "" | ||
xml.description full_description "" | ||
xml.link root_url | ||
xml.author @author | ||
xml.copyright "Copyright © 2012-2018 一般社団法人 CoderDojo Japan" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
xml.language "ja" | ||
xml.itunes :category, :text => "Technology" do | ||
xml.itunes :category, :text => "Software How-To" | ||
xml.itunes :category, :text => "Podcasting" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. サブカテゴリの追加の仕方ってこれであってるのかな 🤔💭 ちょっと確認してみよ 👀 💨
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. まぁひとまず検証してどんなデータが出てくるか試してみるのが早そうかな ✅ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
end | ||
xml.itunes :type, "serial" | ||
xml.itunes :explicit, "clean" | ||
|
||
@episodes.each do |episode| | ||
xml.item do | ||
xml.title episode.title | ||
xml.author @author | ||
xml.description episode.description | ||
xml.link @domainname + episode.url | ||
xml.guid({:isPermaLink => "false"}, @domainname + episode.url) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. String Interpolationを使いたいと思いました。 |
||
xml.itunes :explicit, "clean" | ||
xml.pubDate episode.published_at.rfc2822 | ||
xml.enclosure({:url => @domainname + episode.url + ".mp3", :length => episode.filesize, :type => "audio/mpeg"}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. String Interpolationを使いたいと思いました。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
xml.itunes :duration, episode.duration | ||
end | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
キャメルケースよりスネークケースの方がrubyっぽいと思いました。
s/@pubDate/@published_at/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「2行目に収録日が記載されている」というのは仕様になっている感じでしょうか?
仕様がわからなかったのでご存知なら教えてください。
仕様じゃないケースがあるかもという想定を考慮に入れると
収録日:
で始まる行を探して、それ以降の文字列を切り抜く、という感じかなと思いました。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こちらは Issue に切り出しました ✂️
#407