-
Notifications
You must be signed in to change notification settings - Fork 3
Added flattr to the feed #17
base: master
Are you sure you want to change the base?
Conversation
Cool thing! I'll think about what we can do to make |
@@ -86,6 +88,10 @@ def rfc_2822_date | |||
self.published_at.rfc2822 | |||
end | |||
|
|||
def flattr_auto_submit_link | |||
"https://flattr.com/submit/auto?user_id=#{podcast.flattr["user_id"]}&url=#{CGI.escape podcast.deep_link_url(self)}&title=#{CGI.escape self.title}&description=#{CGI.escape Sanitize.clean(self.subtitle)}&language=#{podcast.flattr["language"]}&tags=#{podcast.flattr["tags"].join(',')}&category=#{podcast.flattr["category"]}" |
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.
If I see this correctly, this is almost the same as in Podcast#flattr_auto_submit_link
. Maybe we can factor this out into a helper, or something. I'm thinking about including ActiveSupport to get Hash#to_param
to make this readable.
Well, it's a string with 7 params... So tje duplication isn't hurting so much in my eyes. But moving this out to a new class is fine with me as well... I can extract this out tomorrow when I add the tests |
I removed the duplication and added the tests ... Any ideas about the deep link thingy? I have fixed it in my fork for our urls but I think forking the kitchen is not the way to go |
Just noticed... We can remove the sanitize gem... I'll do that later |
This adds flattr to the feed ... The necessary infos for the auto URL stuff need to be added to the
podcast.yml
Still to do
Podcast
andEpisode
Podcast#deep_link_url
since it only handles GST-Kitchen URLs (@tisba, please let's talk about this)