Repository
https://github.com/gigatoride/steevie
Telegram bot
https://telegram.me/SteevieBot
New Features
New Command for Account Posts
This is a new command for viewing all account posts with paginating feature (next/previous)
I've used the following utility for paginating that manage the whole operation
paginate: (array, pageSize, pageNumber) => {
--pageNumber;
return array.slice(pageNumber * pageSize, (pageNumber + 1) * pageSize);
}
Then the following code for main variables
const currentPage = opts.currentPage || 1; // default for front-end
const pageSize = 6; // posts per page
const totalPages = Math.ceil(buttons.length / pageSize); // rounds the page number up to the next largest whole number or integer
let currentPagePosts = paginate(buttons, pageSize, currentPage);
New Command for Trending
A new command for viewing Steem trending posts with support for all tags. and also suggests the top 5 tags.
The following code for callback buttons that suggests top tags
steem.api.getTrendingTags(null, limit, (err, result)=>{
// Callback buttons
})
Then after validating the user input
It callbacks a url buttons using map method in javascript
steem.api.getDiscussionsByTrending(query, (err, result) => {
// Callback url buttons using map method
});
Fix notfications
Recently an issue that made notifications not functioning properly with caused by 3rd-party dependency which is steem-js I've replaced it with an event-driven library for better notification handling and stable performance
stream.on('transaction:transfer', (type, data) => {
// Analysis the streamed data
// Push to subscribed user
});