cho45 (owner)

Revisions

gist: 151319 Download_button fork
public
Public Clone URL: git://gist.github.com/151319.git
Embed All Files: show embed
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require "open-uri"
require "stringio"
 
def parse_daap(str)
ret = []
io = StringIO.new(str)
until io.eof?
tag = io.read(4)
size = io.read(4).unpack("N")[0]
data = io.read(size)
ret << [tag, size, data]
end
ret
end
 
info = open("http://daap.lab.lowreal.net/server-info").read
p parse_daap(info)