RE: RE: Python Libraries: No More BEEM
You are viewing a single comment's thread from:

RE: Python Libraries: No More BEEM

Words
98
Reading
1 min
Listen
Play
2y

I think you can use the ‘requests’ library to make HTTP requests to the Hive API.

Suppose you have a function that publishes a publication using BEEM:


from beem import Hive

def publicar_mensaje(usuario, clave_privada, mensaje):
Hive = Hive(keys=[clave_privada])
hive.post(mensaje, author=usuario)


You can replace it using the Hive API directly with requests:


import requests

def publicar_mensaje(usuario, clave_privada, mensaje):
url = "https://api.hive.blog/rpc"
payload = {
"jsonrpc": "2.0",
"method": "condenser_api.post",
"params": [usuario, clave_privada, "", mensaje, "", False],
"id": 1,
}
response = requests.post(url, json=payload)
print(response.json())


Or something like that. It's a matter of investing another weekend and doing the relevant tests.