SteemAPI Tutorial Getting the latest post of a user?

Hey Steemians In this post i going to show how we can use the steem API to get the latest post details of a specific user.
We are going to be using jsfiddle if you do not know how to use it i would suggest going to my last post


Apisssss.gif

There are a number of ways to get the users last post, we are going to be using the function

steem.api.getBlogEntries(account,entryid,limit,callback)

As you can see there are 4 parameter(account,entryid,limit,callback).So we can essentially get any single post from the users given we know the entry id for a given post.In this tutorial however i will use entryID as an arbitrary large number so as to get the last post from the user.

Parameter entry

  • account:ajkapss
  • entryid:9999
  • limit:1
  • Code Example

    
    steem.api.getBlogEntries("ajkapss", 9999, 1, function(err, data)
    {
        console.log(err, data[0]);
      var Author=document.createElement('li');
      Author.innerHTML=("Author name :"+data[0].author);
      var permLink=document.createElement('li');//also the title
      permLink.innerHTML=("PermLink :"+data[0].permlink);
      ul.appendChild(Author);
      ul.appendChild(permLink);
    });
    

    Here is the link to the jsfiddle page to view the code

    H2
    H3
    H4
    3 columns
    2 columns
    1 column
    14 Comments
    Ecency