npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bb-top-100

v1.0.2

Published

Gets the top songs, albums, and artists from Billboard's charts

Downloads

18

Readme

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

Build Status codecov Codacy Badge contributions welcome

install

npm install billboard-top-100

example

const { getChart } = require('../billboard-top-100.js');

// date format YYYY-MM-DD

getChart('hot-100', '2016-08-27', (err, chart) => {
  if (err) console.log(err);
  console.log(chart.week) // prints the week of the chart in the date format YYYY-MM-DD
  console.log(chart.previousWeek.url) // prints the URL of the previous week's chart
  console.log(chart.previousWeek.date) // prints the date of the previous week's chart in the date format YYYY-MM-DD
  console.log(chart.nextWeek.url) // prints the URL of the next week's chart
  console.log(chart.nextWeek.date) // prints the date of the next week's chart in the date format YYYY-MM-DD
  console.log(chart.songs); // prints array of top 100 songs for week of August 27, 2016
  console.log(chart.songs[3]); // prints song with rank: 4 for week of August 27, 2016
  console.log(chart.songs[0].title); // prints title of top song for week of August 27, 2016
  console.log(chart.songs[0].artist); // prints artist of top songs for week of August 27, 2016
  console.log(chart.songs[0].rank) // prints rank of top song (1) for week of August 27, 2016
  console.log(chart.songs[0].cover) // prints URL for Billboard cover image of top song for week of August 27, 2016
});

// chartName defaults to hot-100
// date defaults to saturday of this week

getChart((err, chart) => {
  if (err) console.log(err);
  // use chart
});

// date defaults to saturday of this week

getChart('hot-100', (err, chart) => {
  if (err) console.log(err);
  // use chart
});

// 'All Time' chart

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

// list all available charts

const { listCharts } = require('../billboard-top-100.js');

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

api

listCharts(callback)

Type: function

Returns array of chartObjects separated by category

getChart([chartName][,date], callback)

Type: function

chartName string

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

callback function

Returns array of songs/albums/artists (as specified by chart) in chart.

chartObject.name

Type: string

Name of chart.

chartObject.url

Type: string

URL of chart.

chart

Type: object

Chart containing songs, week, previousWeek, and nextWeek

chart.week

Type: string

Chart week in date format YYYY-MM-DD

chart.previousWeek

Type: object

Week object containing date and URL

chart.nextWeek

Type: object

Week object containing date and URL

chart.songs

Type: array

Song objects.

weekObject.date

Type: string

Chart week in date format YYYY-MM-DD

weekObject.url

Type: string

Chart URL

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