Automate sending info to the blockchain once an specific number of entries is reached? - solidity

It's a music website, the idea is to record on the blockchain every time a song is played.
Since we don't want to force users to install metamask so they can sign transactions, the idea is to store in an array, so that the smart contract sends it to the blockchain every 100 plays for example.
What's the best way to achieve this?

Please explain better, what technology do you use for your website? .net asp?
when you say "send to the blockchain" do you mean to a smart contract?
and an array of what do you want to send?
If you want to send something from a website to a smart contract on the blockchain you can use Nethereum thru .net asp.
Shouldn't be hard to write a c# code to send something every X times.
Just remember that storing new data on the blockchain cost gas (money).

Related

How to get bitcoin balance in smart contract

I am making a smart contract and want to know the bitcoin balance of a metamask address.How can I do this? Since BTC is not ERC-20.
Have you considered using a block explorer (something like blockstream.info)
All you need to know is the address you want to query.
I assume want to do automate this, and in this case you can search for an api - http://blockchain.info/api
You will have to implement the API, but that's the only way as far as I know from a smart contract running on Etherium.

Bitcoin Api (only found 1)

I need to use a bitcoin api, and only have found CoinBox. The problem is that coinbox is limited to only a few sites and isnt open to everyone so I cant use it. Are there any good alternatives to coinbox.me? Thanks.
There are actually quite a few apis. First there is coinbase which is my favorite since they pay the transaction fees for transactions over 0.001 BTC and all internal transactions are absolutely free (and instant). You can see their api. (https://coinbase.com/docs/api/overview). What they lack is that it is hard to grab the TX id's and any other specific information. There is also blockchain.info which is the most feature full, but the downside is that you have to pay all of the fees and it can get to be very expensive. You can see the api. (https://blockchain.info/api). There are a lot more but the problem is that they are very buggy. I hope this helps!
It is not necessary to use web wallets to create addresses. You can install your own bitcoin server/daemon and act like your own bank.
This is the place to start if you want to know how to do it (https://en.bitcoin.it/wiki/Main_Page).
Bitcoin can be queried using JSON RPC methods. So if you are running a bitcoin daemon locally you can just query them. The documentation for the same is located at
Running Bitcoin - https://en.bitcoin.it/wiki/Running_Bitcoin
API Reference - https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)
API Call List - https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list
Hope this helps.

Personal Money Movement API

I'm trying to create a simple personal project: I want to give myself bounties for completing tasks that often fester on my todo list. If I complete a task, for example, $5 should automatically move out of my savings account into a discretionary spending debit card.
Are there any APIs or banks that have those APIs that could let me do that? All of the paypal APIs seem to charge a fee, which would be kind of silly if the money is simply moving between accounts. Any suggestions?
Most banks/organisations will charge I suspect as a vast amount of money made by these organisations is from transfer charges. I cannot think of free api that would let you do it.
However you could consider using another commercial organisation, say like Amazon, and perhaps use it's APIs to supply purchase with gift cards automatically? I'm not saying Amazon is free, I'm just using it as an example.
It's not quite what you want but may be acceptable.
it may not be pretty, but you can use curl to do transactions over https, provided your online bank uses standard html forms in some way, but it typicaly takes 3 processes
1. Login to get a token (user name and password will be required)
2. Use token to get a cookie (in some cases 1 and 2 are reversed)
3. use curl to post the form data for your transaction
There are some good pointers on using curl in similar ways here:
http://curl.haxx.se/docs/httpscripting.html

How to make WCF respond in parts when new part is available?

Hi I want to create a vehicle insurance broker site which gets insurance prices from other insurances. Assuming all insurance companies will give their answer through some sort of web services I want to create another web service which will return unified answers with all data from insurers.
But there is a problem. Some insurers might answer quicker (slower) than others and in a best case I would like to display available prices to users as soon as they are received by my component. This means my component must be able to push answers to client as soon as it gets them from insurers.
Does WCF support scenario when it will send its response in parts when new part is available and then finishing with part that says that there are no more parts left?
WCF has an ability to "callback" the clients. Read more at Callback Operations. However what is "slower" in your application? If it takes minutes or hours to get an answer from third party the connection will time out. You might be better off with your app polling for new results.

Testing SMS code without access to a texting plan

Is there any way to test SMS messaging without having a texting plan?
There isn't any way to setup the equivalent of a mock email server for the purposes of testing an SMS service is there? Are there any other ways to accomplish the task? Perhaps setting up something like a GrandCentral account that can receive text messages?
I am looking to test SMS messages to multiple accounts without having to find multiple people with texting plans and coordinating the effort.
Google now has the answer for which I seek. With the roll-out of their new Google Voice (previously GrandCentral) they added the ability to received text messages to the phone number (which currently is free). While technically somewhat of a text plan, one could theoretically sign up for a few accounts and be able to test multiple phone numbers.
http://www.google.com/voice/
Update (Nov 2010):
Perhaps an even better way to do this now is to use either Tropo (tropo.com) or Twilio (twilio.com). Both of them offer low cost SMS messaging and Tropo is free for development. I've been using Tropo and it's very quick and easy to setup and write and code for.
It would depend on the method of how you're sending out the SMS messages. If you're using the email method (<ten digit number>#<cell provider's doman>) you can fake it with a regular email account that can be purged automatically. If you're using an actual SMS publisher your best bet would be to refactor the design so that you can test that your function gets called the expected number of times, but doesn't actually send the messages. Then when you want to test the production-ready code you actually round up a group of people and try it out.
Having a provider that doesn't charge for incoming text messaging (like US Cellular) comes in handy for situations like that.
SMS text can be done under a few different protocols. I've had success with SMPP using the Easy SMPP .NET library and this java-based SMPP server simulator. It saved me a bunch of overpriced service charges.
you can send email to their phone:
18005551212#txt.att.net (IIRC)