yahoo-exchange
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -10,3 +10,4 @@ "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]), | ||
parseFloat(nonComma(html.split('data-reactid="61">')[2].split(' ')[0])), parseFloat(nonComma(html.split('data-reactid="61">')[2].split(' ')[2].split('<')[0])), | ||
parseFloat(nonComma(html.split('data-reactid="65">')[3].split(' ')[0])), parseFloat(nonComma(html.split('data-reactid="65">')[3].split(' ')[2].split('<')[0])) | ||
]; | ||
@@ -13,0 +14,0 @@ const req = (pair, errorHandler, callback) => request({ |
@@ -9,6 +9,4 @@ 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="65">')[2].split(' ')[0]), parseFloat(html.split('data-reactid="65">')[2].split(' ')[2].split('<')[0]) | ||
*/ | ||
parseFloat(nonComma(html.split('data-reactid="61">')[2].split(' ')[0])), parseFloat(nonComma(html.split('data-reactid="61">')[2].split(' ')[2].split('<')[0])), | ||
parseFloat(nonComma(html.split('data-reactid="65">')[3].split(' ')[0])), parseFloat(nonComma(html.split('data-reactid="65">')[3].split(' ')[2].split('<')[0])) | ||
]; | ||
@@ -15,0 +13,0 @@ const req = (pair, errorHandler, callback) => request({ |
@@ -14,3 +14,3 @@ { | ||
"main": "index.js", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"license": "MIT", | ||
@@ -17,0 +17,0 @@ "dependencies": { |
@@ -6,12 +6,8 @@ # yahoo-exchange | ||
* callback : (Array\<number\>, pair) => any | ||
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. | ||
Bid and Ask can be returned NaN by some pair. If you find a pair that has errors, please write the pair at the issue. | ||
#### A known error | ||
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 | ||
Array\<number\> : [Now, Changes, Changes percent, Previous Close, Open, Bid, Ask, Day's Range Min, Day's Range Max, 52 Week Range Min, 52 Week Range Max] | ||
### Example | ||
@@ -23,31 +19,31 @@ * ``` javascript | ||
getExchangeDataArray('USDKRW', data => console.log(data), error => console.log('[Error]' + error)); | ||
// [ 1070.12, -0.27, -0.03, 1070.39, 1070.22, 1070.12, 1071.12, 1, 1 ] or [Error] error message | ||
// [ 1071.27, 0.88, 0.08, -0.11, 1070.22, 1071.27, 1072.27, 1069.13, 1072.45, 1055.21, 1158.36 ] or [Error] error message | ||
``` | ||
* ``` javascript | ||
getExchangeDataArray('USDKRW', (data,pair) => console.log(data,pair), error => console.log('[Error]' + error)); | ||
// [ 1070.12, -0.27, -0.03, 1070.39, 1070.22, 1070.12, 1071.12, 1, 1 ] USDRKW or [Error] error message | ||
// [ 1071.27, 0.88, 0.08, -0.11, 1070.22, 1071.27, 1072.27, 1069.13, 1072.45, 1055.21, 1158.36 ] USDRKW or [Error] error message | ||
``` | ||
* ``` javascript | ||
getExchangeDataArray('USDKRW', (data,pair) => console.log(data,pair), (error,pair) => console.log(`[Error:${pair}]${error}`)); | ||
// [ 1070.12, -0.27, -0.03, 1070.39, 1070.22, 1070.12, 1071.12, 1, 1 ] USDKRW or [Error:USDKRW] error message | ||
// [ 1071.27, 0.88, 0.08, -0.11, 1070.22, 1071.27, 1072.27, 1069.13, 1072.45, 1055.21, 1158.36 ] USDKRW or [Error:USDKRW] error message | ||
``` | ||
* ``` javascript | ||
getExchangeDataArray(['USDKRW', 'JPYKRW'], data => console.log(data)); | ||
// [ 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 ] | ||
// [ 1071.27, 0.88, 0.08, -0.11, 1070.22, 1071.27, 1072.27, 1069.13, 1072.45, 1055.21, 1158.36 ] | ||
// [ 10.08, 0.03, 0.34, -0.11, 10.047, NaN, NaN, 10.08, 10.065, 10.0245, 10.0968 ] | ||
``` | ||
* ``` javascript | ||
getExchangeDataArray(['USDKRW', 'JPYKRW'], data => console.log(data), error => console.log('[Error]' + error)); | ||
// [ 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 | ||
// [ 1071.27, 0.88, 0.08, -0.11, 1070.22, 1071.27, 1072.27, 1069.13, 1072.45, 1055.21, 1158.36 ] or [Error] error message | ||
// [ 10.08, 0.03, 0.34, -0.11, 10.047, NaN, NaN, 10.08, 10.065, 10.0245, 10.0968 ] or [Error] error message | ||
``` | ||
* ``` javascript | ||
getExchangeDataArray(['USDKRW', 'JPYKRW'], (data,pair) => console.log(data, pair)), error => console.log('[Error]' + error)); | ||
// [ 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 | ||
// [ 1071.27, 0.88, 0.08, -0.11, 1070.22, 1071.27, 1072.27, 1069.13, 1072.45, 1055.21, 1158.36 ] USDKRW or [Error] error message | ||
// [ 10.08, 0.03, 0.34, -0.11, 10.047, NaN, NaN, 10.08, 10.065, 10.0245, 10.0968 ] JPYKRW or [Error] error message | ||
``` | ||
* ``` javascript | ||
getExchangeDataArray(['USDKRW', 'JPYKRW'], (data,pair) => console.log(data, pair)), (error,pair) => console.log(`[Error:${pair}]${error}`)); | ||
// [ 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 | ||
// [ 1071.27, 0.88, 0.08, -0.11, 1070.22, 1071.27, 1072.27, 1069.13, 1072.45, 1055.21, 1158.36 ] USDKRW or [Error:USDKRW] error message | ||
// [ 10.08, 0.03, 0.34, -0.11, 10.047, NaN, NaN, 10.08, 10.065, 10.0245, 10.0968 ] JPYKRW or [Error:JPYKRW] error message | ||
``` | ||
@@ -54,0 +50,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
486602
0
141
121