Hello Steemians,. apa kabarnya hari ini, semoga selalu dalam lindungannya, pada artikel kali ini kita akan melanjutkan pembahasan yang tertunda, yaitu tentang mengirim SBD hadiah (Gift), artikel yang pertama ada pada link ini [Kirim SBD ke User atau ke Upvoter](https://steemit.com/indonesia/@binjeeclick/node-js-kirim-sbd-ke-user-atau-ke-upvoter-4-2017924t122947711z). ### Intro Script yang akan kita kembangkan hari ini adalah Script untuk mengirim SBD ke semua Upvoter dalam satu post, misalnya [post saya yang ini](https://steemit.com/indonesia/@binjeeclick/node-js-kirim-sbd-ke-user-atau-ke-upvoter-4-2017924t122947711z) saya mendapatkan 38 Votes, jadi SBD yang akan kita kirim kepada ke 38 Upvoter tersebut dengan nominal yang sama. Yang kita butuhkan untuk menjalankan script ini adalah: 1. Pengirim, contoh `binjeeclick` 2. Active Key/Owner Key, contohnya `5JTTbNDXcbAG5hRA497mJHU6ZT79piFFqchczp8C7q4Sznz1at9` 3. Permlink URL atau link post, contoh `https://steemit.com/indonesia/@binjeeclick/node-js-kirim-sbd-ke-user-atau-ke-upvoter-4-2017924t122947711z` yang kita ambil hanya `node-js-kirim-sbd-ke-user-atau-ke-upvoter-4-2017924t122947711z`. 4. Jumlah SBD yang akan kita kirim, contohnya `0.001`. ### Code Kirim SBD ke Upvoter 1. Bukalah Notepad++ atau text editor lain yang familiar dengan anda, ketikkan kode berikut: ```javascript <html> <head> <meta charset="UTF-8"> <script src="https://cdn.steemjs.com/lib/latest/steem.min.js"></script> <script type="text/javascript" src="https://code.jquery.com/jquery-latest.min.js"></script> <script> $(document).ready(function () { $("#btnSendSBD").click(function () { var url = $("#txtSBDURL").val(); var permlink = url.substring(url.lastIndexOf("/")).replace("/",""); var authorStartIndex = url.lastIndexOf("@"); var authorEndIndex = url.lastIndexOf("/"); var author = url.substring(authorStartIndex + 1, authorEndIndex); var from = $("#txtUser").val(); var wif = $("#txtActiveKey").val(); var ul = document.getElementById('result'); var amt = parseFloat($("#txtSBDAmount").val()).toFixed(3) + " SBD"; steem.api.getContent(author, permlink, function (err, result) { console.log(err, result); if (err != null) { alert(err); } else { result.active_votes.map(function (active_vote) { var to = active_vote.voter; steem.broadcast.transfer(wif, from, to, amt, "", function (sendError, sendResult){ console.log(sendError, sendResult); if (sendError != null){ console.log(sendError); //alert(sendError); var li = document.createElement('li'); li.innerHTML = active_vote.voter + ' ' + active_vote.percent/100 + '% Send SBD Error'; ul.appendChild(li); } else { var li = document.createElement('li'); li.innerHTML = active_vote.voter + ' ' + active_vote.percent/100 + '% Send SBD Done '; ul.appendChild(li); } }); }); } }); }); }); </script> </head> <body> <TABLE> <TR> <TD>Pengirim</TD> <TD><input type="text" id="txtFromUser" value="" style="width: 500px;" /></TD> </TR> <TR> <TD>Private Active/Owner Key</TD> <TD><input type="password" id="txtActiveKey" value="" style="width: 500px;" /></TD> </TR> <TR> <TD>URL POST</TD> <TD><input type="text" id="txtSBDURL" value="" style="width: 500px;" /></TD> </TR> <TR> <TD>Jumlah SBD</TD> <TD><input type="text" id="txtSBDAmount" style="width: 200px;" /></TD> </TR> </TABLE> <p><input id="btnSendSBD" type="button" value="Send SBD To ALL Voters" /></p> <hr /> <ul id="result"> </ul> </body> </html> ``` Lihat lebih jelas di [pastebin.com](https://pastebin.com/d7UQSkQc) 2. Simpan document tersebut dengan Extensi `.html` beri nama apa saja, misalnya `sebdsbdbyurl.html` 3. Buka file tersebut degan browser, anda akan melihat tampilan seperti ini: <div><center><img src="https://image.prntscr.com/image/tMZE8yr_SHKAI93L6jwGBQ.png" /><br/><em>Credit: @binjeeclick</em></center></div><p><hr> 4. Selamat anda telah berhasil membuat tools untuk send SBD ke Upvoter.
author | binjeeclick |
---|---|
permlink | node-js-kirim-sbd-ke-upvoter-5 |
category | indonesia |
json_metadata | {"tags":["indonesia","steemdev","nsc","nodejs","tutorial"],"users":["binjeeclick"],"image":["https://image.prntscr.com/image/tMZE8yr_SHKAI93L6jwGBQ.png"],"links":["https://steemit.com/indonesia/@binjeeclick/node-js-kirim-sbd-ke-user-atau-ke-upvoter-4-2017924t122947711z","https://pastebin.com/d7UQSkQc"],"app":"steemit/0.1","format":"markdown"} |
created | 2017-09-25 02:12:21 |
last_update | 2017-09-25 04:30:27 |
depth | 0 |
children | 4 |
last_payout | 2017-10-02 02:12:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.378 HBD |
curator_payout_value | 0.083 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 4,678 |
author_reputation | 2,553,417,069,149 |
root_title | "Node.js - Kirim SBD ke Upvoter #5" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 0 |
post_id | 15,843,706 |
net_rshares | 129,676,790,207 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
cheftony | 0 | 2,351,422,420 | 1% | ||
kendewitt | 0 | 3,479,092,708 | 2% | ||
npl77 | 0 | 870,818,967 | 2% | ||
nickfost | 0 | 1,124,527,094 | 2% | ||
rayfa | 0 | 2,233,483,938 | 100% | ||
dickturpin | 0 | 479,114,532 | 2% | ||
mrwalt | 0 | 9,297,550,720 | 2% | ||
stackin | 0 | 15,671,252,890 | 1% | ||
staticinstance | 0 | 34,601,007,762 | 2% | ||
mxzn | 0 | 424,441,080 | 2% | ||
netuoso | 0 | 13,822,074,862 | 2% | ||
brandonh | 0 | 899,175,897 | 2% | ||
clemdane | 0 | 496,887,518 | 2% | ||
kyawhlaing | 0 | 9,615,693,659 | 100% | ||
safwaninisam | 0 | 2,832,218,736 | 100% | ||
abunagaya | 0 | 3,382,008,779 | 100% | ||
juned | 0 | 696,294,971 | 100% | ||
jufni | 0 | 233,718,203 | 100% | ||
bukhairidin | 0 | 726,485,939 | 100% | ||
bukharisulaiman | 0 | 1,807,183,821 | 100% | ||
bigdeej | 0 | 4,592,846,592 | 2% | ||
binjeeclick | 0 | 595,843,777 | 100% | ||
kyrie1234 | 0 | 1,311,375,058 | 100% | ||
azis | 0 | 1,887,737,748 | 100% | ||
larrydavid4 | 0 | 1,698,217,989 | 2% | ||
steem77 | 0 | 2,952,898,659 | 100% | ||
rismanrachman | 0 | 2,773,368,801 | 100% | ||
shadowbot | 0 | 729,818,969 | 2% | ||
taministy | 0 | 1,779,281,122 | 100% | ||
azkadzaky | 0 | 1,500,979,873 | 100% | ||
suheri | 0 | 859,714,950 | 100% | ||
donateforcancer | 0 | 3,346,737,370 | 100% | ||
steemypete | 0 | 261,138,139 | 25% | ||
vetal | 0 | 208,908,215 | 100% | ||
dolles7 | 0 | 133,468,449 | 100% |
sepertinya postingan ini untuk menambah upvote, tetapi saya belum mengetahui bagaimana cara menjalankan seperti perintah dari postingan ini. apakah sudikiranya untuk memandu saya melakukan seperti postingan anda?
author | bukhairidin |
---|---|
permlink | re-binjeeclick-node-js-kirim-sbd-ke-upvoter-5-20170925t032301231z |
category | indonesia |
json_metadata | {"tags":["indonesia"],"app":"steemit/0.1"} |
created | 2017-09-25 03:23:00 |
last_update | 2017-09-25 03:23:00 |
depth | 1 |
children | 1 |
last_payout | 2017-10-02 03:23:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 212 |
author_reputation | 2,167,681,459,353 |
root_title | "Node.js - Kirim SBD ke Upvoter #5" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 15,847,177 |
net_rshares | 0 |
intinya saya cuma sharing ilmu tentang pemakaian steem.js dalam membuat website app,.. bila anda ikuti seperti yang telah saya uraikan, semua akan berjalan dengan baik, hanya perlu copas script nya aja,..
author | binjeeclick | ||||||
---|---|---|---|---|---|---|---|
permlink | re-bukhairidin-2017925t112743523z | ||||||
category | indonesia | ||||||
json_metadata | {"tags":"indonesia","app":"esteem/1.4.6","format":"markdown+html","community":"esteem"} | ||||||
created | 2017-09-25 04:27:48 | ||||||
last_update | 2017-09-25 04:27:48 | ||||||
depth | 2 | ||||||
children | 0 | ||||||
last_payout | 2017-10-02 04:27:48 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 0.361 HBD | ||||||
curator_payout_value | 0.011 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 204 | ||||||
author_reputation | 2,553,417,069,149 | ||||||
root_title | "Node.js - Kirim SBD ke Upvoter #5" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 15,850,201 | ||||||
net_rshares | 109,693,292,698 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
good-karma | 0 | 100,052,518,923 | 0.5% | ||
bitcoiner | 0 | 3,863,395,569 | 0.5% | ||
mysteem | 0 | 84,110,067 | 1% | ||
demo | 0 | 162,290,787 | 1% | ||
feruz | 0 | 1,521,508,815 | 1% | ||
esteemapp | 0 | 2,479,596,289 | 1% | ||
meysam | 0 | 751,483,785 | 0.25% | ||
bounties | 0 | 172,474,655 | 1% | ||
steempoll | 0 | 167,421,006 | 1% | ||
tipping | 0 | 152,152,984 | 1% | ||
doqstrader | 0 | 101,048,220 | 0.5% | ||
jpederson96 | 0 | 185,291,598 | 0.5% |
Mantaf men......makasih ilmunya, akan ana coba. Semoga bermamfaat!!
author | jufni |
---|---|
permlink | re-binjeeclick-node-js-kirim-sbd-ke-upvoter-5-20170927t095335346z |
category | indonesia |
json_metadata | {"tags":["indonesia"],"app":"steemit/0.1"} |
created | 2017-09-27 09:53:42 |
last_update | 2017-09-27 09:53:42 |
depth | 1 |
children | 0 |
last_payout | 2017-10-04 09:53:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 68 |
author_reputation | 38,022,962,008 |
root_title | "Node.js - Kirim SBD ke Upvoter #5" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 16,066,292 |
net_rshares | 0 |
a good post! thanks for sharing knowledge.
author | kyawhlaing |
---|---|
permlink | re-binjeeclick-node-js-kirim-sbd-ke-upvoter-5-20170927t095357843z |
category | indonesia |
json_metadata | {"tags":["indonesia"],"app":"steemit/0.1"} |
created | 2017-09-27 09:54:03 |
last_update | 2017-09-27 09:54:03 |
depth | 1 |
children | 0 |
last_payout | 2017-10-04 09:54:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 42 |
author_reputation | 6,006,644,313,880 |
root_title | "Node.js - Kirim SBD ke Upvoter #5" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 16,066,323 |
net_rshares | 0 |