Repository
https://github.com/gigatoride/steemradar.js
SteemRadar
Logo design by 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 .everyas 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