Release of steem-upvote-util Library

in #utopian-io6 years ago (edited)

Few days ago, I started a new project called "steem-upvote-util". This project will do 2 quality check on the post on steemit. This library will be implemented into superoo7/oo7-discord. Part of the reason behind making this library is that I want to separate between the discord bot codes and the quality checking codes, and whoever interested on using this part of the project can just use the library.

Currently this project is on NPM.

Screen Shot 2018-02-14 at 1.06.33 PM.png

The project contribution is done with 19 commits. And the current version is v1.1.0 .

New Features

  • What feature(s) did you add?
    • Quality check
      • The content is not plagiarize. (check by cheetah bot)
      • Make sure post is not too old. (3.5 days standard, can be modify)
      • Post is not too short. Upvote weightage scale with length of post. (The body of post will remove links and image to ensure that the content are only words)
    • Upvote
      • A layer above of steem-js library for handling error.
  • How did you implement it/them?
    • This project make use of a few regex.
      • /!\[([^\]]*)]\(([^\)]*)\)/g to remove image tag like ![img](https://google.com)
      • /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9]\.[^\s]{2,})/g to remove links like https://google.com
    • Currently this project has 2 main API. One to check the post, another is to upvote.
  • API example

Check Quality

const util = require('steem-upvote-util');

const author = 'superoo7';
const permlink = 'gopro-hero-6-2018-02-13-09-33-41';
const config = {
  maximumPostAge: 302400000, // 3.5 days
  minimumLength: 250, // 250 characters
  optimumLength: 3000 // 3000 characters
};

util.main(author, permlink, config).then(data => console.log(data));

Screen Shot 2018-02-14 at 1.01.16 PM.png
From the output, it will generate a message for posting in discord chat.

Upvote

const util = require('steem-upvote-util');

const author = 'superoo7';
const permlink = 'gopro-hero-6-2018-02-13-09-33-41';
const weightage = 50 * 100;

util.upvote('STEEM_POSTING_KEY', 'STEEM_USERNAME', author, permlink, weightage)
    .then(data => {
      if (data === 'ERROR') {
        console.log('unable to upvote');
      } else {
        console.log('upvoted');
      }
    });

Read more on GitHub.

About this Projects

  • What is the project about?
    This is an NPM Library for checking Quality Post on Steem. Currently, the quality is based on Cheetah Bot and length of the content. In addition to that, the upvote weightage is based on the length of the content.
  • Technology Stack
    Node.js
  • Roadmap
    • In future, instead of rely Cheetah Bot, using Plagerism API would be more appropriate.
    • A guide on ES2015 on the README.md
    • Regex to remove other MarkDown tag like <center></center>
    • Implement of a testing framework.
    • Implement this library into superoo7/oo7-discord
  • How to contribute?

This project is on Github at TeamMalaysia/steem-upvote-util , you can file issue and send pull request here.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Thank you moderator.

@superoo7 Is there a tutorial on how to create a bot that will be implement into Discordapp?

maybe a video tutorial

That will be great too because I do want to learn about it. Thanks in advance.

Most likely posting on my seconday account @superoo7-dev

I have few things to do also before even start that tutorial

Noted & thanks. I had accidentally click mute on you, haha. I will follow your both account for more updates. Thanks again.

no issue haha

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by superoo7 from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

Hey @superoo7 I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 63793.25
ETH 3410.80
USDT 1.00
SBD 2.59