tradingview-scraper
tradingview-scraper copied to clipboard
TypeError: tv.setup is not a function
Hello :) Are you still maintaining this library? I would love to contribute.
After recent update, I'm getting:
TypeError: tv.setup is not a function
const { TradingViewAPI } = require("tradingview-scraper");
const bitcoinSymbol = "BTCUSD";
const tv = new TradingViewAPI();
process.stdout.write("Loading...");
tv.setup().then(() => {
tv.getTicker(bitcoinSymbol).then(ticker => {
let last = 0;
ticker.on("update", data => {
if (data.lp && data.lp !== last) {
process.stdout.clearLine();
process.stdout.cursorTo(0);
process.stdout.write(
"[" +
bitcoinSymbol +
"] " +
(last > data.lp ? "-" : "+") +
" " +
data.lp.toFixed(2) +
" "
);
last = data.lp;
}
});
});
});
Hey @slashvortal,
thanks for your message. I suppose that you are talking about the examples on develop branch, where I started working on a new version of the library, and it is not yet documented.
If you are using the library from npm, please stick to the README on master branch. I'll try to find a while soon to finish the new version.
Best regards, Piotr Adamczyk
Oh sorry my bad, I mistakenly pulled the master. Yes I'm on develop branch and works perfectly.