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

add getDiscussionsByPromoted

parent 13baa121
No related branches found
No related tags found
1 merge request!17update readme
...@@ -289,8 +289,8 @@ hive.api.getDiscussionsByTrending(query, function(err, result) { ...@@ -289,8 +289,8 @@ hive.api.getDiscussionsByTrending(query, function(err, result) {
Call Example: Call Example:
```js ```js
var query = { limit : 3, tag : "steem" }; var query = { limit : 3, tag : "hive" };
steem.api.getDiscussionsByTrending30(query, function(err, data) { hive.api.getDiscussionsByTrending30(query, function(err, data) {
console.log(err, data); console.log(err, data);
}); });
...@@ -367,6 +367,38 @@ hive.api.getDiscussionsByComments(query, function(err, result) { ...@@ -367,6 +367,38 @@ hive.api.getDiscussionsByComments(query, function(err, result) {
}); });
``` ```
### Get Discussions By Promoted
Gets the recent posts ordered by how much was spent to promote them
```js
hive.api.getDiscussionsByPromoted(query, callback);
```
|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 : "hive" };
hive.api.getDiscussionsByPromoted(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 */ } ]
```
## Blocks and transactions ## Blocks and transactions
### Get Block Header ### Get Block Header
......
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