Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "cryptifier", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"main": "./src/app.ts", | ||
@@ -31,32 +31,32 @@ "homepage": "https://github.com/odynvolk/cryptifier", | ||
"dependencies": { | ||
"axios": "^0.26.1", | ||
"axios": "^0.27.2", | ||
"cheerio": "^1.0.0-rc.10", | ||
"exp-config": "^4.1.0", | ||
"node-cache": "^5.1.2", | ||
"nodemon": "^2.0.15", | ||
"pino": "^7.10.0", | ||
"nodemon": "^2.0.16", | ||
"pino": "^7.11.0", | ||
"split2": "^4.1.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.17.9", | ||
"@babel/preset-env": "^7.16.11", | ||
"@babel/core": "^7.17.10", | ||
"@babel/preset-env": "^7.17.10", | ||
"@babel/preset-typescript": "^7.16.7", | ||
"@types/chai": "^4.3.1", | ||
"@types/mocha": "^9.1.0", | ||
"@types/node": "^17.0.24", | ||
"@types/mocha": "^9.1.1", | ||
"@types/node": "^17.0.33", | ||
"@types/split2": "^3.2.1", | ||
"@typescript-eslint/eslint-plugin": "^5.19.0", | ||
"@typescript-eslint/parser": "^5.19.0", | ||
"@typescript-eslint/eslint-plugin": "^5.23.0", | ||
"@typescript-eslint/parser": "^5.23.0", | ||
"chai": "^4.3.6", | ||
"chronokinesis": "^3.1.2", | ||
"eslint": "^8.13.0", | ||
"eslint": "^8.15.0", | ||
"mocha-cakes-2": "^3.3.0", | ||
"moment": "^2.29.2", | ||
"moment": "^2.29.3", | ||
"nock": "^13.2.4", | ||
"prettier": "^2.6.2", | ||
"rewire": "^6.0.0", | ||
"ts-mocha": "^9.0.2", | ||
"ts-mocha": "^10.0.0", | ||
"ts-node": "^10.7.0", | ||
"typescript": "^4.6.3" | ||
"typescript": "^4.6.4" | ||
} | ||
} |
import axios from "axios"; | ||
import cheerio from "cheerio"; | ||
import logger from "../logger"; | ||
@@ -8,6 +7,9 @@ import { mediumCache } from "../cache"; | ||
const extractPrice = (html: string): string => { | ||
const $ = cheerio.load(html); | ||
const lastPrice = $("#_last_8848"); | ||
const m = html.match(/instrument-price-last">[\d.]*<\/span>/) ?? []; | ||
if (m?.length > 0) { | ||
const m2 = m[0].match(/\d+.\d+/) ?? []; | ||
if (m2?.length > 0) return m2[0]; | ||
} | ||
return lastPrice.text(); | ||
return "N/A"; | ||
}; | ||
@@ -14,0 +16,0 @@ |
@@ -87,3 +87,3 @@ // @ts-ignore | ||
.get("/commodities/carbon-emissions-historical-data/") | ||
.reply(200, investing.toString().replace(/78\.75/g, "79.75")); | ||
.reply(200, investing.toString().replace(/89\.80/g, "99.80")); | ||
}); | ||
@@ -145,3 +145,3 @@ | ||
.post(`/bot${config.telegramApiKey}/sendMessage`, { | ||
"chat_id": 123, "parse_mode": "html", text: "Carbon emissions futures are <b>up</b>! €79.75", | ||
"chat_id": 123, "parse_mode": "html", text: "Carbon emissions futures are <b>up</b>! €99.80", | ||
}) | ||
@@ -148,0 +148,0 @@ .reply(200); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
838
694102
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@0.27.2(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
- Removedaxios@0.26.1(transitive)
Updatedaxios@^0.27.2
Updatednodemon@^2.0.16
Updatedpino@^7.11.0