You are viewing a single comment's thread from:

RE: Python Libraries: No More BEEM

in STEMGeeks6 months ago

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):

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()) url = "https://api.hive.blog/rpc"



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

Sort:  
Loading...