dogecoin / dogecoin.com

official repo for dogecoin.com
460 stars 217 forks source link

Dev fund counter #68

Open langerhans opened 9 years ago

langerhans commented 9 years ago

Got that suggestion on reddit (http://www.reddit.com/r/dogecoin/comments/2ohqab/new_dev_fund_address_and_quick_update_about_the/cmntm8t):
I have a request /u/langer_hans[1] that I know many others would agree on. Can we get some kind of ticker on the homepage that shows up to date dev fund balance. I feel more shibes would donate if they could see it directly and I'd like to see you guys get rewarded for your hard work.

iw0nderhow commented 9 years ago

Correct link: http://www.reddit.com/r/dogecoin/comments/2ohqab/new_dev_fund_address_and_quick_update_about_the/cmntm8t

langerhans commented 9 years ago

Copy/paste fail, sorry.

patricklodder commented 9 years ago

Generic badge generated with chain.so data:

counter

<a href="https://chain.so/address/DOGE/9x9zSN9vx3Kf9B4ofwzEfWgiqxwBieCNEb">
  <img src="https://dogebadge.herokuapp.com/v1/9x9zSN9vx3Kf9B4ofwzEfWgiqxwBieCNEb"/>
</a>

It'd be cool if someone could make a proper svg, to improve the current "designed by someone who knows nothing about design" (me) look & feel :)

josephfusco commented 9 years ago

@patricklodder would we be able to just do this with html & css and link to chain.so, and feed in the current total with js? I don't think a svg badge is the only option seeing that is just being requested on the dogecoin.com site. Codepen

patricklodder commented 9 years ago

@josephfusco The reason why i chose this approach is:

  1. The dogebadge app caches total balance locally to not put strain on any block explorer (strain will scale with pageviews, especially for addresses that have tons of small utxo, like the dev address.) I can opensource that app though it's really 20 lines of code or so.
  2. svg is relatively small in size. I'm not sure if an html iframe solution will be smaller

I like your codepen example, just need to cache/proxy the balance between requests? How is this queried now?

josephfusco commented 9 years ago

It's not haha. I just pasted in the current balance for demo purposes :smile:

josephfusco commented 9 years ago

@patricklodder I can whip up some sort of svg then, and we can still style it with css. Do I need to include anything specific? I see that <tspan xmlns="http://www.w3.org/2000/svg" id="amount_tspan">Ð4 994 514.18</tspan> is holding the value. Also where do we want this going on the site?

patricklodder commented 9 years ago

well, that or I can make a simple api that will do the caching and we can make it some sort of widget. Let me talk to my sochain/dogechain.info counterpart and see how to facilitate it in the best way. (please give me a day because of timezone diff)

I'll get back to you as soon as I have a solution.

josephfusco commented 9 years ago

Sounds good. I'm available any day.