DEVELOPER-833 update video structured data #41

Merged
merged 1 commit into from Aug 5, 2014

2 participants

@pmuir
awestruct member

No description provided.

@LightGuard LightGuard commented on the diff Jul 23, 2014
lib/aweplug/helpers/vimeo.rb
@@ -240,6 +240,19 @@ def duration_in_seconds
(a.length > 0 ? a[0].to_i : 0) + (a.length > 1 ? a[1].to_i * 60 : 0) + (a.length > 2 ? a[2].to_i * 60 : 0)
end
+ def duration_iso8601
+ t = Integer @video["duration"]
+ Time.at(t).utc.strftime("PT%HH%MM%SS")
@LightGuard
awestruct member

There's a Time#iso8601(number_of_nanoseconds_to_display) but it also includes the offset, which you're not showing here, so not sure if you care.

@pmuir
awestruct member
pmuir added a note Jul 23, 2014

Oh that would have been easier. I can try that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@LightGuard
awestruct member

@pmuir are you going to try that change?

@pmuir
awestruct member

@LightGuard I can't see a method Time#iso8601 Where is it documented?

@pmuir
awestruct member

I guess you are referring to Date#iso8601 which formats a date using iso8601. I need to format a duration, which AFAIK Ruby doesn't offer.

http://www.ruby-doc.org/stdlib-2.1.2/libdoc/date/rdoc/Date.html#method-i-iso8601

@LightGuard
awestruct member
@pmuir
awestruct member

I did try it. It behaves the same as Date#iso8601, hence my comment.

@LightGuard
awestruct member
@pmuir
awestruct member
@LightGuard LightGuard merged commit 1ce581a into awestruct:master Aug 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment