GithubHelp home page GithubHelp logo

yaoyonstudio / billboard-top-100 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from darthbatman/billboard-top-100

0.0 2.0 0.0 3.57 MB

:chart_with_upwards_trend: Node.js API to retrieve the top songs, albums, and artists from Billboard's charts

License: MIT License

JavaScript 100.00%

billboard-top-100's Introduction

billboard-top-100

Node.js API to retrieve top songs, albums, and artists from Billboard's charts

https://nodei.co/npm/billboard-top-100.png?downloads=true&downloadRank=true&stars=true

Build Status contributions welcome

install

npm install billboard-top-100

example

var billboard = require("billboard-top-100").getChart;

// date defaults to saturday of this week

billboard('hot-100', function(err, songs) {
	if (err) console.log(err);
	console.log(songs); //prints array of top 100 songs
	console.log(songs[3]); //prints song with rank: 4
	console.log(songs[0].title); //prints title of top song
	console.log(songs[0].artist); //prints artist of top songs
	console.log(songs[0].rank) //prints rank of top song (1)
	console.log(songs[0].cover) //prints URL for Billboard cover image of top song
});

// date format YYYY-MM-DD

billboard('hot-100', '2016-08-27', function(err, songs) {
	if (err) console.log(err);
	console.log(songs); //prints array of top 100 songs for week of August 27, 2016
	console.log(songs[3]); //prints song with rank: 4 for week of August 27, 2016
	console.log(songs[0].title); //prints title of top song for week of August 27, 2016
	console.log(songs[0].artist); //prints artist of top songs for week of August 27, 2016
	console.log(songs[0].rank) //prints rank of top song (1) for week of August 27, 2016
	console.log(songs[0].cover) //prints URL for Billboard cover image of top song for week of August 27, 2016
});

// 'all time' chart

billboard('greatest-billboard-200-albums', function(err, songs) {
	if (err) console.log(err);
	console.log(songs); //prints array of top 200 albums
	console.log(songs[3]); //prints album with rank: 4
	console.log(songs[0].title); //prints title of top album
	console.log(songs[0].artist); //prints artist of top songs
	console.log(songs[0].rank) //prints rank of top album (1)
	console.log(songs[0].cover) //prints URL for Billboard cover image of top album
});

// list all available charts

var listCharts = require('billboard-top-100').listCharts;

listCharts(function(err, data) {
	if (err) console.log(err);
	console.log(data); // prints array of all charts
});

api

listCharts(callback)

Type: function

Returns array of chartObjects separated by category

getChart(chart[, date], callback)

Type: function

chart string

date string ('all time' charts will not accept a date)

callback function

Returns array of songs/albums/artists in chart.

chartObject.chart

Type: string

Name of chart.

chartObject.link

Type: string

Location of chart on Billboard website.

songs

Type: array

Song objects.

songObject.rank

Type: number

Rank of song on charts.

songObject.title

Type: string

Title of song.

songObject.artist

Type: string

Name of artist of song.

songObject.cover

Type: string

Cover image URL of song.

songObject.position

Type: object

Last Week string (position of song on chart last week)

Peak Position string (peak position of song on chart)

Wks on Chart string (number of weeks song has been on chart)

Position information of song.

license

MIT © Rishi Masand

billboard-top-100's People

Contributors

darthbatman avatar ecbconnors avatar cowboysdude avatar e-e avatar vcastrejont avatar

Watchers

James Cloos avatar yaoyonstudio avatar

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.