Bitcoin Forum

Bitcoin => Project Development => Topic started by: french on May 23, 2011, 10:50:50 PM



Title: Scritp to auto send bitcoins to person
Post by: french on May 23, 2011, 10:50:50 PM
Hello, I am creating a site along the lines of bitcoin faucet but a little different.  I am wondering if there is a open source script or how I can go about of making it so that when someone clicks "submit" or "withraw" it automatically sends them lets say 1BTC.

Thanks for any help  :D


Title: Re: Scritp to auto send bitcoins to person
Post by: bittrader on May 23, 2011, 11:37:51 PM
What language do you want it in?


Title: Re: Scritp to auto send bitcoins to person
Post by: bittrader on May 23, 2011, 11:42:54 PM
Someone posted a very simple PHP library for talking to the bitcoind server: http://forum.bitcoin.org/index.php?topic=9304.0

That would allow you to send bitcoins to someone by doing something like

Code:
include_once("Bitcoin.php");

$rpcUser = "username";
$rpcPass = "password";
$url = "http://localhost:8332";
$address = "whatever";
$amount = 5;

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

$bitcoin->sendToAddress($address, $amount);

(Untested code)

You would have to be running bitcoind on the same server as the web server.


Title: Re: Scritp to auto send bitcoins to person
Post by: Sawzall on May 25, 2011, 01:31:26 AM
If you want something more specific done, I've done a reasonable amount of PHP and I work cheap.


Title: Re: Scritp to auto send bitcoins to person
Post by: sentry on May 25, 2011, 01:48:50 AM
This is how to do it without the library, though you will need the JSON RPC Client, found here: http://jsonrpcphp.org/?page=download&lang=en

Code:
<?php
require_once "classes/jsonRPCClient.php";

define ("BC_HOST""127.0.0.1"); // set bc client addy
define ("BC_USER""user"); // set rpc user
define ("BC_PASS""pass"); // set rpc password
define ("BC_PORT""8332"); // set rpc port

$bitcoin = new jsonRPCClient("http://".BC_USER.":".BC_PASS."@".BC_HOST.":".BC_PORT);
?>


Then you have a list of functions you can do with their parameters here: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list

For example for what you want to do:

Code:
<?php
$bitcoin
->sendtoaddress(<bitcoinaddress>, <amount>);
?>

Make sure the amount is not a string or you will get errors. Remember you can use the commands from that website in place of "sendtoaddress" to fit your needs.


Title: Re: Scritp to auto send bitcoins to person
Post by: darbsllim on May 25, 2011, 08:56:36 AM
Sawzall, can you send some of your work examples?

Brad


Title: Re: Scritp to auto send bitcoins to person
Post by: tennis on February 22, 2014, 12:43:08 AM
Can anyone please help me set something lke this up?  I'm looking for a sort of "investment" tool as you will that automatically sends myself bitcoins every week, month, heck every year.  How can I find a faucet of sorts that auto-pays myself into another btc wallet from the faucet wallet over specified automated send times. 

How hard would this be to set up?


Title: Re: Scritp to auto send bitcoins to person
Post by: fuzzbuzz on July 07, 2014, 06:01:45 AM
This feature of

Auto-Forward/Send coins from Address A to Address B  automatically on intervals for payment systems

It should be built within the Wallet.

Just select the two addresses, the fee, desired amount , duration, and frequency of payment. Done

Any coins with this feature within the wallet already?