how making publications through steemjs

Words
579
Reading
3 min
Listen
Play
8y


hey steemians,

I was somewhat busy but I'm back and with more encourage you that never, as your know I have been publishing on api steem in javascript following the tutorials of the day today i will teach you to publish content through code, i know it's something that not everyone is interested in but if you are a developer this can help you as i will explain each of the parts in depth i also will explain what is 'json_metadata' the which is one part important of the code that see. as in all post always i give the code that i will used the day of today is this:


steem.broadcast.comment(wif, parentAuthor, parentPermlink, author, permlink, title, body, jsonMetadata, function(err, result) {
console.log(err, result);
});

so as you can see from today's publication this is necessary more information that other posts. but calm little by little i will explain each one of these, mainly the more dificult is of the jsonMetadata for the simple fact that this code in inside carries different Parameters that indicate ulr,users,images etc.
so without saying more let's explain the different parameters of the code.

wif : As seen in the previous post, this is the key to posting or active key depending on what is being done.
parentAuthor: As we what we want to do is make a publication this must be an empty string
parentPermlink: This part is quite important since it is the main label of your post
author: The name of your account
permlink: This part is the what you is the one that you can observe in the URL address of your post
title: Title of your post
body: The body is the complete code of the content of your post in html and using \n for the line breaks that are inside this.
jsonMetadata: Important part of the code as it houses inside informing you that your post will be

Once you have the previous data, explain that it is the jsonMetadata

jsonMetadata

This part is difficult to explain since within this there are different factors, since it changes depending on what is required to show, but summarizing within this are the different links that one writes in the publication besides this also the users and tag used in your publication you can verify within this any publication that you make on the site Steemd is explained in a better way, this can be seen as follows


{"tags":["number","1","2","3"],
"image":
["",
"",
""],
"app":"steemit/0.1","format":"markdown"}

if we run the code with the information given this will vote us in json that will give us the information that will be in our post of not being made and that would find an error this would be voted as this is defined the code first generates the error to verify that the post is fine and then the code if everything went well and there was no error during the publication of the post

like something else as soon as this publication is sent I will show you the jsonMetadata code of this and the different information that I requested in the code except for the body since the code of this one is too long to show it

information of this post



parent_author: '',
parent_permlink: 'steemdev',
author: 'ederaleng',
permlink: 'how-making-publications-through-steemjs',
title: 'how making publications through steemjs',
json_metadata: '{"tags":["steemdev","education","technology","busy","coding"],"image":["https://images.unsplash.com/photo-1509718443690-d8e2fb3474b7?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=540f14856de81b9306b3bfc870827fe7&auto=format&fit=crop&w=750&q=80"],"links":["https://unsplash.com/photos/IKUYGCFmfw4"],"app":"steemit/0.1","format":"markdown"}' } ] }

no more to say thank you for reading and I hope you have helped and help my post


fountain images 1

how making publications through steemjs | Ecency