A idéia inicial do projeto é criar um serviço que recupere dados de um site de cifras para depois integrar com um aplicativo mobile.
Para rodar a aplicação basta digitar o comando
user@server:~/chord-service $ ruby -rubygems app.rb
Para recuperar a listagem de um certo artista
http://0.0.0.0:4567/musicas?artista=garotos+podres
Retorno
[ { song: "A Internacional", uri: "/garotos-podres/a-internacional/" }, { song: "Agente Secreto", uri: "/garotos-podres/agente-secreto/" }, { song: "Ainda Vamo Tocar Bossa-Nova", uri: "/garotos-podres/ainda-vamo-tocar-bossa-nova/" }, { song: "Anarquia Oi!!", uri: "/garotos-podres/anarquia-oi/" }, { song: "Anistia", uri: "/garotos-podres/anistia/" } ]
Para recuperar a listagem de artista que inicie com uma determinada letra
http://0.0.0.0:4567/artistas?letra=z
Retorno
[ { name: "The Zambonis", uri: "/the-zambonis/" }, { name: "The Zeest", uri: "/the-zeest/" }, { name: "The Zico Chain", uri: "/the-zico-chain/" }, { name: "The Zigners", uri: "/the-zigners/" }, { name: "The Zolas", uri: "/the-zolas/" }, { name: "The Zombies", uri: "/the-zombies/" }, { name: "The Zorden", uri: "/the-zorden/" }, { name: "The Zutons", uri: "/the-zutons/" }, { name: "Z.D.S", uri: "/zds/" }, { name: "Za-M 45", uri: "/za-45/" }, { name: "Zabili Mi Zolwia", uri: "/zabili-mi-zolwia/" } ]
Para recuperar somente as cifras da música (para uma rápida consulta)
http://0.0.0.0:4567/cifras?uri=/nirvana/about-girl/
Retorno
[ "Em", "G", "Em", "G", "Em", "G", "Em", "G", "Em", "G", "Em", "G", "Em", "G", "Em", "G", "Em", "G", "C#5", "G#5", "F#5", "C#5", "G#5", "F#5", "E5", "A5", "C5" ]
Para recuperar a cifra completa de uma determinada música
http://0.0.0.0:4567/cifra?uri=/nirvana/about-girl/
Retorno
{ artist: "Nirvana", song: "About a Girl", chord: "Intro 8x: Em G Primeira Parte: Em G Em G I need an easy friend Em G Em G I do... with an ear to lend Em G Em G I do... think you fit this shoe Em G Em G I do... won't you have a clue. Segunda Parte: C#5 G#5 F#5 I'll take advantage while C#5 G#5 F#5 You hang me out to dry E5 A5 C5 But I can't see you every night Em G Free. ( Em G ) (2x) ( Em G ) (2x) I do... Primeira Parte: (com variação na letra) Em G Em G I'm standing in your line Em G Em G I do... hope you have the time Em G Em G I do... pick a number two Em G Em G I do... keep a date with you. Segunda Parte: C#5 G#5 F#5 I'll take advantage while C#5 G#5 F#5 You hang me out to dry E5 A5 C5 But I can't see you every night Em G Free. ( Em G ) (2x) ( Em G )(2x) I do... Solo: E|-------------------------------------| B|-------------------------------------| G|---------7/9---9------12----12-------| D|-----5-7-7/9-9---9/12----12----------| A|-5h7---------------------------------| E|-------------------------------------| Frase (opção): E|-------------------------------------| B|-------------------------------------| G|---------7/9---9------12----12-------| D|-----5h7-7/9-9---9/12----12----------| A|-5h7---------------------------------| E|-------------------------------------| Intro 8x: Em G Primeira Parte: Em G Em G I need an easy friend Em G Em G I do... with an ear to lend Em G Em G I do... think you fit this shoe Em G Em G I do... won't you have a clue. Segunda Parte: C#5 G#5 F#5 I'll take advantage while C#5 G#5 F#5 You hang me out to dry E5 A5 C5 But I can't see you every night Em G Free. Intro 8x: Em G I need an easy friend I do... with an ear to lend I do... think you fit this shoe I do... won't you have a clue. C#5 G#5 F#5 I'll take advantage while C#5 G#5 F#5 You hang me out to dry E5 A5 C5 But I can't see you every night ( Em G )(2x) Em G Em G I do... (4x)" }
IMPORTANTE! Todos os exemplos citados a cima foram resumidos, os resultados costumam ser bem maiores
> http://deyvin-chord-server.herokuapp.com/
> http://deyvin-chord-server.herokuapp.com/musicas?artista=garotos+podres
> http://deyvin-chord-server.herokuapp.com/artistas?letra=z
> http://deyvin-chord-server.herokuapp.com/cifras?uri=/nirvana/about-girl/
~> http://deyvin-chord-server.herokuapp.com/cifra?uri=/nirvana/about-girl/
~> http://deyvin.github.com/chord-service/
Projeto totalmente aberto a colaboradores, mas não se esqueçam dos testes:
user@server:~/chord-service $ rspec
Deyvid Nascimento aka Deyvin
Pseudo-músico arrumando um jeito de divertir as
pessoas com um violão e um iPhone ;)