Hivekeychain: how to send a comment - Wie sendet man ein Kommentar

DE (below)

Hallo liebe Community,

mein letzter Beitrag ist schon wieder etwas her, in dem ich erklärt habe, wie man mit Hivekeychain seine Hive-Engine Token verkaufen kann.

Heute geht es um das Absenden eines Kommentars mit der Hive Keychain. Die Dokumentation zur Integration findet ihr unter diesem Link:
https://github.com/hive-keychain/hive-keychain-extension/blob/master/documentation/README.md

Dort findet man auch direkt die Funktion requestPost, mit der man sowohl einen Post als auch einen Kommentar absenden kann.

Nun, ich kann es nicht. Ich habe es nicht geschafft, mit dieser Funktion einen Kommentar abzusenden. Bin scheinbar nicht der einzige mit diesem Problem. Im Discord wurde ich fündig und habe es dann mit der Funktion requestBroadcast versucht.

let parentlink="";
let parentauthor="";

let json_metadata= new Object();
json_metadata.tags= new Array();
json_metadata.tags.push("hivecoding");
json_metadata.app="hivegadgets/1.0.0";
json_metadata.format="markdown+html";
json_metadata.description="Hivecoding";



var d=new Date().toISOString().toLowerCase().split(":").join("");
d=d.split("-").join("");
d=d.split(".").join("");
var permlink2="re-"+parentauthor+"-"+d;

var body=`This is a comment`;

const keychain = window.hive_keychain;
const comment = {
    author: $("#username").val(),
    title: '',
    body: body,
    parent_author: parentauthor,
    parent_permlink: parentlink,
    permlink: permlink2,
    json_metadata: JSON.stringify(json_metadata),
};


keychain.requestBroadcast($("#username").val(), [['comment',comment]], 'Posting', (response) => {
  console.log(response);
});

Bitte beachtet, wie der zweite Parameter auszusehen hat, ein Array im Array. Sonst funktioniert es nicht. Es ist eigentlich recht simpel, inzwischen konnte ich auch ein Login mit der Hive Keychain für @hivegadgets realisieren. Habt ihr Interesse daran, wie das bei mir funktioniert? Soll ich dazu auch einen Beitrag erstellen?

Wer übrigens www.hivegadgets.com noch nicht kennt, sollte mal vorbei schauen.

EN

Hello dear community,

it's been a while since my last post, where I explained how to sell your Hive Engine tokens with Hivekeychain.

Today it's about submitting a comment with the Hive Keychain. You can find the documentation for the integration at this link:
https://github.com/hive-keychain/hive-keychain-extension/blob/master/documentation/README.md

There you can also directly find the function requestPost, with which you can send both a post and a comment.

Well, I can't. I haven't managed to send a comment with this function. Am apparently not the only one with this problem. I found what I was looking for in Discord and tried the function requestBroadcast.

``Javascript
let parentlink="";
let parentauthor="";

let json_metadata= new Object();
json_metadata.tags= new Array();
json_metadata.tags.push("hivecoding");
json_metadata.app="hivegadgets/1.0.0";
json_metadata.format="markdown+html";
json_metadata.description="Hivecoding";

var d=new Date().toISOString().toLowerCase().split(":").join("");
d=d.split("-").join("");
d=d.split(".").join("");
var permlink2="re-"+parentauthor+"-"+d;

var body=This is a comment;

const keychain = window.hive_keychain;
const comment = {
author: $("#username").val(),
title: '',
body: body,
parent_author: parentauthor,
parent_permlink: parentlink,
permlink: permlink2,
json_metadata: JSON.stringify(json_metadata),
};

keychain.requestBroadcast($("#username").val(), [['comment',comment]], 'Posting', (response) => {
console.log(response);
});

Please note what the second parameter has to look like, an array in the array. Otherwise it won't work. It's actually quite simple, in the meantime I was able to realise a login with the Hive Keychain for @hivegadgets. Are you interested in how this works for me? Should I also write a post about it?

By the way, if you don't know www.hivegadgets.com yet, you should take a look.


Translated with www.DeepL.com/Translator (free version)
Sort:  

Thank you for sharing this. It looks simple enough! !PIZZA

It is

Hello,
this Comment has been upvoted with 1%, thanks to @mein-senf-dazu who burned 1000 PLANET
With this burn @mein-senf-dazu is actively participating in the CLEAN PLANET reward protocol.
@mein-senf-dazu is helping @cleanplanet to grow with the curation.
Thanks for your help
@cleanplanet

Hello,
this Comment has been upvoted with 1%, thanks to @mein-senf-dazu who burned 1000 PLANET
With this burn @mein-senf-dazu is actively participating in the CLEAN PLANET reward protocol.
@mein-senf-dazu is helping @cleanplanet to grow with the curation.
Thanks for your help
@cleanplanet

Hello,
this Comment has been upvoted with 1%, thanks to @mein-senf-dazu who burned 1000 PLANET
With this burn @mein-senf-dazu is actively participating in the CLEAN PLANET reward protocol.
@mein-senf-dazu is helping @cleanplanet to grow with the curation.
Thanks for your help
@cleanplanet

🍕 PIZZA !

I gifted $PIZZA slices here:
@cryptothesis(1/15) tipped @hive-coding (x1)

Learn more at https://hive.pizza!

Congratulations @hive-coding! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You distributed more than 1250 upvotes.
Your next target is to reach 1500 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

The Hive Gamification Proposal
Support the HiveBuzz project. Vote for our proposal!