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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7bc4899719b5debb44bf95bae219579c6d376af
4
- data.tar.gz: d6efa0a450b027240341441d599e2f09d590e2de
3
+ metadata.gz: 7bfd07067befd7f5dca07468dfd2bab841e4b995
4
+ data.tar.gz: 112c294c591f5ba3da08f1f30613e1495bb53adf
5
5
  SHA512:
6
- metadata.gz: 8f0b0fe4a387b7976d169072fa9e127f3ab46a3ce1b565bbdef829d796bcf329a22b660d455ac83ed7ab17b3ea4fcb9b464adbe53bbc43cbff4664e249668a0e
7
- data.tar.gz: 9d54cb7026b236ae59d85690ebe419028ec119f3b3671cc507ec9b79c4b86f05017408436834e945de908813cd32b6d3db78088fa548b761c0fb8b6f0d911b8f
6
+ metadata.gz: d92585e0fdd4186a0747bbfe6e99b9bdbba6a53891904b48994fbe2649680c8c149ee647468f7cf92322546c5f8e82f158c038aba06a2a9e6eed5e9caab69c81
7
+ data.tar.gz: 1e85ea296dd6819a8130fa861e6c1d2185c87cc7c1f63980dc1b90a7b15548078d6f12699cda19cf19c371c3e3608f4761088b3c001df3abd70185771465f162
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Xiami
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -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&#039;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>
@@ -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
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-05 00:00:00.000000000 Z
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