Skip to content
Snippets Groups Projects
Commit 13baa121 authored by Mahdi Yari's avatar Mahdi Yari
Browse files

example for getDiscussionsByTrending

parent 585bd0b6
No related branches found
No related tags found
1 merge request!17update readme
......@@ -273,11 +273,39 @@ Return Example:
```
### Get Discussions By Trending
Gets the hive posts as they would be shown in the trending tab of hive.blog.
```js
hive.api.getDiscussionsByTrending(query, function(err, result) {
console.log(err, result);
});
```
|Parameter|Datatype|Description|
|---------|--------|-----------|
|query|object|an object containing different options for querying, like 'limit' and 'tag'|
|callback|function|function(err, data) {/*code*/}|
Call Example:
```js
var query = { limit : 3, tag : "steem" };
steem.api.getDiscussionsByTrending30(query, function(err, data) {
console.log(err, data);
});
// NOTE! The default limit is 0. Not setting a limit will get you an empty result.
```
Return Example:
```js
// the result is an array of big objects representing the comments
[ { /* ommited for simplicity */ },
{ /* ommited for simplicity */ },
{ /* ommited for simplicity */ } ]
```
### Get Discussions By Created
```
hive.api.getDiscussionsByCreated(query, function(err, result) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment