ykdojo / friendlyreminderbot

A friendly reminder twitter bot to keep you healthy and happy - not actively maintaining it anymore. Currently working on: https://github.com/ykdojo/defaang
MIT License
65 stars 41 forks source link

figure out a way to organize the reminders better #27

Closed ykdojo closed 2 years ago

ykdojo commented 2 years ago

as we have more and more reminders, it'd be nice to have a way to categorize them better so they're easier to contribute to.

should they be maybe in a JSON or YAML file, for example?

it could look like:

"health reminders":
- "reminder 1"
- "reminder 2"

"productivity reminders":
- "reminder 3"
- "reminder 4"
AevumElectronics commented 2 years ago

{ id: 1, quote: "reminder 1", category:["health reminders", "category2" , "category3" ] }

ykdojo commented 2 years ago

Hmm @AevumElectronics, rather than that, I think the top items should be the categories - so it's easier for people to contribute

erikkristoferanderson commented 2 years ago

I agree that it will be easier to contribute if the top items are categories. I also think it would help if the reminders file is as human-readable as possible. For example, do we need the quotes? How about this:

Health Reminders:
- Reminder 1
- Reminder 2

Productivity Reminders:
- Reminder 3
- Reminder 4

Having no quotes would complicate the logic slightly in main.py, but it would make reminders.txt more pleasing to look at and work with.

ykdojo commented 2 years ago

@ekand that looks great and I love it!

does that format work in a yaml?

erikkristoferanderson commented 2 years ago

@ykdojo I will research the specification for yaml, and get back to you. I think it might need indentation to fit yaml requirements.

erikkristoferanderson commented 2 years ago

@ykdojo On further inspection, the format I suggested above is valid yaml.

I tested it with import yaml, and it ended up making a python object like this:

with open('reminders.txt') as f: categories = yaml.load(f.read(), Loader=yaml.FullLoader)
pprint.pprint(categories)
{'Health Reminders': ['Hey human, remember to drink water',
                      'Hey human, remember to stand up and stretch',
                      'Hey human, remember to exercise from time to time',  # and so on...