Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 115 lines (84 sloc) 3.437 kb
9f1f2c5 @pilu updated gemspec
authored
1 = Musix Match
a109863 @pilu added README
authored
2
512a307 @pilu updated README
authored
3 _ _
4 | | _ _ | |
5 | | | | | | | |
6 | | _ _ | | | | _ _ | |
8b1a406 @pilu typo on README
authored
7 | || || || | MusixMatch is a wrapper for the musixmatch.com API's. | || || || |
512a307 @pilu updated README
authored
8 | || || || | With this library you can search for lyrics and tracks | || || || |
9f1f2c5 @pilu updated gemspec
authored
9 | | || || | using the http://musixmatch.com service. | | || || |
512a307 @pilu updated README
authored
10 | | | |
11 | | | |
12 \ / \ /
13 ---------- ----------
a109863 @pilu added README
authored
14
9f1f2c5 @pilu updated gemspec
authored
15 == Installation
a109863 @pilu added README
authored
16
9f1f2c5 @pilu updated gemspec
authored
17 gem install musix_match
a109863 @pilu added README
authored
18
9f1f2c5 @pilu updated gemspec
authored
19 == Usage
a109863 @pilu added README
authored
20
9f1f2c5 @pilu updated gemspec
authored
21 require 'musix_match'
a109863 @pilu added README
authored
22
9f1f2c5 @pilu updated gemspec
authored
23 MusixMatch::API::Base.api_key = 'YOUR_API_KEY'
a109863 @pilu added README
authored
24
9f1f2c5 @pilu updated gemspec
authored
25 === Track search
a109863 @pilu added README
authored
26
9f1f2c5 @pilu updated gemspec
authored
27 response = MusixMatch.search_track(:q_artist => 'Pantera')
28 if response.status_code == 200
29 response.each do |track|
30 puts "#{track.track_id}: #{track.track_name} (#{track.artist_name})"
a109863 @pilu added README
authored
31 end
9f1f2c5 @pilu updated gemspec
authored
32 end
9ca67a2 @pilu removed deprecated API methods
authored
33
c5b899f @pilu it always uses JSON as format
authored
34 Available options for the search_track methods are:
35
36 * q: a string that will be searched in every data field
37 * q_track: string to be searched among tracks titles
38 * q_artist: string to be searched among artists names
39 * page: requested page of results
40 * page_size: desired number of items per result page
41 * f_has_lyrics: exclude tracks without an available lyrics
a109863 @pilu added README
authored
42
9ca67a2 @pilu removed deprecated API methods
authored
43 === Getting lyrics
44
45 response = MusixMatch.get_lyrics(track_id)
46 if response.status_code == 200 && lyrics = response.lyrics
47 puts lyrics.lyrics_body
48 end
49
9f1f2c5 @pilu updated gemspec
authored
50 === Getting track
a109863 @pilu added README
authored
51
9f1f2c5 @pilu updated gemspec
authored
52 response = MusixMatch.get_track(track_id)
53 if response.status_code == 200 && track = response.track
54 puts "#{track.track_name} (#{track.artist_name})"
55 puts "Lyrics id: #{track.lyrics_id}"
56 end
1a17901 @pilu updated README
authored
57
58 === Are you feeling lucky?
59
60 puts MusixMatch.i_m_feeling_lucky("Guns'n'Roses - Welcome to the jungle")
a109863 @pilu added README
authored
61
9f1f2c5 @pilu updated gemspec
authored
62 == Lyrics
a109863 @pilu added README
authored
63
64 The Lyrics object has the following attributes:
65
66 * lyrics_id
67 * lyrics_body
9c94f6c @pilu updated README
authored
68 * lyrics_language
69 * script_tracking_url
70 * lyrics_copyright
a109863 @pilu added README
authored
71 * track_name
72 * artist_name
73
9f1f2c5 @pilu updated gemspec
authored
74 == Track
a109863 @pilu added README
authored
75
76 The track object has the following attributes:
77
78 * track_id
79 * track_mbid
80 * track_name
9c94f6c @pilu updated README
authored
81 * track_mbid
82 * track_length
83 * lyrics_id
84 * instrumental
85 * subtitle_id
a109863 @pilu added README
authored
86 * artist_id
87 * artist_mbid
88 * artist_name
9c94f6c @pilu updated README
authored
89 * artist_mbid
90 * album_name
91 * album_id
92 * album_coverart_100x100
a109863 @pilu added README
authored
93
8814e05 @pilu updated README
authored
94 == Sending Feedback
95
96 MusixMatch.post_feedback(track_id, lyrics_id, feedback_type)
97
98 Feedback type should be one of the following:
99
100 * *wrong_attribution* (the lyrics shown are not by the artist that I selected.)
101 * *bad_characters* (there are strange characters and/or words that are partially scrambled.)
102 * *lines_too_long* (the text for each verse is too long!)
103 * *wrong_verses* (there are some verses missing from the beginning or at the end.)
104 * *wrong_formatting* (the text looks horrible, please fix it!)
105
9f1f2c5 @pilu updated gemspec
authored
106 == Links
4e1d995 @pilu updated README
authored
107
108 * Repository: git://github.com/pilu/musix_match.git
9f1f2c5 @pilu updated gemspec
authored
109 * Musixmatch site: {musixmatch.com}[http://musixmatch.com]
110 * Musixmatch API: {developer.musixmatch.com}[http://developer.musixmatch.com]
4e1d995 @pilu updated README
authored
111
9f1f2c5 @pilu updated gemspec
authored
112 == Author
4e1d995 @pilu updated README
authored
113
9f1f2c5 @pilu updated gemspec
authored
114 Andrea Franz - {http://gravityblast.com}[http://gravityblast.com]
Something went wrong with that request. Please try again.