Author

Topic: Bitcoin PHP [OPEN SOURCE] (Read 8051 times)

full member
Activity: 141
Merit: 101
Security Enthusiast
May 25, 2011, 03:48:13 PM
#9
I think the idea of using cURL instead of fopen() is a good idea if it means anything.
hero member
Activity: 588
Merit: 500
May 23, 2011, 03:18:42 AM
#8
Actually I didn't use the JSON-RPC-PHP class at all. I recreated this from scratch, since it is using the same kind of communication it will ofcourse have some similarities. One of the main differences are that this uses cURL instead of fopen and just has a nicer way of handling errors. Also, I know it's not much, but this one is case sensitive, I personally find getBalance() better practice then getbalance(). If you don't prefer this version, by all means do use the JSON-RPC-PHP verison.
I had no intention of mocking you or saying that your php class was not good, it was just me thinking "why re-invent the wheel" etc. But hey, the incentive is great, and perhaps you'll even develop your script to a stage where it's really awesome! Smiley
member
Activity: 105
Merit: 10
May 22, 2011, 03:23:41 PM
#7
Let me ask my question another way?

Are you looking for contributors to the project?  And if so, are methods that communicate with the blockexplorer.com API in keeping with the direction you would like to see this project take?

I could see incorporating methods that ease interfacing with any number of bitcoin related APIs (e.g. MTGOX, ClearCoin, BitcoinID)
newbie
Activity: 36
Merit: 0
May 22, 2011, 02:49:05 PM
#6
Actually I didn't use the JSON-RPC-PHP class at all. I recreated this from scratch, since it is using the same kind of communication it will ofcourse have some similarities. One of the main differences are that this uses cURL instead of fopen and just has a nicer way of handling errors. Also, I know it's not much, but this one is case sensitive, I personally find getBalance() better practice then getbalance(). If you don't prefer this version, by all means do use the JSON-RPC-PHP verison.

@Matt: Smiley thanks mate. This class has MIT license so anyone can do with it what they want, if I have time I will see if I can develop a open source system like blockexplorer.com using this as a base class. I'm pretty busy at the moment though, still attending school.
member
Activity: 105
Merit: 10
May 22, 2011, 10:42:11 AM
#5
This is excellent!

I have written a class that includes methods that interface with blockexplorer.com (http://blockexplorer.com/q).

Would these methods be welcome additions to this class?
hero member
Activity: 588
Merit: 500
May 22, 2011, 10:10:08 AM
#4
I don't see exactly what kind of work you did here, you copied the JSON-RPC-PHP class and changed the name of it? I'm sorry if I'm missing something.
newbie
Activity: 36
Merit: 0
May 22, 2011, 02:58:31 AM
#3
Yeah bitcoins are so fascinating, take quite a bit to fully understand though.

From what I understand you can write a php script that connect to MtGox's API - https://mtgox.com/support/tradeAPI
This however does require you to have a mtgox account with "cash" on it.
legendary
Activity: 1536
Merit: 1000
electronic [r]evolution
May 22, 2011, 02:04:32 AM
#2
So I still need to install Bitcoin on the web server?

Is there a public server I can use or something?

I am very new at this whole Bitcoin thing, but I love it too!
newbie
Activity: 36
Merit: 0
May 21, 2011, 08:56:01 PM
#1
Bitcoin Class (JSON-RPC Communication)
Integrating Bitcoin into your website can be hard at first and rather frustrating, this class was designed to make it easier and to ease confusion. This script simply connect to a Bitcoin Server and then send a command to get the balance of your account. As the title says it is opensource. I paid for a VPS yesterday which is currently being setup, once it is setup I will record a video demonstrating how to integrate Bitcoin into your website (because I love you guys Wink.

Link:
https://github.com/schalk-b/Simple-Bitcoin-PHP

API/Methods:
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list

How to run server:
https://en.bitcoin.it/wiki/Running_Bitcoin

Example:
Code:
include_once("Bitcoin.php");

$rpcUser = "username";
$rpcPass = "password";
$url = "http://localhost:8332";

// create bitcoin object
$bitcoin = new Bitcoin($url, $rpcUser, $rpcPass);

/**
 * Refer to https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list
 * for a list of methods
 */
$balance = $bitcoin->getBalance();
echo("

Balance: $balance");


Donations
14bBEcMwwnDVXAYR8n2iTk9PTF5wqYLGR2

Jump to: