Code Monkey home page Code Monkey logo

amy-winehouse-api's Introduction

Amy Winehouse API GitHub code size in bytes GitHub closed issues GitHub last commit GitHub release (latest by date)

This project was a self-made API since I truly love the music of Amy. The API can call record labels, songs, albums, and active members for the band. Not only was the project pushed myself to learn more about RESTful development, it also makes other programmers who lover her music the ability to collaborate.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Ruby 2.6.4
  • A mac OSX machine (Mojave 10.15.7+) OR Ubuntu (16.04+)

Installing

Installing the API locally is easy. You can clone the repo to your desired destination:

 cd ~/Desktop && git clone https://github.com/johncorderox/Amy-Winehouse-API.git && cd bundle install && rails db:drop && rails db:create && rails db:migrate && rails db:seed && rails s

Requesting Data from the API

Unless requested, all information requested will be returned in the JSON format.

GET
$ curl -H "X-Api-Key: YOUR_API_KEY_HERE" http://localhost:3000/api/v1/artists/1 | json_pp

Sample Response

{
  id: 1,
  name: "Amy Winehouse",
  date_of_birth: "September 14, 1983",
  date_of_death: "July 23, 2011",
  bio: "Much can be said about the late Amy Winehouse, one of the U.K.'s flagship vocalists during the 2000s. The British press and tabloids seemed to focus on her rowdy behavior, heavy consumption of alcohol, and tragic end, but fans and critics alike embraced her rugged charm, brash sense of humor, and distinctively soulful and jazzy vocals. Her platinum-selling breakthrough album, Frank (2003), elicited comparisons ranging from Billie Holiday and Sarah Vaughan to Macy Gray and Lauryn Hill. Interestingly enough, despite her strong accent and vernacular, one can often hear aspects of each of those singers' vocal repertoires in Winehouse's own voice. Nonetheless, her allure had always been her songwriting -- almost always deeply personal but best known for its profanity and brutal candor.",
  cause_of_death: "Alcohol Poisoning",
  education: "Sylvia Young Theatre School",
  website: "https://www.amywinehouse.com/",
  press_photo: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--52bcdcc7cdf03a5dff567e1e9cba592d859fb170/press.png",
  signature: "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCdz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--65d28fd11fcd10c85a769833e0fbe01e9effd123/signature.png",
  quotes: [],
  albums: [],
  songs: []
}

API open endpoints

The AW-API contains mostly nested routes when using an API Key. You may consult the root controller of the API to determine proper data retrieval.

information = {
  artist: "/api/v1/artists/(.:format(:id))",
  albums: "/api/v1/artists/(.:format(:id)/albums",
  songs: "/api/v1/artists/(.:format(:id)/albums/(.:format(:id)/songs",
  record_labels: "/api/v1/artists/(.:format(:id)/albums/(.:format(:id)/record_labels",
  quotes: "/api/v1/artists/(.:format(:id)/quotes",
  messages: "/api/v1/messages"
}

HTTP method URI path Description
GET /artists/:id Retrieves Artist information
GET /albums Retrieves Album information
GET /songs Retrieves/Creates Song information
GET /quotes Retrieves/Creates Artist Quotes
GET /labels Retrieves Record Labels
GET /messages Retrieves Messages

Contributing

In general, we follow the "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

NOTE: Be sure to tag @johncorderox so I can get notified for pull requests!

LICENSE

BSD 2-Clause License

Copyright (c) 2021, John Cordero
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

Author

John Cordero ยฉ johncorderox, Released under the MIT License.

Blog @jc ยท GitHub @johncorderox ยท

amy-winehouse-api's People

Contributors

dependabot[bot] avatar johncorderox avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

capturethemoon

amy-winehouse-api's Issues

API POST request

I cannot for the love of god figure out how to do a post request to a rails api from react.

Know how? I made a little form on the Form.js component. check it out if you ever got time! @capturethemoon

ex

class ApiController < ApplicationController
before_action :set_default_format

private 

    def set_default_format 
        request.format = :json 
    end

end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.