SteemRadar.js - A New Major Release, New Features, Update 1.0.0
Repository
https://github.com/gigatoride/steemradar.js
SteemRadar
Logo design by @gigatoride only licensed for contributions related to this project
New Features
Support multiple funds tracking (Real-Time)
This is a new feature for funds tracking to support multi-track
Also, the code is now shorter and more readable the whole operation dependent upon the tracking of each transfer and saving the latest as a previous variable and then match the latest with previous
The following code is the pushing and matching process
const previousTrxData = nextTarget.operations[0][1];
const transactions = await api.getTransactions();
for (const trx of transactions) {
const [latestTrxType, latestTrxData] = trx.operations[0];
const isUnique = latestCatch !== trx.transaction_id;
if (isUnique && latestTrxType === 'transfer') {
const isSenderMatch = opts.multi
? linkedAccounts.includes(latestTrxData.from)
: latestTrxData.from === previousTrxData.to;
if (isSenderMatch) {
latestCatch = trx.transaction_id;
nextTarget = trx;
linkedAccounts.push(latestTrxData.to);
yield trx;
}
if (targetTrx && !exchanges.includes(previousTrxData.to)) out = true;
Scan for blockchain posts
A new method for blockchain scans for the latest posts that recently published on steem blockchain in real-time
it keeps tracking by the author's names or the whole blockchain accounts
The verify process as the following it first checks this isn't a duplicate and then checks it is a post without parent author I mean then it matches the user input with the blockchain transaction author name or just optional if authors are false!
const isUnique = latestCatch !== trx.transaction_id;
const isPost = txType === 'comment' && !txData.parent_author;
const isAuthorExist = (authors && authors.includes(txData.author)) || !authors;
if (isUnique && isPost && isAuthorExist) {
trx.transaction_id = latestCatch;
yield trx;
}
Scan for blockchain comments
A new method related to the previous one to keep scanning for latest users comments by authors or parent authors or even both of them.
The verify process as the following it first checks this isn't a duplicate and then checks it is a comment with the parent author which is the opposite in this case then it matches the user input with the blockchain transaction author & parent author name or just optional if authors are false!
const isUnique = latestCatch !== trx.transaction_id;
const isComment = txType === 'comment' && txData.parent_author;
const isParentAuthorExist = (parentAuthors && parentAuthors.includes(txData.parentAuthor)) || !parentAuthors;
const isAuthorExist = (authors && authors.includes(txData.author)) || !authors;
if (isUnique && isComment && isParentAuthorExist && isAuthorExist) {
trx.transaction_id = latestCatch;
yield trx;
}
Full support for utopian.io contributions posts
In the previous code, I've been using the node-utopian-rocks API wrapper or I can say directly utopian.rocks API
Each scanning instance is making many requests if I've raised the milliseconds for every check it can miss some posts
also, the low milliseconds can be some type of brute force on the API so the previous code wasn't the perfect solution
As the scanning process needs a stable flow of data some times the utopian.rocks API is not available or functioning
I've made a decision to rely on the blockchain and to analyze each post by metadata like tag and the main category for each post instead of utopian.rock API. as it going to be faster and more reliable
The following is the supported categories for this method:
- development
- copywriting
- graphics
- analysis
- social
- documentation
- blog
- bug-hunting
- ideas
- video-tutorials
- tutorials
- anti-abuse
Please note that task requests aren't currently supported will be added soon
Improvements & Bug Fixes
Better utils with built-in modules
- isProfane
- isBlacklisted
Update 1.0.1 for bug fix with some methods
This commit is a patch forgetProfanitity()
And getBlacklisted()
to fix some errors with the scan process.
Also a fix for utils isProfane()
to use .some
method instead of .every
as it tests whether at least one word in the words array passes the profane test implemented by the profanity function. It returns a Boolean
value.
Also, it fixes isBlacklisted()
missing chunk push for rawData
Better readable code, Built-in utilities, Less dependency!
As I've mentioned in the previous contribution post. in what's next part.
- Add isValidAccountNames to utils for shorter code
- Add get to method names
- Apply built-in readable streams utility
- Describe if/else statements with variables
- Improve code readability
- Merge exchanges to config with the ability to customize it
- Add optional/null signs for jsdoc
- Remove most of the dependencies
Testing
Clone the repository:
git clone https://github.com/gigatoride/steemradar.js.git
Run test command:
npm test
Commits
on Jun 13, 2019 - Jun 20, 2019
https://github.com/gigatoride/steemradar.js/commits/master
Thank you for your contribution!
for (const trx of transactions) {
and use a filter call back to remove the duplication code in getPosts, getComments.Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Chat with us on Discord.
[utopian-moderator]
Thanks for the review.
Also parameters documented here
Thank you for your review, @justyy! Keep up the good work!
Hi @gigatoride!
Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server
Congratulations @gigatoride! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
To support your work, I also upvoted your post!
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Hey, @gigatoride!
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!
Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!