yahoo-exchange
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -10,2 +10,3 @@ "use strict"; | ||
html.indexOf('react-text: 39 -->') === -1 ? parseFloat(parseReact(html, 38, 2).split('(')[1].split("\%")[0]) : parseFloat(parseReact(html, 39, 1).split('(')[1].split("\%")[0]), r(42), r(48), r(54), r(71), | ||
parseFloat(html.split('data-reactid="61">')[2].split(' ')[0]), parseFloat(html.split('data-reactid="61">')[2].split(' ')[2].split('<')[0]), | ||
]; | ||
@@ -12,0 +13,0 @@ const req = (pair, errorHandler, callback) => request({ |
@@ -9,7 +9,7 @@ import request = require("request"); | ||
html.indexOf('react-text: 39 -->') === -1 ? parseFloat(parseReact(html, 38, 2).split('(')[1].split("\%")[0]) : parseFloat(parseReact(html, 39, 1).split('(')[1].split("\%")[0]), r(42), r(48), r(54), r(71), | ||
parseFloat(html.split('data-reactid="61">')[2].split(' ')[0]), parseFloat(html.split('data-reactid="61">')[2].split(' ')[2].split('<')[0]), | ||
/* Day's Range / 52 Week Range | ||
* parseFloat(html.split('data-reactid="61">')[2].split(' ')[0]), parseFloat(html.split('data-reactid="61">')[2].split(' ')[2].split('<')[0]), | ||
* parseFloat(html.split('data-reactid="65">')[2].split(' ')[0]), parseFloat(html.split('data-reactid="65">')[2].split(' ')[2].split('<')[0]) | ||
*/ | ||
]; | ||
]; | ||
const req = (pair, errorHandler, callback) => request({ | ||
@@ -16,0 +16,0 @@ url: `https://finance.yahoo.com/quote/${pair}=X?p=${pair}=X`, |
@@ -14,3 +14,3 @@ { | ||
"main": "index.js", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"license": "MIT", | ||
@@ -17,0 +17,0 @@ "dependencies": { |
@@ -7,7 +7,11 @@ # yahoo-exchange | ||
Array\<number\> : [Now, Changes, Changes percent, Previous Close, Open, Bid, Ask] | ||
Array\<number\> : [Now, Changes, Changes percent, Previous Close, Open, Bid, Ask, Day's Range Min, Day's Range Max] | ||
### Warning! | ||
Bid and Ask can be returned NaN by some pair. If you find a pair that has errors, please write the pair at the following link. | ||
#### A known error | ||
JPYKRW : NaN | ||
JPYKRW : NaN | ||
### Warning! | ||
Day's Range can be returned always 1 by some pair. If you find a pair that has errors, please write the pair at the following link. | ||
#### A known error | ||
USDKRW : NaN | ||
### Example | ||
@@ -19,31 +23,31 @@ * ``` javascript | ||
getExchangeDataArray('USDKRW', data => console.log(data), error => console.log('[Error]' + error)); | ||
// [ 1070.02, -1.77, -0.17, 1071.79, 1071.77, 1070.02, 1071.02 ] or [Error] error message | ||
// [ 1070.12, -0.27, -0.03, 1070.39, 1070.22, 1070.12, 1071.12, 1, 1 ] or [Error] error message | ||
``` | ||
* ``` javascript | ||
getExchangeDataArray('USDKRW', (data,pair) => console.log(data,pair), error => console.log('[Error]' + error)); | ||
// [ 1070.02, -1.77, -0.17, 1071.79, 1071.77, 1070.02, 1071.02 ] USDRKW or [Error] error message | ||
// [ 1070.12, -0.27, -0.03, 1070.39, 1070.22, 1070.12, 1071.12, 1, 1 ] USDRKW or [Error] error message | ||
``` | ||
* ``` javascript | ||
getExchangeDataArray('USDKRW', (data,pair) => console.log(data,pair), (error,pair) => console.log(`[Error:${pair}]${error}`)); | ||
// [ 1070.02, -1.77, -0.17, 1071.79, 1071.77, 1070.02, 1071.02 ] USDKRW or [Error:USDKRW] error message | ||
// [ 1070.12, -0.27, -0.03, 1070.39, 1070.22, 1070.12, 1071.12, 1, 1 ] USDKRW or [Error:USDKRW] error message | ||
``` | ||
* ``` javascript | ||
getExchangeDataArray(['USDKRW', 'JPYKRW'], data => console.log(data)); | ||
// [ 1070.02, -1.77, -0.17, 1071.79, 1071.77, 1070.02, 1071.02 ] | ||
// [ 10.054, -0.055, -0.54, 10.109, 10.109, NaN, NaN ] | ||
// [ 1070.12, -0.27, -0.03, 1070.39, 1070.22, 1070.12, 1071.12, 1, 1 ] | ||
// [ 10.046, -0.002, -0.021, 10.048, 10.047, NaN, NaN, 10.049, 10.045 ] | ||
``` | ||
* ``` javascript | ||
getExchangeDataArray(['USDKRW', 'JPYKRW'], data => console.log(data), error => console.log('[Error]' + error)); | ||
// [ 1070.02, -1.77, -0.17, 1071.79, 1071.77, 1070.02, 1071.02 ] or [Error] error message | ||
// [ 10.054, -0.055, -0.54, 10.109, 10.109, NaN, NaN ] or [Error] error message | ||
// [ 1070.12, -0.27, -0.03, 1070.39, 1070.22, 1070.12, 1071.12, 1, 1 ] or [Error] error message | ||
// [ 10.046, -0.002, -0.021, 10.048, 10.047, NaN, NaN, 10.049, 10.045 ] or [Error] error message | ||
``` | ||
* ``` javascript | ||
getExchangeDataArray(['USDKRW', 'JPYKRW'], (data,pair) => console.log(data, pair)), error => console.log('[Error]' + error)); | ||
// [ 1070.02, -1.77, -0.17, 1071.79, 1071.77, 1070.02, 1071.02 ] USDKRW or [Error] error message | ||
// [ 10.054, -0.055, -0.54, 10.109, 10.109, NaN, NaN ] JPYKRW or [Error] error message | ||
// [ 1070.12, -0.27, -0.03, 1070.39, 1070.22, 1070.12, 1071.12, 1, 1 ] USDKRW or [Error] error message | ||
// [ 10.046, -0.002, -0.021, 10.048, 10.047, NaN, NaN, 10.049, 10.045 ] JPYKRW or [Error] error message | ||
``` | ||
* ``` javascript | ||
getExchangeDataArray(['USDKRW', 'JPYKRW'], (data,pair) => console.log(data, pair)), (error,pair) => console.log(`[Error:${pair}]${error}`)); | ||
// [ 1070.02, -1.77, -0.17, 1071.79, 1071.77, 1070.02, 1071.02 ] USDKRW or [Error:USDKRW] error message | ||
// [ 10.054, -0.055, -0.54, 10.109, 10.109, NaN, NaN ] JPYKRW or [Error:JPYKRW] error message | ||
// [ 1070.12, -0.27, -0.03, 1070.39, 1070.22, 1070.12, 1071.12, 1, 1 ] USDKRW or [Error:USDKRW] error message | ||
// [ 10.046, -0.002, -0.021, 10.048, 10.047, NaN, NaN, 10.049, 10.045 ] JPYKRW or [Error:JPYKRW] error message | ||
``` | ||
@@ -50,0 +54,0 @@ ### Warning |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
125
485930
142