HBOM Price Ticker Working Again

Fellow Servants of Bitcoin,

While doing a little busy work on something else, I took a gander through the blockr.io and found they offered a nicely featured api.  Last time I wrote about it, I was over the moon enough, because let’s face it, do you want a competitors ticker (though to their credit, I like what CoinGeko has going on.)

Looking through constraints, they’ve mentioned to contact if doing HEAVY usage.  Clicking the contact us link points to Coinbase.  Interesting enough.  If Coinbase owns this blockr.io site, then I presume it’s likely okay to plug into my puny, 2k impressions per month, honeybadgerofmoney website here, no problem – giving an estimate of about 10 minutes per user on my site, by tweaking my code to only ping their api once every 10 seconds, I can estimate that each visit will cost 60 api calls, that means we’re going to cost this service approximately 120K api requests per month (based on 2000 users hanging around for 10 minutes on the site [if I get more than 100,000 users on taking a gander and maxing out my allotted free-tiered usage, then I’ll definitely work with them to get provisioned properly]).

Basically a few months back, I hit a wall when using coinmarketcap’s api limit so I decided to shelve the ticker temporarily.  I’ve mentioned in my sidebar that I would get around to it, so as promised, THERE IT IS 🙂

 

If  you want a copy of this code for your own site, feel free to use it!:

How the thing works:

We use jQuery right at the top there, so that we have the ability to run those fancy $get and $getJSON requests (so we’re not re-inventing the wheel with more code).  Also we are going to put in a placeholder div to attach our data, markup, and css on.  From there, we attach style attributes on the main ticker data, grab the data from our price provider via their api. To snazz things up, and because I LOVE honeybadgers, we use the flickr api to grab pictures of honeybadgers and load those image urls in to fill in our background.

 

I’m using this through the widget api on wordpress and would love to know if there is a way to cut out jQuery and have it referencing the internal copy of jQuery that is powering my wordpress installation. If you’re reading this (because it’s important to me, but not so much that I can continue to procrastinate from real work), and you know how I can use this ticker without embedding its own copy of jQuery (using the native wordpress embed of jQuery) do leave a comment would ya.

 

Post Author: Frankenmint

From the pristine land of the internetz, the Frankenment was bred from machine. While looking to embrace the new world Linux regime he is truly a windows bred. I've come from the darkness to the light to share with you other internetz fol-ken to share the message of virtual money. Through our actions, we can make the virtual world yet again beyond the decree of the internet, with the decree of internetz money! Bitcoin, the Supercurrency, the official tender of the internetz that will be accepted by all countries and all fol-ken Alike!