In the last post I showed with an example how to use getAccountHistory. Today, I want to show how to publish a post or comment using HiveJS.
This is actually quite simple and works via the hive.broadcast.comment function, which you can find here in the documentation.
the parameters for a post
wif your private posting key
parentAuthor leave empty
parentPermlink - should be filled with the 1st tag
author your username with which you post
permlink must be unique, as part of the URL it may only contain certain characters, [a-z,0-9,-]
not allowed are among others spaces, #, ?, capital letters
Miximale length I do not know, but there are certainly! title the title of your post, maximum length not known to me body the content of your contribution
jsonMetadata further data to the contribution among other things the tags, format, with which frontend/app the contribution is published, pictures, Urls.
Actifit passes here various other data like the steps
The parameters for a comment
The parameters are the same, but need to be filled differently.
parentAuthor the name of the post/comment you want to comment.
parentPermlink the permlink of the post or comment you want to comment (last part of the URL)
permlink also unique here, portals usually use re-parentAuthor string so for example "re-hive-coding-asuiglkjfh898zh" if you reply to something from hive-coding. Some portals use the date with time as the string.
You can find a sample code how to publish a post here, use it only locally, never enter your private posting key on jsfiddle!
Since it's quite simple this time, I won't go into the code in detail. If you still have questions, feel free to leave a comment. It's best to mention @mein-senf-dazu to it, so that I get it.
edit
This post was posted with this example-Script! Had to test whether it works
Im letzten Beitrag habe ich an einem Beispiel gezeigt, wie man getAccountHistory nutzen kann. Heute möchte ich zeigen, wie man ein Post oder ein Kommentar mithilfe von HiveJS veröffentlicht.
Das ist eigentlich recht simpel und funktioniert über die Funktion hive.broadcast.comment, die ihr hier in der Dokumentation findet.
die Parameter für einen Beitrag
wif Dein privater Posting-Schlüssel
parentAuthor leer lassen
parentPermlink - sollte mit dem 1. Tag gefüllt werden
author Dein Username, mit dem Du postest
permlink muss einzigartig sein, da Teil der URL darf es nur bestimmte Zeichen enthalten, [a-z,0-9,-]
nicht erlaubt sind u.a. Leerzeichen, #, ?, Großbuchtsaben
Miximale Länge mir nicht bekannt, gibt es aber sicherlich!
Titel der Titel Deines Beitrages, maximale Länge mir nicht bekannt
body der Inhalt Deines Beitrages
jsonMetadata weitere Daten zum Beitrag u.a. die Tags, Format, mit welchem Frontend/App der Beitrag veröffentlicht wird, Bilder, Urls.
Actifit übergibt hier diverse weitere Daten wie z.B. die Schritte
Die Parameter für einen Kommentar
Die Parameter sind die gleichen, müssen aber anders befüllt werden.
parentAuthor der Name dessen Beitrag/Kommentar ihr kommentieren wollt.
parentPermlink der Permlink des Beitrages oder Kommentares zu dem ihr einen Kommentar abgeben wollt (letzter Teil der URL)
permlink auch hier einzigartig, Portale nutzen in der Regel re-parentAuthor-Zeichenfolge also z.B. "re-hive-coding-asuiglkjfh898zh", wenn ihr auf etwas von hive-coding antwortet. Manche Portale nutzen als Zeichenfolge das Datum mit Uhrzeit.
Ein Beispielcode wie man einen Beitrag veröffentlicht findet ihr hier, nutzt diesen nur Lokal, gebt nie Euren privaten Posting-Schlüssel auf jsfiddle ein!
Da es diesmal doch ganz simpel ist, gehe ich nicht auf den Code näher ein. Wer dennoch Fragen hat, kann gern ein Kommentar da lassen. Am besten @mein-senf-dazu erwähnen, damit ich es mitbekomme.
Nachtrag
Dieser Beitrag wurde mit diesem Beispiel gepostet. Musste ja testen ob es klappt ;)
Hivejs: How to publish a post/comment - Wie veröffentlicht man eine... | Ecency
HiveSQL: Age of active accounts
hive-coding ·
How Compressor and Gain Improve Your Audio in Kdenlivehansama ·