ULOG #11: Developing the Ulog-Bot

in #ulog6 years ago (edited)

image.png

One of the quotes by Terry that stuck with me is his reply to the question "how to be like you?"

To become like me, you will have to stubbornly become the awesomest version of "YOU".

And that's where ulogs came forth.

Personally, I believe one of the hardest things in life is bringing out the best in people and I appreciate anyone who tries. This development contribution is an attempt to give back to Terry - to realize his ideas into fruition.

Repository

https://github.com/surpassinggoogle/ulog-communties

Task Request

https://steemit.com/utopian-io/@surpassinggoogle/task-request-help-us-develop-a-summon-bot-that-can-vote-and-comment-on-authors-designed-to-run-ulog-communities-and-ulog-subtags

Pull Requests

Implementation
  1. https://github.com/surpassinggoogle/ulog-communties/pull/1 - the base codes. It didn't have all the functions needed, just enough to have it comment on a post and include all the checks specified in the task request.
  2. https://github.com/surpassinggoogle/ulog-communties/pull/4 - instead of getting the certified uloggers from the config file, I opted to get them from @uloggers's following
  3. https://github.com/surpassinggoogle/ulog-communties/pull/5 - added the voting function and refactored some variable names to make the code more readable.
Refactors
  1. https://github.com/surpassinggoogle/ulog-communties/pull/2/files - due to the limited RC of my test account, the comment function was disabled in PR #1. This PR just enabled the comment function for Terry to be able to test it in his production environment. As what can be seen in the history of commits, I struggled with making the codes deployable to Heroku. This was the first time I developed in Typescript, and from hindsight, I think it would have been better if I used normal Javascript.
  2. https://github.com/surpassinggoogle/ulog-communties/pull/3 - as I tested the codes in my staging environment, some config variables felt better defined as environment variables. That's what this PR included.

Feature in Action

https://ulogs.org/@east.autovote/ulog-testing-ulog-bot

image.png

Lesson Learned

Developing this bot was something new for me. There were two main motivators for me to take this task:

  1. the bounty that came with it, and
  2. the opportunity to build a bot that I've been planning to study ever since I became part of #blockchainbi

One of the struggles I had was making the base codes work with Heroku. I'm not familiar with Typescript and I didn't know that the codes needed to be built to convert the *.ts files to *.js and then start the app using these generated .js in Heroku's worker procfile.

Struggles come with learning.

GitHub Account

https://github.com/eastmaels

This post was made from https://ulogs.org

Sort:  

Thank you for your contribution. Really like Lesson Learned section, it shows the effort made to create the bot. There are task-runner which actually converts the .ts files to .js files which can be included in the package.json and run when you are trying to deploy the application.

It's an actually different type of bot where the upvote will be done based on the comment, and its done very nicely. I would have loved to see some of the tests in the codebase :)


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? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thanks @codingdefined. Yes, I tried looking for a code base that I was most familiar with. I saw python and ruby based projects but I'm not that confident with my coding skills for these two languages so I opted with one close to JavaScript which was TyprScript.

Thanks for the tip on including task-runner in package.json and the suggestion to include tests in the code base. I'll try to include some on my next contribution.

Thank you for your review, @codingdefined!

So far this week you've reviewed 9 contributions. Keep up the good work!

Hi @eastmael, I'm @checky ! While checking the mentions made in this post I noticed that @ulogger doesn't exist on Steem. Did you mean to write @uloggers ?

If you found this comment useful, consider upvoting it to help keep this bot running. You can see a list of all available commands by replying with !help.

Nice it will be for the ulog community cool work :)

Hi @eastmael!

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

Hey, @eastmael!

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!

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.033
BTC 62559.43
ETH 3092.10
USDT 1.00
SBD 3.86