xiami 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xiami/song.rb +3 -3
- data/lib/xiami/version.rb +1 -1
- data/spec/fixtures/1242697.xml +20 -0
- data/spec/xiami/song_spec.rb +7 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bfd07067befd7f5dca07468dfd2bab841e4b995
|
4
|
+
data.tar.gz: 112c294c591f5ba3da08f1f30613e1495bb53adf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d92585e0fdd4186a0747bbfe6e99b9bdbba6a53891904b48994fbe2649680c8c149ee647468f7cf92322546c5f8e82f158c038aba06a2a9e6eed5e9caab69c81
|
7
|
+
data.tar.gz: 1e85ea296dd6819a8130fa861e6c1d2185c87cc7c1f63980dc1b90a7b15548078d6f12699cda19cf19c371c3e3608f4761088b3c001df3abd70185771465f162
|
data/lib/xiami/song.rb
CHANGED
@@ -40,17 +40,17 @@ module Xiami
|
|
40
40
|
doc = Nokogiri::XML(info_xml)
|
41
41
|
|
42
42
|
@id = doc.at_css('track song_id').content
|
43
|
-
@name = doc.at_css('track song_name').content
|
43
|
+
@name = CGI.unescapeHTML(doc.at_css('track song_name').content)
|
44
44
|
|
45
45
|
@album = Album.new.tap do |album|
|
46
46
|
album.id = doc.at_css('track album_id').content
|
47
|
-
album.name = doc.at_css('track album_name').content
|
47
|
+
album.name = CGI.unescapeHTML(doc.at_css('track album_name').content)
|
48
48
|
album.cover_url = doc.at_css('track album_cover').content
|
49
49
|
end
|
50
50
|
|
51
51
|
@artist = Artist.new.tap do |artist|
|
52
52
|
artist.id = doc.at_css('track artist_id').content
|
53
|
-
artist.name = doc.at_css('track artist_name').content
|
53
|
+
artist.name = CGI.unescapeHTML(doc.at_css('track artist_name').content)
|
54
54
|
end
|
55
55
|
|
56
56
|
@temporary_url = sospa(doc.at_css('track location').content)
|
data/lib/xiami/version.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<trackList>
|
3
|
+
<config>
|
4
|
+
<copyright>1</copyright>
|
5
|
+
</config>
|
6
|
+
<track>
|
7
|
+
<width>257</width>
|
8
|
+
<height>33</height>
|
9
|
+
<song_name><![CDATA[Champagne Supernova]]></song_name>
|
10
|
+
<song_id>1242697</song_id>
|
11
|
+
<user_id>0</user_id>
|
12
|
+
<album_id>55723</album_id>
|
13
|
+
<album_cover><![CDATA[http://img.xiami.net/images/album/img1/10401/557231384238290_3.jpg]]></album_cover>
|
14
|
+
<album_name><![CDATA[(What's the Story) Morning Glory?]]></album_name>
|
15
|
+
<artist_id>10401</artist_id>
|
16
|
+
<artist_name><![CDATA[Oasis]]></artist_name>
|
17
|
+
<location><![CDATA[7h%5xo5%1246lFec%%f9155nt2.imE5%324.ayd553a4EEutFfa%1E2%6%mu%1EE6d14-lp%im2%4F295pt351ddf5%%l%2liF2%5F7E3hDde9687553Fe.4F551_3%_687e285EEAm.c%1E728_3kff29e-%%-]]></location>
|
18
|
+
<widgetCode><![CDATA[<embed src="http://www.xiami.com/widget/0_1242697/singlePlayer.swf" type="application/x-shockwave-flash" width="257" height="33" wmode="transparent"></embed>]]></widgetCode>
|
19
|
+
</track>
|
20
|
+
</trackList>
|
data/spec/xiami/song_spec.rb
CHANGED
@@ -37,6 +37,13 @@ module Xiami
|
|
37
37
|
|
38
38
|
song.album.id.should == '705574889'
|
39
39
|
end
|
40
|
+
|
41
|
+
context 'when html' do
|
42
|
+
it 'unescapes' do
|
43
|
+
song = Song.new(1242697)
|
44
|
+
song.album.name.should == "(What's the Story) Morning Glory?"
|
45
|
+
end
|
46
|
+
end
|
40
47
|
end
|
41
48
|
|
42
49
|
describe '#==' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xiami
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Forrest Ye
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- lib/xiami/artist.rb
|
56
56
|
- lib/xiami/song.rb
|
57
57
|
- lib/xiami/version.rb
|
58
|
+
- spec/fixtures/1242697.xml
|
58
59
|
- spec/fixtures/1773357685.xml
|
59
60
|
- spec/spec_helper.rb
|
60
61
|
- spec/xiami/album_spec.rb
|
@@ -86,6 +87,7 @@ signing_key:
|
|
86
87
|
specification_version: 4
|
87
88
|
summary: retrieve songs from http://xiami.com
|
88
89
|
test_files:
|
90
|
+
- spec/fixtures/1242697.xml
|
89
91
|
- spec/fixtures/1773357685.xml
|
90
92
|
- spec/spec_helper.rb
|
91
93
|
- spec/xiami/album_spec.rb
|