Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hive-js
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hive-js
Commits
585bd0b6
Commit
585bd0b6
authored
4 years ago
by
Mahdi Yari
Browse files
Options
Downloads
Patches
Plain Diff
add getBlogEntries
parent
551e9aa7
No related branches found
No related tags found
1 merge request
!17
update readme
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/README.md
+46
-0
46 additions, 0 deletions
doc/README.md
with
46 additions
and
0 deletions
doc/README.md
+
46
−
0
View file @
585bd0b6
...
...
@@ -226,6 +226,52 @@ Return Example:
[
'
username5
'
,
1
]
]
```
### Get Blog Entries
Gets the last
`limit`
number of posts of
`account`
before the post with index
`entryId`
Very similar to hive.api.getBlog but with much simpler result objects
```
js
hive
.
api
.
getBlogEntries
(
account
,
entryId
,
limit
,
callback
);
```
|Parameter|Datatype|Description|
|---------|--------|-----------|
|account|string|a hive username|
|entryId|number|a positive number - the index from which to start counting (the index is zero based)|
|limit|number|a positive number - the max count of posts to be returned|
|callback|function|function(err, data) {/
*code*
/}|
Call Example:
```
js
hive
.
api
.
getBlogEntries
(
"
username
"
,
10
,
3
,
function
(
err
,
data
)
{
console
.
log
(
err
,
data
);
});
// In this case we have a call to get [3] posts, the newest of which is the one with index [10]
// (that's the 11-th post, because the post indexes are zero based)
// That means that the results will be posts [10, 9 and 8]
```
Return Example:
```
js
[
{
author
:
'
username
'
,
permlink
:
'
post-permlink-10
'
,
blog
:
'
username
'
,
reblog_on
:
'
1970-01-01T00:00:00
'
,
entry_id
:
10
},
{
author
:
'
username
'
,
permlink
:
'
post-permlink-9
'
,
blog
:
'
username
'
,
reblog_on
:
'
1970-01-01T00:00:00
'
,
entry_id
:
9
},
{
author
:
'
username
'
,
permlink
:
'
post-permlink-8
'
,
blog
:
'
username
'
,
reblog_on
:
'
1970-01-01T00:00:00
'
,
entry_id
:
8
}
]
```
### Get Discussions By Trending
```
js
hive
.
api
.
getDiscussionsByTrending
(
query
,
function
(
err
,
result
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment