1 | ||
1 | ||
1 | ||
1 |
It's a simple data need. Developing a library of historic price data. A lot of these APIs for historic prices will only let you get minutely data from the very recent past. So if you want a large collection of it in the future you need to set up a bot now.
Once again my interests are in scraping polymarket as they have been lately.
The only annoying bit is getting the ids for the markets that can't be fully automated. But I was able to get even that partially automated. I also adjusted the config files for it to require minimal manual formatting on my part.
The longest piece of code is the scrape script with 80% deals with reading the configs.
run.js
This is what a config file looks like for this. I have a directory of 7 of them in total. The first line is a title and then it has pairs of market ids and the price for that sub-market.
** bitcoinjan.config **
To make it easy get the lower half of that file I have this one liner for the browser.
Last is a simple scheduler to run it once a day. I've abandoned cron for these things. I have a lot of JS bots that I've automated launching in tmux on boot.
** index.js **
Lastly I might as well share my script for launching all of my bots from the bot directory according to whatever is enabled in the quicklaunch
file.
** launchbots.sh **
It's all Geek to me.
You may have considered this but if it could help in anyway, you could utilize whatever built in or addon functionality that HumHub has. I haven't delved in yet, but know HumHub users have lots of options like sharing files and making html pages. Maybe there's more that could also be useful. I guess it depends on your goals.
And I realized my preload.js file made it so I have non-migratable code. I did a thing to my system that is considered very bad in the NodeJS world. I have a file that adds a lot of functions to the
global
variable and more functions to Arrays and to the Math library.fsp is equal to require('fs').promises.
AND you just implemented the save feature. PERFECT time!