VidYen / VidYen-WordPress-Plugins

VidYen Plugins for WordPress
GNU General Public License v2.0
9 stars 2 forks source link

STEEM CURLs #169

Open VidYen opened 5 years ago

VidYen commented 5 years ago

https://developers.steem.io/apidefinitions/#apidefinitions-broadcast-ops-comment

Since I know you can do curls in php.. i'm going to investigate doing json rpc curls to STEEM

curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_account_history", "params":{"account":"steemit", "start":1000, "limit":1000}, "id":1}' https://api.steemit.com

curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_account_history", "params":{"account":"steemit", "start":-1, "limit":10000}, "id":1}' https://api.steemit.com
VidYen commented 5 years ago

Since we do these all the damn time:

https://github.com/changelly/changelly-examples/blob/master/php/example.php

<?php
    $apiKey = 'YOUR_API_KEY';
    $apiSecret = 'YOUR_API_SECRET';
    $apiUrl = 'https://api.changelly.com';
    $message = json_encode(
        array('jsonrpc' => '2.0', 'id' => 1, 'method' => 'getCurrencies', 'params' => array())
    );
    $sign = hash_hmac('sha512', $message, $apiSecret);
    $requestHeaders = [
        'api-key:' . $apiKey,
        'sign:' . $sign,
        'Content-type: application/json'
    ];
    $ch = curl_init($apiUrl);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $message);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $requestHeaders);

    $response = curl_exec($ch);
    curl_close($ch);
    var_dump($response);
VidYen commented 5 years ago

I believe we can get the STEEM API transaction done in a week if this pans outs.