https://github.com/neelkamath/euphonia
🎼 Music quiz API (UE18CS208C project)
https://github.com/neelkamath/euphonia
java musixmatch
Last synced: 3 months ago
JSON representation
🎼 Music quiz API (UE18CS208C project)
- Host: GitHub
- URL: https://github.com/neelkamath/euphonia
- Owner: neelkamath
- License: mit
- Created: 2019-11-17T09:17:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-17T09:29:11.000Z (over 5 years ago)
- Last Synced: 2025-01-18T12:29:24.723Z (4 months ago)
- Topics: java, musixmatch
- Language: Java
- Size: 65.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Euphonia
This is my UE18CS208C project. It's a trivia application for music.
## Installation
1. Install a [Java JDK or JRE](http://www.oracle.com/technetwork/java/javase/downloads/index.html) version 8 or higher.
1. Clone the repository using one of the following methods.
- SSH: `git clone [email protected]:neelkamath/euphonia.git`
- HTTPS: `git clone https://github.com/neelkamath/euphonia.git`
1. `cd euphonia`
1. Build the project.
- Windows: `gradlew.bat shadowJar`
- Other: `./gradlew shadowJar`
1. Copy the `build/libs/euphonia-all.jar` JAR to the project you'd like to use it in.## Usage
We are using the Musixmatch API to retrieve music data. Since there is a lot of missing metadata, you might be unable to generate quizzes on most artists. The artist `Skrillex` has been tested and is known to successfully generate quizzes.
There are two APIs you should use.
The first API, `Api.searchArtists()`, retrieves artist metadata. This is used for finding the exact artist to generate a quiz on. For example, there are multiple artists named `U2`. Using this API, you can select the one you have in mind.
The second API, `Quizmaster.getQuiz()`, gets a quiz on a specified artist. The quiz will contain questions such as one which asks which country an artist is from. Simply pass an artist you selected using the `Api.searchArtists()` API to the `Quizmaster` API.
Here's an example of the two APIs we discussed.
```java
List artists = new Api().searchArtists("Skrillex"); // The first API.
System.out.println(new Quizmaster(artists.get(0)).getQuiz()); // The second API.
```## Contributing
The subpackages in `com.neelkamath.api` (e.g., `com.neelkamath.api.artist_albums_get`) contain generated code. The package is named according to the Musixmatch API method it stores POJOs for (e.g., the URL `http://api.musixmatch.com/ws/1.1/artist.albums.get` would have its POJOs stored in the `com.neelkamath.api.artists_albums_get` package). The POJOs are generated using the [jsonschema2pojo](http://www.jsonschema2pojo.org/) website.
## License
This project is under the [MIT License](LICENSE).