QUICK AND DIRTY BITCOIN ADDRESS MONITORING (Posted 2018-01-05 20:23:53 by Julien Sansonnens) Here is a solution that allows to quickly and easily monitor some bitcoin addresses, so you can be notified when a transaction is made (receiving or sending bitcoins). An email is sent when address balance has changed. This solution written in bash has the advantage of not requiring the installation of third party packages. Of course it's quick and dirty, do not wait for a very elaborated code, but the work is done and that's the main thing. [code language="bash"] adresse=$1 repertoire="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [ ! -f "$repertoire"/"$adresse".txt ]; then soldeactuel="$(wget -qO- blockchain.info/rawaddr/"$adresse" 2>&1 | grep -Po '"final_balance":\K[0-9]+' | awk '{s=$1/100000000} END {printf "%0.8f\n", s}')" printf "$soldeactuel" > "$repertoire"/"$adresse".txt exit else anciensolde="$(cat "$repertoire"/"$adresse".txt)" soldeactuel="$(wget -qO- blockchain.info/rawaddr/"$1" 2>&1 | grep -Po '"final_balance":\K[0-9]+' | awk '{s=$1/100000000} END {printf "%0.8f\n", s}')" if [ $anciensolde != $soldeactuel ] then mail -s "Bitcoin monitored adress has changed" somemail@somemail.com <<< "Bitcoin adress "$adresse" just received a new transaction. Balance is now: "$soldeactuel"" printf "$soldeactuel" > "$repertoire"/"$adresse".txt fi fi [/code] usage: command somebitcoinaddress to put in the crontab, for example every 15 minutes. -------- There are no comments on this post. To submit a comment on this post, email julien@jsansonnens.ch or visit us on the web [ https://jsansonnens.ch ]. .