Skip to content

Instantly share code, notes, and snippets.

@cv
Created December 12, 2008 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cv/35128 to your computer and use it in GitHub Desktop.
Save cv/35128 to your computer and use it in GitHub Desktop.
WHAT THE FUCK!?
>> puts x
<?xml version="1.0" encoding="UTF-8"?>
<video>
<id>728800</id>
<created-at>Fri Dec 12 14:05:58 +0100 2008</created-at>
<updated-at>Fri Dec 12 14:05:58 +0100 2008</updated-at>
<title>288</title>
<specs>
<thumb>http://raw-1.heywatch.com/thumbs/Ol0uB23CQk/CGI.18355.0.jpg</thumb>
<video width="1000" length="289" codec="mpeg4" height="546" aspect="1.83" bitrate="2063" container="avi" fps="25.0" stream="0.0"/>
<audio sample_rate="44100" codec="mp3" bitrate="128" channels="2" stream="0.1"/>
<size>72797</size>
<mime-type>video/x-msvideo</mime-type>
</specs>
</video>
=> nil
>>
>> XmlSimple.xml_in x, 'ForceArray' => false
=> {"specs"=>{"audio"=>{"sample_rate"=>"44100", "stream"=>"0.1", "codec"=>"mp3", "bitrate"=>"128", "channels"=>"2"}, "mime-type"=>"video/x-msvideo", "size"=>"72797", "thumb"=>"http://raw-1.heywatch.com/thumbs/Ol0uB23CQk/CGI.18355.0.jpg", "video"=>{"container"=>"avi", "aspect"=>"1.83", "stream"=>"0.0", "codec"=>"mpeg4", "bitrate"=>"2063", "length"=>"289", "height"=>"546", "fps"=>"25.0", "width"=>"1000"}}, "title"=>"288", "created-at"=>"Fri Dec 12 14:05:58 +0100 2008", "updated-at"=>"Fri Dec 12 14:05:58 +0100 2008", "id"=>"728800"}
>> y _
---
specs:
audio:
sample_rate: "44100"
stream: "0.1"
codec: mp3
bitrate: "128"
channels: "2"
mime-type: video/x-msvideo
size: "72797"
thumb: http://raw-1.heywatch.com/thumbs/Ol0uB23CQk/CGI.18355.0.jpg
video:
container: avi
aspect: "1.83"
stream: "0.0"
codec: mpeg4
bitrate: "2063"
length: "289"
height: "546"
fps: "25.0"
width: "1000"
title: "288"
created-at: Fri Dec 12 14:05:58 +0100 2008
updated-at: Fri Dec 12 14:05:58 +0100 2008
id: "728800"
=> nil
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment