@remind-me

in utopian-io •  11 months ago 

Repository

https://github.com/adasq/remind-me

What is the project about?

One another STEEM blockchain-based bot. It's name is @remind-me. You can mention him in your comment in order to create a reminder.

Why?

The truth is vast majority of posts gets obsolete after payout is being made. If a post (or a comment) includes a promise, a prediction or a bet, you can create a reminder in order to verify it in future. I hope it’s going to spark interesting discussion, once again, but at the time perspective.

On the other hands, you can use it for an ordinary use-cases, including future event (dlive stream reminders etc).

How it works

Mention @remind-me in any comment (as presented in an example below). Then,

  1. you will be responded with the reminder creation confirmation comment.
  2. when the time will pass, you will be notified (by mentioning you) in another comment.

An example:

elear.png

See the full comment context here.

More examples:

@someone, you have just told BTC is going to hit 20 000$ by the end of 2018. 
let's verify it later...

@remind-me on 01.01.2019 12:00
Next live stream is scheduled for tomorrow, same time?
@remind-me in 48 hours
@someone2 I bet this post will receive 300 upvotes... before payout day...
@remind-me in 7 days.

And even more examples...

@remind-me in 30 minutes

@remind-me in two months

@remind-me on 1 April 2019

@remind-me tomorrow

@remind-me on Wednesday at 18:50

Technology Stack

It's a nodejs based application. The one and the only source of truth is a STEEM blockchain (steem package), so there are no third-party data stores collecting information. App architecture is driven by queues. This includes:

  1. add reminder registration comment queue.
  2. add reminder resolution comment queue.
  3. create blockchain comment queue.
  4. fetch block from STEEM blockchain queue.

Why queues? It is ease to maintain, control a flow, retry when error occurs etc. Queues are managed by better-queue package. Reminder date is being retrived from user comment within chrono-node package.

What's more I'm using helper packages, including moment, lodash, uuid, nconf.

Instead of a wall of text, I prepared a diagram presenting general flow of the app:
flow.png

Rules!

RULE 1: Use it in comments, ONLY

Calling @remind-me in posts won't create a reminder.

RULE 2: Keep "@remind-me" and a target date in one line

OK:

...
@remind-me in 10 minutes
...

WRONG:

...
@remind-me
in 10 minutes
...

RULE 3: UTC

You should be aware, that a bot creates a reminder in UTC.

RULE 4: 3 reminders per user a day

To prevent spamming, one account might create three reminders per day.

Roadmap

I am planning to add "reuse reminder feature", which is basically a way of reusing existing reminders among a group of steemians. (Another person can upvote you reminder, so he will also be notified, when the time passes).

I believe SMT / communities will bring some new capabilities, that might extend the app with new features.

How to contribute?

If you feel there is a value in the project, feel free to post your ideas, feature requests, improvements:

https://github.com/adasq/remind-me/issues

GitHub Account

https://github.com/adasq

Cheers people!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Great job buddy !! the idea you had looks awesome :) What i would suggest is to implement aswell a function that also analyses text even if it is on another line...I believe a lot will do this mistake so why not implement it ! :)

quoting your code:

function findMentionLine(comment) {
    return comment.split(/\r?\n/).find(line => line.includes('@' + REMAIND_ME_USERNAME)) || null;
}

function getFutureDateByTextAndContext(text, context) {
    return chrono.parseDate(text, context);
}

function getFurureDateByCommentTextAndContextDate(commentText, contextDate) {
    const mentionText = findMentionLine(commentText);
    const future = getFutureDateByTextAndContext(mentionText || '', moment(contextDate));
    return future ? moment(future) : null;
}

In terms of coding that will not be even a big issue for you. Just read each line of the comment and assign it in to an array of strings (each line of the comment as one element of the array) then loop through the array as per array.length (that will let the code know that if the array.length > 1 there are more lines to look at) and do a text matching into a couple IF statement containing some keyword as (Day, Hour, Minute, etc...) to know where to start looking for the time of the set reminder then pass the result to the other functions.

Again great job man !! i will for sure use it !! and by the way i already forked your repo to keep up to date with whatever you will implement :)

·

Hey!

In the very beginning the entire comment text was allowed to be parsed in order to search for a target date.

What I was concern about was that a random text might be picked by a search algorithm instead of user-intended one.

It's important, as even ordinary words matter, like "today", so a comment starting with "How are you today?" might fool an algorithm.

That might be tricky, so eventually decided to use one-line rule, as it's more secure, but - as you pointed correctly - less user friendly.

Really appreciate your input. Thank you for your comment!
All the best!

·
·

Thank you for your answer!!

I agree that a comment such as "how are you today" could fool the algorythm but in the meantime whoever will tag remind-me is already aware of what he is doing so i dont think he might write such comment.

The only possibility i forsee is that he could write his date/time on another line.

Still the "how are you today" example could be excluded by the algorythm since a reminder will have any date/time keywords but the most important thing is they will use AT or ON as a prefix to their messages most of the time like "ON the 2th of June 2019" or " AT 5:00 a. m.". Thus filtering aswell using this keywords will help in detecting REAL reminders.

Again great job and keep the good work up!!

Cheers

Thanks for the contribution. This will be useful for sure. :) I will try to take advantage of it.

One small note, it seems there is a small typo on that function.


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]

·

Thank you for your moderation effort and a note!
Cheers.

@remind-me in 2 minutes

·

Hey @emrebeyler, I will notify you on July 8th 2018, 8:27:24 pm (UTC)
Later!

·

Hi @emrebeyler!
You asked me in this comment to create a reminder.
It seems the time has passed!

·
·

@remind-me in -2 minutes

·
·
·

It does not dectect the input when it is in a comment of a comment :P read well the description and code :) it just detects for now when it is a single lined string and when it is a main comment to the post !! This is why your last reminder did not work @emrebeyler

·
·
·
·
  ·  10 months ago (edited)

@remind-me tomorrow

it works :)

·
·
·
·
·

Hey @adasq, I will notify you on July 10th 2018, 12:00:00 pm (UTC)
Later!

·
·
·
·
·

LOL okay...i was wrong !! reading the post again: Calling remind-me in posts won't create a reminder. :)

·
·
·
·
·

Hi @adasq!
You asked me in this comment to create a reminder.
It seems the time has passed!

·
·
·
·

-2 minutes seem not to be a valid date, that is why it is ignored.

Hey @adasq
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Congratulations @adasq! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - The results, the winners and the prizes

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

@remind-me last month

Congratulations @adasq! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of comments received

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:
SteemitBoard and the Veterans on Steemit - The First Community Badge.

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!