Dusting Off and Refreshing the Old Code

Updating my little app with new knowledge.


newcoins.png

Just a few weeks ago, I decided to step back into the crypto-writing world and see how things are. I asked if it was Time to come back? and I got a lot of encouragement, in different ways, that it was time.

Since I was back, it was time to look at my old To The Moon! Coin Calculator, that I created back in the Steemit days.

Now, my calculations might be slightly faulty (I may have misunderstood how many miles the Sun is away), but it did prove out, so I am going to keep using the same calculation. Besides, there has been more than 1 coin that has reached To The Moon and are now on their way to the Sun.


ethmoon.png

And, with the NFT market making some crazy money, maybe my To The Moon! infographics will end up earning me something, but that will be later.

The first thing I needed to fix was updating the calls to CoinMarketCap. They not only changed the names of some parameters, they changed how the api calls work all together. I don't blame them, they have to make sure whomever is pinging their servers isn't doing it for bad reasons.


coinapidash.png

So, now I have an account with their API and 333 credits per day. Which means, I can call their API 333 times and get back the data that I need. As you can tell, I only do 9 calls per day right now. There are 1,000s of coins and in order to not make too large of a call, I am splitting up the calls. It still isn't working as I want it to, but at least I am getting back the Top 100 coins.


easycron.png

I don't plan on making a lot of calls, because there is a limit of calls I can make using my free EasyCron plan. Since I don't plan on being a live check of the coin prices, I don't see it as necessary to make a lot of calls anyway. But, if I was making money off an app, then I would pay for accounts and have more options, even though I still wouldn't call more than 1 time in an hour to get the quotes. Well, 1 cron job, multiple api calls.

The EasyCron account has to be manually re-activated every 28 days or so. I guess a clever person would create a cron job to do that automatically.

Now that I have those sorted out, there are some other things I need to fix with my app. It loads slowly. It could be my host, but it could also be how I am building the page with PHP. So, I have decided that I will try to do Vue.js and PHP together to build a more responsive app and use some of the Vue knowledge I have learned at my money paying job. I am also using VS Code, which is free and what I am using for work. I hoped that I could use Vue CLI with PHP, but it doesn't look like that is going to work. The benefit of using Vue CLI is that it wraps everything up into a few files, while making adding plugins and components easy. PHP and Vue.js will have to do for now.

I just got started on this, so as I learn and figure out things I want to share, I will post about it.


DeanLogicForkSing-sm.png

Let the positive energy sing!

More Power to the Minnows!!


Now Playing

Rising Star | dCity | Splinterlands

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Ecency