• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

PHP Script for USD/DRK accounting

Either I've somehow picked up php by osmosis, or that's one pretty piece of php. :smile:

I agree, it's nicely written.

People are often surprised how few lines of comments you need when you call a method/function which e.g. extracts the date from a datetimestamp just extract_date_from_datetimestamp.

I call this "self-commenting code" and am a big fan of it because it enables me to understand MY OWN code even after a couple of weeks.

No to mention the poor souls who might have to understand it after some years :eek:
 
Well, I guess it is possible to track prices now! The only problem now is how to figure mined coins into the picture, as it cost way more to mine 'em than to buy them, and...er.... I don't know if I still have all my wallet.dat files....??
 
Hmmm... This is a pretty nifty piece of coding. If I could only get it to work for me?

I took the code an put it into a PHP file and executed the code "as is" and I get the following error;

Fetching address data from http://explorer.darkcoin.io/address/XjAdaR6T3yBSENmBCx5Nvw5vw316g96h6R... Fetching BTC/DRK rates from https://poloniex.com/public?command...yPair=BTC_DRK&start=1399680000&end=1399766400... SSL certificate problem: unable to get local issuer certificate

This looks like it is appearing in this section of code;

function get_html_contents($url)
{
$c = curl_init($url);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
$html = curl_exec($c);

if (curl_error($c))
{
die (curl_error($c));
}

return $html;
}


Anyone have any ideas what I missed? Do I need to have SSL on my server enabled?
 
TanteStefana I stumbled across Moneydance and have begun using it for full GAAP. It allows you to setup unlimited custom currencies. For hardware mining you can track your costs equipment and electrical costs as expenses. For cloud mining services with markets (ie Hashnest), I setup the hashing power as an investment and record payouts as dividends. That way you can track the fluctuating value of the hashing power too and get a pretty accurate ROI. It's a lot of manual work, but nothing is simple yet...
 
Back
Top