Would be magnitudes more efficient if you took the time to calculate it locally instead of reaching out to a website to do it. Not to mention doing it locally would require about 50% less code. Doing it this way does not guarantee longevity. In a few months or whenever they decide to update the website, it'll have to be redone to function properly again.
It works doesnt it? ^.^