Here is how you can programmatically retrieve a Steemit account's last transaction

avatar
(Edited)

This simple tutorial teaches you how to programmatically retrieve a Steemit account's last transactions simply pasting a script in any browser window.

NOTES:

  • This script does not requires a pre-existing Steemit account or any private key so it's very safe to use.

STEP 1


Open your favorite browser on any site (I strongly recommend using Brave browser for its speed and security)
and open the DevTools (Ctrl + Shift + J on Linux/Windows and Cmd + Opt + J on Mac)

STEP 2


Open https://cdn.jsdelivr.net/npm/steem/dist/steem.min.js (SteemJs) and copy & paste (Ctrl + A and Ctrl + C) the javascript code displayed on the page into the Browser Console (DevTools) that you opened in the first tab.

STEP 3


Copy & paste my script below in the Console and press enter.

Before doing so, if you want, you can change the target account name and the amount of transactions that you want to retrieve (eg. Instead of 'transisto' and 6 you can use 'marcocasario' and 3). Or leave it as it is to first give it a try..

var getLastNTransactions = (user, N) => new Promise((resolve) => {
  steem.api.getAccountHistory(user, -1, 5000, (err, result = []) => {
    if (err) return console.error('>>> ', err);
    const res = [];
    for (let id = 0; id < result.length; id++) {
      if (result[id][1].op[0] === 'transfer') {
        // console.log(JSON.stringify(result[id]))
        res.push(result[id]);
      }
    }
    const last500Transactions = res.reverse();
    resolve(last500Transactions.slice(0, N));
  });
});
getLastNTransactions('transisto', 6)
  .then(res => console.log('OK >> ', JSON.stringify(res)))
  .catch(err => console.error('Oops, something went wrong:', err));



If you then want to execute the script again for a different user, you only need to paste it again, change what you need and press enter again.

Enjoy!! =]



0
0
0.000
10 comments
avatar

According to the Bible, Charity Means Love (4 of 5)

(Sorry for sending this comment. We are not looking for our self profit, our intentions is to preach the words of God in any means possible.)


Comment what you understand of our Youtube Video to receive our full votes. We have 30,000 #SteemPower. It's our little way to Thank you, our beloved friend.
Check our Discord Chat
Join our Official Community: https://beta.steemit.com/trending/hive-182074

0
0
0.000
avatar

!DERANGED
!COFFEEA
!shop
$trdo
!BEER
for you

@tipu curate

0
0
0.000
avatar

@gaottantacinque, mi aiuti per favore! con chi posso parlare per risolvere il mio problema? io scrivo i miei articoli originali su steemit. ogni giorno e' uno articolo. Ho visto che mack-bot mi fa dislake. Chi potrebbe controlare il mio articolo che io non faccio niente di male. Mi aiuti per piacere. Grazie.

0
0
0.000
avatar
(Edited)

Vai sul profilo @steemflagrewards, apri il link discord e spiega la situazione lì.

Devi postare solo contenuti originali, no tradotti da altri articoli, no riassunti, no foto non tue senza fonte.
Spero tu risolva presto

0
0
0.000