Bitcoin Forum

Other => Off-topic => Topic started by: dopecoindude on August 01, 2014, 04:21:40 AM



Title: donation pledge counter
Post by: dopecoindude on August 01, 2014, 04:21:40 AM
does anyone know of any widgets that keep track of donations ...

like that isn't javascript....


Title: Re: donation pledge counter
Post by: franky1 on August 01, 2014, 04:41:05 AM
if you dont like javascript, what language are you looking for?

a simple way in php is to just echo the amount every time a person visits your page

Code:

<?php

$amount
=file_get_contents("http://www.blockchain.info/address/<insert address here>");
$amount=$amount 100;
echo 
"amount: " .  $amount " bits";

?>



save it as filename.php

oh and the blockchain.info address shouldend up looking like:
http://www.blockchain.info/address/1blahblahblahblahblah
not
http://www.blockchain.info/address/<1blablablablabla>

as i have seen someone before leave the <> in the code as they thought it was needed.

the code is not the hard part. the hard part is finding a service that doesnt mind being bombarded with balance requests per visitor... well thats if your website got that popular :D



Title: Re: donation pledge counter
Post by: dopecoindude on August 01, 2014, 04:48:33 AM
Quote
if you dont like javascript, what language are you looking for?
HTML ? lol   coinwidget.com  doesn't work in wordpress.com :/

Quote
a simple way in php is to just echo the amount every time a person visits your page

Code:
$amount=file_get_contents("http://www.blockchain.info/address/<insert address here>");
$amount=$amount / 100;
echo "amount: " .  $amount . " bits";


Totally forgot about this!  I'll give this a go and let you know! thanks.

Quote
the code is not the hard part. the hard part is finding a service that doesnt mind being bombarded with balance requests per visitor... well thats if your website got that popular :D

Haha  so true. I have a feeling this idea will be pretty popular ;)