xiami 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +4 -0
- data/Gemfile +2 -0
- data/README.md +4 -0
- data/lib/xiami/song.rb +12 -0
- data/lib/xiami/version.rb +1 -1
- data/spec/fixtures/1773357685.xml +20 -0
- data/spec/spec_helper.rb +6 -0
- data/spec/xiami/song_spec.rb +19 -10
- metadata +4 -3
- data/spec/fixtures/3495768.xml +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7bc4899719b5debb44bf95bae219579c6d376af
|
4
|
+
data.tar.gz: d6efa0a450b027240341441d599e2f09d590e2de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f0b0fe4a387b7976d169072fa9e127f3ab46a3ce1b565bbdef829d796bcf329a22b660d455ac83ed7ab17b3ea4fcb9b464adbe53bbc43cbff4664e249668a0e
|
7
|
+
data.tar.gz: 9d54cb7026b236ae59d85690ebe419028ec119f3b3671cc507ec9b79c4b86f05017408436834e945de908813cd32b6d3db78088fa548b761c0fb8b6f0d911b8f
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
1
|
# xiami gem
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/forresty/xiami.svg)](https://travis-ci.org/forresty/xiami)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/forresty/xiami/badges/gpa.svg)](https://codeclimate.com/github/forresty/xiami)
|
5
|
+
[![Coverage Status](https://coveralls.io/repos/forresty/xiami/badge.png)](https://coveralls.io/r/forresty/xiami)
|
6
|
+
|
3
7
|
retrieve songs from xiami.com
|
data/lib/xiami/song.rb
CHANGED
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[Escape (The Pina Colada Song)]]></song_name>
|
10
|
+
<song_id>1773357685</song_id>
|
11
|
+
<user_id>0</user_id>
|
12
|
+
<album_id>705574889</album_id>
|
13
|
+
<album_cover><![CDATA[http://img.xiami.net/images/album/img16/37516/7055748891405574890_3.jpg]]></album_cover>
|
14
|
+
<album_name><![CDATA[Guardians of the Galaxy]]></album_name>
|
15
|
+
<artist_id>37516</artist_id>
|
16
|
+
<artist_name><![CDATA[Rupert Holmes]]></artist_name>
|
17
|
+
<location><![CDATA[6hAFlm%%1%4F513.Fk38ffda5EEnt%mei226581758mae38a44d2%-ut25..FF%E87663puyb3985-35%lpF.xc5325978%83t%7aee612E5l%%fio17F5%355_%h38295e4%%E32iam657723_El3_D3fddb155-]]></location>
|
18
|
+
<widgetCode><![CDATA[<embed src="http://www.xiami.com/widget/0_1773357685/singlePlayer.swf" type="application/x-shockwave-flash" width="257" height="33" wmode="transparent"></embed>]]></widgetCode>
|
19
|
+
</track>
|
20
|
+
</trackList>
|
data/spec/spec_helper.rb
CHANGED
data/spec/xiami/song_spec.rb
CHANGED
@@ -9,24 +9,33 @@ module Xiami
|
|
9
9
|
it { should respond_to :local_file_path }
|
10
10
|
it { should respond_to :local_file_path= }
|
11
11
|
|
12
|
+
it { should respond_to :title }
|
13
|
+
it { should respond_to :artist_name }
|
14
|
+
it { should respond_to :album_name }
|
15
|
+
|
12
16
|
describe '#new' do
|
13
17
|
it 'parses data' do
|
14
|
-
song = Song.new('http://www.xiami.com/song/
|
18
|
+
song = Song.new('http://www.xiami.com/song/1773357685')
|
19
|
+
|
20
|
+
song.temporary_url.should == 'http://m5.file.xiami.com/516/37516/705574889/1773357685_15603838_l.mp3?auth_key=33b783883a2ffa9e9df48e5dd456ebad-1415232000-0-null'
|
15
21
|
|
16
|
-
song.
|
22
|
+
song.name.should == 'Escape (The Pina Colada Song)'
|
23
|
+
song.title.should == 'Escape (The Pina Colada Song)'
|
24
|
+
song.artist_name.should == 'Rupert Holmes'
|
25
|
+
song.album_name.should == 'Guardians of the Galaxy'
|
17
26
|
|
18
|
-
song.album.id.should == '
|
19
|
-
song.album.name.should == '
|
20
|
-
song.album.cover_url.should == 'http://img.xiami.net/images/album/
|
27
|
+
song.album.id.should == '705574889'
|
28
|
+
song.album.name.should == 'Guardians of the Galaxy'
|
29
|
+
song.album.cover_url.should == 'http://img.xiami.net/images/album/img16/37516/7055748891405574890_3.jpg'
|
21
30
|
|
22
|
-
song.artist.id.should == '
|
23
|
-
song.artist.name.should == '
|
31
|
+
song.artist.id.should == '37516'
|
32
|
+
song.artist.name.should == 'Rupert Holmes'
|
24
33
|
end
|
25
34
|
|
26
|
-
it 'accepts song id' do
|
27
|
-
song = Song.new('
|
35
|
+
it 'accepts song id as well' do
|
36
|
+
song = Song.new('1773357685')
|
28
37
|
|
29
|
-
song.album.id.should == '
|
38
|
+
song.album.id.should == '705574889'
|
30
39
|
end
|
31
40
|
end
|
32
41
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Forrest Ye
|
@@ -46,6 +46,7 @@ extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
48
|
- .gitignore
|
49
|
+
- .travis.yml
|
49
50
|
- Gemfile
|
50
51
|
- README.md
|
51
52
|
- Rakefile
|
@@ -54,7 +55,7 @@ files:
|
|
54
55
|
- lib/xiami/artist.rb
|
55
56
|
- lib/xiami/song.rb
|
56
57
|
- lib/xiami/version.rb
|
57
|
-
- spec/fixtures/
|
58
|
+
- spec/fixtures/1773357685.xml
|
58
59
|
- spec/spec_helper.rb
|
59
60
|
- spec/xiami/album_spec.rb
|
60
61
|
- spec/xiami/artist_spec.rb
|
@@ -85,7 +86,7 @@ signing_key:
|
|
85
86
|
specification_version: 4
|
86
87
|
summary: retrieve songs from http://xiami.com
|
87
88
|
test_files:
|
88
|
-
- spec/fixtures/
|
89
|
+
- spec/fixtures/1773357685.xml
|
89
90
|
- spec/spec_helper.rb
|
90
91
|
- spec/xiami/album_spec.rb
|
91
92
|
- spec/xiami/artist_spec.rb
|
data/spec/fixtures/3495768.xml
DELETED
@@ -1,21 +0,0 @@
|
|
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[J에게]]></song_name>
|
10
|
-
<song_id>3495768</song_id>
|
11
|
-
<user_id>0</user_id>
|
12
|
-
<album_id>315098</album_id>
|
13
|
-
<album_cover><![CDATA[http://img.xiami.net/images/album/img4/5104/3150981231826033_3.jpg]]></album_cover>
|
14
|
-
<album_name><![CDATA[My Life + Best]]></album_name>
|
15
|
-
<artist_id>5104</artist_id>
|
16
|
-
<artist_name><![CDATA[이선희]]></artist_name>
|
17
|
-
<location><![CDATA[4h%2Ff.moFEF5259F5_E3l3a_%b5543d8aEa14E--lt3Fmixim145EF%837174.%uk34E254a%9b-44%%ntA%5li.%%%1435%46%21m3teD7ac7eb5%814%55up%2.eac252%%1E29859_pFhy4%6429bE5b455EEl]]></location>
|
18
|
-
|
19
|
-
<widgetCode><![CDATA[<embed src="http://www.xiami.com/widget/0_3495768/singlePlayer.swf" type="application/x-shockwave-flash" width="257" height="33" wmode="transparent"></embed>]]></widgetCode>
|
20
|
-
</track>
|
21
|
-
</trackList>
|