Login
Discover
Waves
Communities
Raidstead
Write
Login
Signup
lemooljiang
@lemooljiang
76
Designer , Poet , Technology enthusiasts
Followers
2371
Following
95
Follow
Email digest
Resource Credits
Available
Used
Location
Guangzhou
Created
2016-07-16 04:39
RSS Feed
Subscribe
Comments
Blog
Posts
Comments
Communities
Wallet
lemooljiang
cn
7y
RE: js使用正则提取Markdown文本中的图片 / 网络研习社#58
哈,村长,握个爪!
$ 0.000
0
lemooljiang
starnote
7y
RE: SteemJS中文手册
没有直接查询对作者回复的函数,只有通过对作者历史的查询过滤出对作者的最新回复 let _this = this let author = 'lemooljiang' let replies = [] async function getAllSteemReplies(){ let res = await _this.steem.api.getAccountHistoryAsync(author, -1,
$ 0.000
1
lemooljiang
starnote
7y
RE: SteemJS中文手册
SteemJS中有些函数可以加上Async,以得到Promise的写法。比如:steem.api.getContentAsync //获取某篇文章 steem.api.getContentAsync(author, permlink) //获取一篇文章的回复 steem.api.getContentRepliesAsync(author, permlink) //连续获取文章
lemooljiang
starnote
7y
RE: SteemJS中文手册
将递归类的数据递归展示出来,比如回复和子回复 递归获取评论并递归展示 vue递归组件 需要主组件和递归组件两个组件来完成 //主组件 Reply.vue <template> <div class="reply"> <div v-for="item in replies"> <Replylist
lemooljiang
starnote
7y
RE: SteemJS中文手册
如果某篇文章的回复还有子回复的话,那就要用递归来获取所有的父子回复,判断的参数是: item.children //某篇文章的回复 steem.api.getContentReplies(author, permlink, function(err, result) { console.log(err, result) }) eg: async function getReplies(author,
lemooljiang
starnote
7y
RE: SteemJS中文手册
this.steem.api.getFollowing('lemooljiang', '', 'blog', 10, function(err, result) { console.log(222, err, result) })
lemooljiang
starnote
7y
RE: SteemJS中文手册
this.steem.api.getFollowers('lemooljiang', '', 'blog', 10, function(err, result) { console.log(111, err, result) })
lemooljiang
starnote
7y
RE: SteemJS中文手册
let acc = 'lemooljiang' let key = '5kdkRfffffff' let authors = [{author: 'starnote', weight: 100}, {author: 'abit', weight: 100}] let that = this this.steem.api.streamTransactions("head", function
lemooljiang
starnote
7y
RE: SteemJS中文手册
steem.api.streamTransactions("head", function(err, result) { if (result && !err) { console.log(result) } }) eg: 实时获取作者的文章或评论 getData() { this.steem.api.streamTransactions("head",
lemooljiang
starnote
7y
RE: SteemJS中文手册
acc = "starnote" following = "lemooljiang" key = "5Jmwkffffffffff" json = JSON.stringify( ['follow', { follower: acc, following: following, what: ['blog'] }])
lemooljiang
starnote
7y
RE: SteemJS中文手册
customJson可以用来保存DAPP自定义的数据,格式为json。 steem.broadcast.customJson(wif, requiredAuths, requiredPostingAuths, id, json, function(err, result) { console.log(err, result) }) //函数讲解 steem.broadcast.customJson(
lemooljiang
starnote
7y
RE: SteemJS中文手册
steem.broadcast.vote(wif, voter, author, permlink, weight, function(err, result) { console.log(err, result) }) //函数讲解 steem.broadcast.vote ( wif, //发帖密钥 voter, //点赞人 author, //作者 permlink, // URL地址 weight
lemooljiang
starnote
7y
RE: SteemJS中文手册
发贴或评论都是用的同一个函数,只是评论的parent_author为空。 steem.broadcast.comment(wif, parentAuthor, parentPermlink, author, permlink, title, body, jsonMetadata, function(err, result) { console.log(err, result) }) //函数讲解
lemooljiang
starnote
7y
RE: SteemJS中文手册
循环遍历出用户所有历史,包括所有的发贴、评论、转帐、更改密码等信息,也就是说用户的所有操作都在这个历史里面。 getAll() { let account = "starnote" let from = 10 let limit = 9 let i = 1 let _this = this async function getAllHistory(all=[]){
lemooljiang
starnote
7y
RE: SteemJS中文手册
这个方法会获得用户所有点赞,转账,收益,custom json等等记录。 steem.api.getAccountHistory(account, from, limit, function(err, result) { console.log(err, result) }) --参数解释: account--用户 from--开始位置,0表示零位,-1表示最后一位 limit--一次查多少条 eg:它是从后往前查
lemooljiang
starnote
7y
RE: SteemJS中文手册
帐户数据几乎都在这里了,包括创建的时间,余额,点赞能量等等。 steem.api.getAccounts(['lemooljiang'], function(err, result) { console.log(789,err, result); });
lemooljiang
starnote
7y
RE: SteemJS中文手册
用户关注的作者们的最新文章列表 steem.api.getDiscussionsByFeed(query, function(err, result) { console.log(err, result) }) eg: getFeed(){ let that = this let query = {tag: 'lemooljiang', limit: 20}
lemooljiang
starnote
7y
RE: SteemJS中文手册
let query = { limit : 5, start_author:'lemooljiang', start_permlink: ""} this.steem.api.getDiscussionsByComments(query, function(err, result) { console.log(265, err, result) })
lemooljiang
starnote
7y
RE: SteemJS中文手册
steem.api.getContentReplies(author, permlink, function(err, result) { console.log(err, result) }) eg: steem.api.getContentReplies('lemooljiang', 'steemjs-41', function(err, result) { console.log(err, result)
lemooljiang
starnote
7y
RE: SteemJS中文手册
steem.api.getContent(author, permlink, function(err, result) { console.log(err, result) }) eg: steem.api.getContent('lemooljiang', 'steemjs-41', function(err, result) { console.log(934,err, result) })
← Latest
Older →