LyricFind 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/lyricfind.rb +3 -0
- data/lib/lyricfind/album.rb +13 -0
- data/lib/lyricfind/duration.rb +14 -0
- data/lib/lyricfind/get_snippet_by_song_name.rb +14 -0
- data/lib/lyricfind/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 394a1b69e759c034601bc5e11504fb8b323c84ca
|
4
|
+
data.tar.gz: 87f8ea293c44d6ec1b43e0df8d9e94ad65a76966
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: affa41b89722d4c1bd63924601624b36c4e554737d3a5c39f2b6177d942cb392f89394f77dc61fa661ad51c5938e7d23766970fbb00fe58089e4b9903ec02985
|
7
|
+
data.tar.gz: 1e6c4b9d5536f0839b4b79bbfd555c1a77ce0debdb53ff9fd8c19e5568d41ceca8b8c48edf656a29f410f10721f3f97fc678365fc636c20a5b18909855f73aea
|
data/Gemfile.lock
CHANGED
data/lib/lyricfind.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
require 'nokogiri'
|
3
|
+
|
4
|
+
module LyricFind
|
5
|
+
class API
|
6
|
+
def album artist, song_name
|
7
|
+
doc = get_search_api_response artist, song_name
|
8
|
+
return nil if doc.nil?
|
9
|
+
|
10
|
+
doc.xpath('//album')[0].content.gsub("\r\n", '').strip
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
require 'nokogiri'
|
3
|
+
|
4
|
+
module LyricFind
|
5
|
+
class API
|
6
|
+
def duration artist, song_name
|
7
|
+
doc = get_search_api_response artist, song_name
|
8
|
+
return nil if doc.nil?
|
9
|
+
|
10
|
+
return doc.xpath('//tracks/track')[0]['duration']
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
require 'nokogiri'
|
3
|
+
|
4
|
+
module LyricFind
|
5
|
+
class API
|
6
|
+
def get_snippet_by_song_name artist, song_name
|
7
|
+
doc = get_search_api_response artist, song_name
|
8
|
+
return nil if doc.nil?
|
9
|
+
|
10
|
+
return doc.xpath('//snippet')[0].content.gsub("\r\n",'').strip
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/lyricfind/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: LyricFind
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Itamar Hassin
|
@@ -126,7 +126,10 @@ files:
|
|
126
126
|
- bin/console
|
127
127
|
- bin/setup
|
128
128
|
- lib/lyricfind.rb
|
129
|
+
- lib/lyricfind/album.rb
|
130
|
+
- lib/lyricfind/duration.rb
|
129
131
|
- lib/lyricfind/get_lyrics_by_song_name.rb
|
132
|
+
- lib/lyricfind/get_snippet_by_song_name.rb
|
130
133
|
- lib/lyricfind/instrumental.rb
|
131
134
|
- lib/lyricfind/version.rb
|
132
135
|
- lyricfind.gemspec
|