Hi all! I have a request for something that I think would benefit the entire NEM community greatly if it could be done.
I am a programmer, but only as a hobby. I have some formal education as a programmer, but it has been a while since I have done any serious coding and I am really behind the times with a lot of modern coding practices. I have always dreamed about coding various cryptocurrency-related applications, but I found it extremely difficult to get started on anything, mostly due to what I feel is a lack of basic information.
Even Bitcoin, which has been around for many years now, I cannot seem to find any basic tutorials on how to get started writing applications that utilize its capabilities. (I have not looked for any in some months now, so perhaps there are at this time but last I checked I could not find any basic, easy to understand code samples.)
For example, I thought about writing some various web applications that utilize BTC for payment processing. I could not even find any basic tutorials for PHP or other similar languages that could provide sample code for handling basic tasks such as automating payments, performing some action when a payment is received, etc. The Bitcoin API documentation assumes a basic level of programming knowledge that I unfortunately just do not have, and I am always confused about how to particularly implement it in my code.
So anyway, with all that said…
I'd love to develop apps for the NEM ecosystem. In another thread I proposed an idea for a twitter client that integrates into the NEM wallet in such a way that could facilitate easy tipping over twitter (or other social media), and update your wallet automatically in an integrated manner. For example, I could tweet some NEM to someone like @NEMrecipient tip 100 NEM and, upon confirmation by the recipient, it could take the 100 NEM from my wallet and automatically deliver it to the intended recipient of the tip.
Similarly, if I receive a tip from someone and I have such a tipping account set up to accept tips in this way, the tip could just automatically go into my NEM wallet without my own intervention. I think this type of tipping system is something that could set NEM apart right from the start as an easy to use currency, and would also help to spread the word about NEM in general.
I was told it should be possible to code such an application, particularly with the NCC now open source, but I simply have no idea where to even begin. I could write an application that uses the twitter API to do various things such as read and parse new tweets, etc., but that is only because there are plenty of tutorials and sample code floating around the web about how to do such things.
If anyone has the capability or knowledge to write up some very basic tutorials for how to get started coding apps that utilize NEM and its API/blockchain, that would not only help me immensely but also anyone else who only has a basic, hobbyist level of programming knowledge to get started writing apps for the NEM ecosystem.
Is anyone here capable and/or willing to do this? I think it would be a huge benefit to the entire community.
I think the easiest one will be python and requests library.
What you should actually start with is a plan or design, how this should work, here's an outline:
[li]the bot should be running constantly and monitor it's own (twitter) account[/li]
[li]the bot should hold the db, where it stores: twitter nick, "nick_account" = <private NEM key (known only to bot), NEM address>[/li]
[li]the bot should provide some basic commands (via tweets) like:
[li]@nembot create - it would create "tipping" account for you, and send you back NEM address, you'd have to send NEMs to this account[/li]
[li]@nembot withdraw <nemaddress> - sends nem from nembot account (the one that he holds key for), to provided <nemaddress>[/li]
[li]@nembot tip <user> amount - this one is a heart, it a) (if necessary) creates account for a <user> similarily to create, b) sends nem from
account of user that send the tweet to <user> c) it sends tweet to <user> telling him he received a tip, and link with instructions[/li]
[/li]
NCC API could be a start, but I think you'd quickly found, that it gets slow, once you have multiple accounts in a single wallet, so you'd have to split it into multiple wallets.
It probably would be better to use NIS API directly, but unfortunately at this point, you'd find that there are APIs missing (i.e. there's currently no way to generate keypair using rest API, also, signing tranaction could be a problem).
You can take a look at https://github.com/neweconomymovement/blockexplorer
This is basically how to communitcate, via python with NIS (well it's one way of doing it anyway )
https://github.com/NewEconomyMovement/blockexplorer/blob/master/api_connectors/async_httpapi.py
All there is todo is make GET and POST requests so adding methods is as simple as copy, paste and edit arguments.
It doesn't use requests as gimre suggested but rather the tornado (web-framework used) builtin http-client but the principle is the same.
If are going to start using python feel free to ask me if you're stuck
You can take a look at https://github.com/neweconomymovement/blockexplorer
This is basically how to communitcate, via python with NIS (well it's one way of doing it anyway :) )
https://github.com/NewEconomyMovement/blockexplorer/blob/master/api_connectors/async_httpapi.py
All there is todo is make GET and POST requests so adding methods is as simple as copy, paste and edit arguments.
It doesn't use requests as gimre suggested but rather the tornado (web-framework used) builtin http-client but the principle is the same.
If are going to start using python feel free to ask me if you're stuck :)
Thanks all for the info. I am a little familiar with Python, so that is a possibility. I will take a look into things and see what happens. I'm fairly busy with my translation business these days, but hopefully I will have a bit more free time in the months to come. This could be something I could spend some of that free time on. :)