tuneefy (in hacklang)
A new version of tuneefy built in Hack, from the ground up.
This project uses composer. Just run :
composer install
... and you should be good to go !
Tuneefy can be run in two Docker containers, one containing Nginx, and one containing HHVM. The two are linked via a Docker Compose file.
All the Docker files are present in the docker
folder.
To create the images :
docker build --no-cache=true --rm -f ./docker/Dockerfile-nginx -t nginx .
docker build --no-cache=true --rm -f ./docker/Dockerfile-hhvm -t hhvm .
docker pull mysql
And then :
docker-compose up -d # may differ if you're on a Mac, Linux or Windows PC
And for the fixtures database :
# TODO
Then, to tail the logs :
docker-compose logs
To run the typechecker in the running HHVM container :
docker exec -it [container_name] /bin/bash -c "cd /var/www/tuneefy/ && hh_client restart && hh_client"
- Composer, providing a nice package manager and a practical PSR-4 autoloader
- Symfony\Yaml to parse the configuration files
- Slim, a lightweight RESTful framework
- Twig, a template engine
- XmlToJsonConverter to convert Amazon XML to correct JSON
I'm using Zepto.js to cover the DOM manipulation tasks and related stuff.
This project is a very basic composer project with a PSR-4 autoloader.
The source is in src/tuneefy
and is organised as such :
- MusicalEntity includes the model for a musical entity (album or track)
- Platform includes all the platform-related code
- Utils includes various utilities such as a very stripped-down OAuth client class and a custom Slim View handler for JSON
- and two top-level classes : Application and PlatformEngine that deal with the application itself and how it interacts with the platforms
(This will move to somewhere more appropriate afterwards)
TBC
You can get an API key and associated secret by sending an email to api@tuneefy.com.
You will need to authenticate in order to use the tuneefy API. All requests must be signed with 1-legged OAuth (often refered as 2-legged OAuth, but it's not).
Here is a pseudo-code process on how to sign your requests :
TBC
Limits are placed on the number of API requests you may make using your API key. Rate limits may vary by service, but the defaults are 100 requests per hour.
TBC
TBC
TBC
The aggressive
parameter allows to merge tracks without taking the album name into account. This works for a majority of scenarios since it's quite rare that an artist released two tracks with exactly the same name, but it can confuse live or acoustic versions, for instance.
This is work in progress, but if you want to participate/contribute, feel free to tell me ! :)