Commit 73f4961b authored by inertia's avatar inertia

#4 restructured get_account_comments JS tutorial

parent fb6c6cb8
......@@ -6,14 +6,13 @@
"scripts": {
"start": "webpack && node ./index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"dev-server":
"./node_modules/.bin/webpack-dev-server --mode development --content-base ./public --port 3000"
"dev-server": "./node_modules/.bin/webpack-dev-server --mode development --content-base ./public --port 3000"
},
"author": "",
"license": "ISC",
"dependencies": {
"bootstrap": "^4.1.3",
"dsteem": "^0.10.1",
"@hivechain/dhive": "^0.13.4",
"koa": "^2.5.3",
"koa-static": "^5.0.0",
"remarkable": "^1.7.1"
......
const dsteem = require('dsteem');
const dhive = require('@hivechain/dhive');
let opts = {};
//connect to production server
opts.addressPrefix = 'STM';
opts.chainId =
'0000000000000000000000000000000000000000000000000000000000000000';
//connect to server which is connected to the network/production
const client = new dsteem.Client('https://api.steemit.com');
const client = new dhive.Client('https://api.openhive.network');
const Remarkable = require('remarkable');
const md = new Remarkable({ html: true, linkify: true });
//fetch list of comments for certain account
async function main() {
const query = '/@steemitblog/comments';
const query = '/@hiveio/comments';
client.database
.call('get_state', [query])
.then(result => {
......
......@@ -5,11 +5,11 @@
</head>
<body>
<div class="container" id="content"><br/>
<h4>Comments by @steemitblog</h4>
<h4>Comments by @hiveio</h4>
<p>
<div id="comments" style="display: none;" class="list-group">
</div>
</p>
</div>
</body>
</html>
\ No newline at end of file
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment