Title: Bash script to sound when coins received - need debug Post by: jago25_98 on August 01, 2013, 09:28:23 PM Goal: Make a sound when balance at an address reaches a set number of confirmations
So far: Code: #needs: Needs a bit of tweaking. I did a search and found bash scripts in this dev section so I'm posting here... but it doesn't seem the best section to post in, sorry if it's wrong Title: Re: Bash script to sound when coins received - need debug Post by: kostagr33k on August 02, 2013, 03:08:51 AM Made some changes. Please note I haven't tested thoroughly and I didnt have time to test on a linux box, so could not install pulseaudio
Code: #!/bin/sh Title: Re: Bash script to sound when coins received - need debug Post by: dudeami on August 02, 2013, 09:46:57 PM Good job, I like the ingenuity! I see two issues with your script:
1) It only checks if the amount is over 0. You should save the balance at startup (such as initbalance) so users that already have balances can use it. 2) Your abusing the free API access pretty badly, and you might unknowingly run into your 8 hour limit within 3 hours. From the bottom of https://blockchain.info/api Requests in 8 Hours: (Maximum : 10000) Requests in 5 minutes: (Maximum : 500) Your making 28800 (if curl responds instantly) api calls in a 8 hour period. I would suggest polling every 3 seconds to barely make it in the limits (9600 requests a day) or 10+ seconds to be nice to blockchain.info for their free api service. I personally don't need to know that second that I received some coins. Other than that, keep up the great work! Title: Re: Bash script to sound when coins received - need debug Post by: kostagr33k on August 03, 2013, 02:21:20 AM I kept the script as is, as I havn't scripted against blockchain.info, but Yes, the timing should be changed to make things nicer for them ;p
kosta Title: Re: Bash script to sound when coins received - need debug Post by: dudeami on August 03, 2013, 03:30:51 AM I kept the script as is, as I havn't scripted against blockchain.info, but Yes, the timing should be changed to make things nicer for them ;p kosta All that needs to be changed is Code: sleep 1s to some other value, say 30 seconds: Code: sleep 30s Title: Re: Bash script to sound when coins received - need debug Post by: kostagr33k on August 03, 2013, 03:51:56 AM lol ;p
When I meant I haven't scripted against blockchain.info meant just that. i.e. I don't know there policies so just modified his script as is to hopefully point him in the right direction. willing to help him further if he does have any questions though ;p im curious if thats what he was looking for, as i only use linux for servers and not desktops and can't easily test the whole sound thing . Kosta |