balena-io-experimental/inkyshot

Change the language

niyazaki opened this issue · 5 comments

Hello,
I find this project amazing. I would love to contribute and give a ton of inspirational messages.
I think there's two options to resolve this :

  • add language option in the API
  • add the option to use a CSV/JSON/... File to get the messages

Thank you !

Hey @niyazaki Pull Requests are most welcome 😄

I'll appreciate having that CSV option as well. I gifted an inkyshot to my parents and I'd love the inkyshot to rotate pre-selected quotes (family anecdotes).

Agreed, the CSV is the more versatile answer to this problem. Gonna have a look at your code.

For the language part, I searched a bit and found maybe an API for French citations: https://citations.ouest-france.fr/
But it seems like nobody ever used their API or not for a long time because it's kinda broken. I've sent them an e-mail, I'll keep you in touch and make a Pull Request with this whenever I have time and if they respond/I find another API.

For the CSV part there are two options again :

As I said, I never integrated anything with Balena, so my Pull Request may be a little bit buggy. Plus I don't have any Raspberry Pi to test it. So if you give me a hand @gelbal and correct it, it may be a quick win for everyone.

Pull request is coming. Also, as the CSV file may be of variable length, I plan something based on a randomized variable put in Balena parameter thing. You may have to double-check this (my guess is that I have to announce/declare the variable somewhere in the deploy part but I have no idea or time to look further for this issue).

Here is the pull request :).

Based on https://forums.balena.io/t/maximum-length-of-application-environmental-variables/243168/18 variables may be up to 1MB so I created a CSV_MESSAGE variable.

As already said I'm new to this whole Balena universe and I've read a bit of documentation in order to simplify the work of testing this because I cannot do it myself for technical reasons.

Hope this gets added to the main project in order to help people.

@gelbal thank you in advance for the review.

For the CSV part there are two options again :

PS : Finaly, I did (or at least tried) both