Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

melon-chart-api

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

melon-chart-api - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

.npmignore

19

helpers.js

@@ -10,2 +10,3 @@ const queryString = require('querystring');

const isFuture = require('date-fns/is_future');
const isValid = require('date-fns/is_valid');
const subMonths = require('date-fns/sub_months');

@@ -23,6 +24,15 @@ const formatDate = require('date-fns/format');

// and the beginning of Epoch time if null.
const dateObj = parseDate(date === null || isFuture(date) ? Date() : date);
const dateObj = parseDate(date === null || !isValid(parseDate(date)) || isFuture(date) ? Date() : date);
const format = 'YYYYMMDD';
return {
realtime() {
const realtimeFormat = format + 'HH';
const startDate = dateObj;
const endDate = dateObj;
return {
start: formatDate(startDate, realtimeFormat),
end: formatDate(endDate, realtimeFormat),
};
},
daily() {

@@ -78,2 +88,9 @@ const startDate = dateObj;

decoded[options.movedKey] = 'Y';
if (period === 'realtime') {
url = options.url.replace('day/', '');
decoded[options.movedKey] = 'N';
if (options.realtime) {
decoded[options.dayTime] = dates.start.toString();
}
}
if (period === 'week') {

@@ -80,0 +97,0 @@ url = options.url.replace('day', 'week');

@@ -16,2 +16,8 @@ const populateOptions = require('./defaults');

return {
realtime() {
const dates = dateManager.realtime();
const period = 'realtime';
const url = composeUrl(period, dates, opts);
return scrapeMelon(url, dates, opts);
},
daily() {

@@ -18,0 +24,0 @@ // NOTE: Dates are not needed for daily chart

2

package.json
{
"name": "melon-chart-api",
"version": "1.1.3",
"version": "1.1.4",
"description": "Melon Music Chart API",

@@ -5,0 +5,0 @@ "repository": "https://github.com/hyunchel/melon-chart-api",

@@ -84,2 +84,8 @@ # Melon Chart API

##### realtime
Type: `boolean`
Default: `false`
### methods

@@ -89,2 +95,9 @@

#### Melon.realtime()
Returns realtime chart.
This method will default to the latest "realtime" chart rankings.
With `realtime` flag, the given date will be treated as "realtime", and will expect "hour" to be populated in the date.
If "hour" is not populated, it defaults to midnight(`00`).
#### Melon.daily()

@@ -91,0 +104,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc