#cn-malaysia is a tag for the chinese community in Malaysia. The aim is to get user to post quality chinese content. One of the issue sometimes is that people misunderstood about this tag and start to use it with posts that are not related to chinese content.
In the past, me and @davidke20 are manually checking and advise the user that used #cn-malaysia without containing chinese content to not use this tag.
Features
What feature(s) did you add?
- The bot will check when a post posted on steem with a tag of #cn-malaysia and then based on the content, calculate the amount of chinese words in it.
- Current setting is 20%, if the user's post does not contain more than 20% of Chinese words, it will send in a comment to remind the user
How did you implement it/them?
- Used of 2 regex to parse Chinese words
/[\u4e00-\u9fff]+/g
used to calculate number Chinese words in the post./[\u00ff-\uffff]|\S+/g
used to calculate the number of words in the post.
- Based on the number of Chinese words to Total words, calculate the ratio. When the post does not meet the requirement, a comment is send out by @superoo7-dev (might change to @cn-malaysia in the future)
- Used of 2 regex to parse Chinese words
About Projects
What is the project about?
This is a bot consuming SteemJS API. The bot will send out suggestion to those user that use #cn-malaysia without fulfilling the prerequisite (a certain amount of chinese words).Technology Stack
Node.jsRoadmap
- Constantly update with SteemJS in terms of API changes.
- add in parser to remove links, image and div tags to correctly calculate the ratio.
How to contribute?
GitHub link
This project is on GitHub with MIT License, feel free to send in Pull Request or Issue Filling.
Posted on Utopian.io - Rewarding Open Source Contributors