Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Motivational Quotes feature in main branch and Quotes API improvement #457

Open
ceskyDJ opened this issue Jan 9, 2025 · 37 comments
Open
Assignees
Labels
enhancement New feature or request work in progress The issue is on progress to fix

Comments

@ceskyDJ
Copy link
Contributor

ceskyDJ commented Jan 9, 2025

Hi guys! I just realized I don't have a motivational quotes feature even though I'm synced with the main branch. The feature is there when I try to install the extension from the Chrome store. Do you know what could be wrong?

I don't see a switch for this feature in the side menu, so I can't turn it on.

@prem-k-r
Copy link
Collaborator

prem-k-r commented Jan 9, 2025

For Chrome web store, we have had to remove the search engine selector feature to comply with it's policies.
After removing it, the place below searchbar felt empty.. so quotes feature was implemented.
We have yet to apply the same in main branch.. need to do something like.. if hide search engines toggle is on then only quotes toggle becomes active.
Also have to do something with quote api.. probably create a json file and fetch randomly from it.

@ceskyDJ
Copy link
Contributor Author

ceskyDJ commented Jan 9, 2025

Ah, I see. I found that it misses a Czech translation, so I wanted to try the feature on my place and translate missing strings.

Btw, do you fetch quotes based on language?

@prem-k-r
Copy link
Collaborator

prem-k-r commented Jan 9, 2025

Only English for now, APIs are problem
Have to consider:
free, keyless, with large rate limit, multi-language support/different api for each language

@ceskyDJ
Copy link
Contributor Author

ceskyDJ commented Jan 9, 2025

I understand. I think this should be prefatched, as it doesn't need to be pulled regularly, as it doesn't rely on freshness like weather. I think if you get somewhere (legally) let's say about 30 quotes per language (maybe more for English) and display them randomly, it would be just great. Of course 365/366 quotes per language, where for each day would be one quote, would be another level. However, I think it's not necessary. It'd be pretty hard to get that number of quotes and it'd take a little more disk space, too.

@MuntasirSZN
Copy link

Hi guys! I just realized I don't have a motivational quotes feature even though I'm synced with the main branch. The feature is there when I try to install the extension from the Chrome store. Do you know what could be wrong?

I don't see a switch for this feature in the side menu, so I can't turn it on.

Yeah same for me.

@MuntasirSZN
Copy link

I understand. I think this should be prefatched, as it doesn't need to be pulled regularly, as it doesn't rely on freshness like weather. I think if you get somewhere (legally) let's say about 30 quotes per language (maybe more for English) and display them randomly, it would be just great. Of course 365/366 quotes per language, where for each day would be one quote, would be another level. However, I think it's not necessary. It'd be pretty hard to get that number of quotes and it'd take a little more disk space, too.

I don't know but what about get around 15 quotes, save it in indexed db or local storage, and refresh whenever it reaches 0 quotes?

@MuntasirSZN
Copy link

Hey @prem-k-r I think you should look at this -> https://github.com/public-apis/public-apis?tab=readme-ov-file Probably, you might get a no auth multi language free api.

@ceskyDJ
Copy link
Contributor Author

ceskyDJ commented Jan 12, 2025

I don't know but what about get around 15 quotes, save it in indexed db or local storage, and refresh whenever it reaches 0 quotes?

It sounds like a valid solution, at least at the first view. I know there are pretty significant problems with API keys for weather, so if we won't be able to find free keyless API, I don't think it's a good idea to go this way.

@ceskyDJ
Copy link
Contributor Author

ceskyDJ commented Jan 12, 2025

@prem-k-r, I found that WikiQuotes should fit our requirements. There is an API for it: https://en.wikiquote.org/w/api.php. Some libraries are using it, e.g., this for Python: https://github.com/FranDepascuali/wikiquotes-python-api. You can get quotes for many languages by changing EN for the code of the target language (e.g., https://cs.wikiquote.org/w/api.php for Czech).

@ceskyDJ
Copy link
Contributor Author

ceskyDJ commented Jan 12, 2025

Hey @prem-k-r I think you should look at this -> https://github.com/public-apis/public-apis?tab=readme-ov-file Probably, you might get a no auth multi language free api.

I browsed this list. I found these APIs are working and don't need an API key:

The problem is they are just for English.

@itz-rj-here
Copy link
Collaborator

Zenquotes blocks the quotes and tells to use their apis for the quotes.

@itz-rj-here
Copy link
Collaborator

And the quotesgarden is a npm package quotes. We don't use any package so no use.

@itz-rj-here
Copy link
Collaborator

Quotesondesign... Ig we don't need that for now.

@ceskyDJ
Copy link
Contributor Author

ceskyDJ commented Jan 13, 2025

@itz-rj-here, I think you should look at the WikiQuotes, it looks promising.

@MuntasirSZN
Copy link

@itz-rj-here, I think you should look at the WikiQuotes, it looks promising.

+1

@itz-rj-here
Copy link
Collaborator

@itz-rj-here, I think you should look at the WikiQuotes, it looks promising.

It's kind of wikipedia. But they doesn't have any api's :(

@itz-rj-here
Copy link
Collaborator

Or maybe. Wait a min...

@itz-rj-here
Copy link
Collaborator

@prem-k-r what you think about it?
https://codepen.io/erenonur/pen/NQXJMN

@MuntasirSZN
Copy link

@prem-k-r what you think about it? https://codepen.io/erenonur/pen/NQXJMN

Damn thats good.

@ceskyDJ
Copy link
Contributor Author

ceskyDJ commented Jan 13, 2025

@prem-k-r what you think about it?
https://codepen.io/erenonur/pen/NQXJMN

Looks usable. It supports many languages, as I mentioned before (just replace en with different language code in the API URL), there is no API key, it's free. I think this is, what we looked for.

@itz-rj-here
Copy link
Collaborator

@prem-k-r what you think about it?
codepen.io/erenonur/pen/NQXJMN

Looks usable. It supports many languages, as I mentioned before (just replace en with different language code in the API URL), there is no API key, it's free. I think this is, what we looked for.

I can see it require us to select a author's name of the quotes to show the quotes.

@MuntasirSZN
Copy link

MuntasirSZN commented Jan 13, 2025

@prem-k-r what you think about it?
codepen.io/erenonur/pen/NQXJMN

Looks usable. It supports many languages, as I mentioned before (just replace en with different language code in the API URL), there is no API key, it's free. I think this is, what we looked for.

I can see it require us to select a author's name of the quotes to show the quotes.

Its the only downside, but I think you can put some good authors names like 30 or less or more probably. If we put that aside, its the best among all the api's. Idk, but is there any api to get some good authors names? (maybe there is, or no, but if there is one, we can chain them together)

@prem-k-r
Copy link
Collaborator

I understand. I think this should be prefatched, as it doesn't need to be pulled regularly, as it doesn't rely on freshness like weather. I think if you get somewhere (legally) let's say about 30 quotes per language (maybe more for English) and display them randomly, it would be just great. Of course 365/366 quotes per language, where for each day would be one quote, would be another level. However, I think it's not necessary. It'd be pretty hard to get that number of quotes and it'd take a little more disk space, too.

I don't know but what about get around 15 quotes, save it in indexed db or local storage, and refresh whenever it reaches 0 quotes?

That's what we were doing.. but currently switched to an api which cannot give multiple quotes at once.

@MuntasirSZN
Copy link

MuntasirSZN commented Jan 13, 2025

I understand. I think this should be prefatched, as it doesn't need to be pulled regularly, as it doesn't rely on freshness like weather. I think if you get somewhere (legally) let's say about 30 quotes per language (maybe more for English) and display them randomly, it would be just great. Of course 365/366 quotes per language, where for each day would be one quote, would be another level. However, I think it's not necessary. It'd be pretty hard to get that number of quotes and it'd take a little more disk space, too.

I don't know but what about get around 15 quotes, save it in indexed db or local storage, and refresh whenever it reaches 0 quotes?

That's what we were doing.. but currently switched to an api which cannot give multiple quotes at once.

Dummyjson api, if I am not mistaken.

#403

@ceskyDJ
Copy link
Contributor Author

ceskyDJ commented Jan 13, 2025

@prem-k-r what you think about it?
codepen.io/erenonur/pen/NQXJMN

Looks usable. It supports many languages, as I mentioned before (just replace en with different language code in the API URL), there is no API key, it's free. I think this is, what we looked for.

I can see it require us to select a author's name of the quotes to show the quotes.

You can use this endpoint to get a random page ID: https://en.wikiquote.org/w/api.php?action=query&list=random&format=json. More information is here: https://en.wikiquote.org/w/api.php?action=help&modules=query%2Brandom.

@ceskyDJ
Copy link
Contributor Author

ceskyDJ commented Jan 14, 2025

I looked at it a bit. As there is even a library for extracting random quotes from WikiQuotes, it's based on selection of random content page from WikiQuotes and extraction of potential quotes from there. As there are a lot of content pages without quotes, it quite often produces nonsense outputs. So, the option is to first select random author and after use your existing script for selecting his/her/their random quote. Alternatively we can just make a static list as you proposed. What do you think?

@itz-rj-here
Copy link
Collaborator

First of all. I think for now we will stick to the current quote api. We can add the wikiquotes later. As I'm already sick for 2 days. Also we are currently working on the responsiveness of the extention. So we might need time.

@MuntasirSZN
Copy link

MuntasirSZN commented Jan 15, 2025

I looked at it a bit. As there is even a library for extracting random quotes from WikiQuotes, it's based on selection of random content page from WikiQuotes and extraction of potential quotes from there. As there are a lot of content pages without quotes, it quite often produces nonsense outputs. So, the option is to first select random author and after use your existing script for selecting his/her/their random quote. Alternatively we can just make a static list as you proposed. What do you think?

If we do fixed list, then we probably need add a settings option to add more authors. But, the problem is that they won't get outside of them. Or, if we do random selection, then we need to implement multiple quotes at once, as there isn't a fixed chance that that page has a quote.

Edit: I am thinking this way. Your implementation might vary. @itz-rj-here Anything you thought? I am just reading through their massive api.

@itz-rj-here
Copy link
Collaborator

I looked at it a bit. As there is even a library for extracting random quotes from WikiQuotes, it's based on selection of random content page from WikiQuotes and extraction of potential quotes from there. As there are a lot of content pages without quotes, it quite often produces nonsense outputs. So, the option is to first select random author and after use your existing script for selecting his/her/their random quote. Alternatively we can just make a static list as you proposed. What do you think?

If we do fixed list, then we probably need add a settings option to add more authors. But, the problem is that they won't get outside of them. Or, if we do random selection, then we need to implement multiple quotes at once, as there isn't a fixed chance that that page has a quote.

Edit: I am thinking this way. Your implementation might vary. @itz-rj-here Anything you thought? I am just reading through their massive api.

I already saw that... If we had a perfect quotes api like zenquotes we could continue. But cause of there is no free quotes system, we can't continue. Almost most of the free quotes got discontinued after 2022.
If we continue with the wikiquotes we need to deep check the whole api system so if there anything else we can do.

@ceskyDJ
Copy link
Contributor Author

ceskyDJ commented Jan 15, 2025

Seems reasonable to me. I'd keep this issue open for updated information about possible future solutions.

@MuntasirSZN
Copy link

MuntasirSZN commented Jan 15, 2025

I looked at it a bit. As there is even a library for extracting random quotes from WikiQuotes, it's based on selection of random content page from WikiQuotes and extraction of potential quotes from there. As there are a lot of content pages without quotes, it quite often produces nonsense outputs. So, the option is to first select random author and after use your existing script for selecting his/her/their random quote. Alternatively we can just make a static list as you proposed. What do you think?

If we do fixed list, then we probably need add a settings option to add more authors. But, the problem is that they won't get outside of them. Or, if we do random selection, then we need to implement multiple quotes at once, as there isn't a fixed chance that that page has a quote.

Edit: I am thinking this way. Your implementation might vary. @itz-rj-here Anything you thought? I am just reading through their massive api.

I already saw that... If we had a perfect quotes api like zenquotes we could continue. But cause of there is no free quotes system, we can't continue. Almost most of the free quotes got discontinued after 2022.
If we continue with the wikiquotes we need to deep check the whole api system so if there anything else we can do.

Wikiquotes will continue for many years, its maintained by mediawiki, they also maintain wikipedia so no worries!

Edit: I am making a cli tool named getquotes, written in rust. Because of that, I am everyday chugging up the api. Maybe you will get a pr from me ( I know web development also).

@itz-rj-here
Copy link
Collaborator

I looked at it a bit. As there is even a library for extracting random quotes from WikiQuotes, it's based on selection of random content page from WikiQuotes and extraction of potential quotes from there. As there are a lot of content pages without quotes, it quite often produces nonsense outputs. So, the option is to first select random author and after use your existing script for selecting his/her/their random quote. Alternatively we can just make a static list as you proposed. What do you think?

If we do fixed list, then we probably need add a settings option to add more authors. But, the problem is that they won't get outside of them. Or, if we do random selection, then we need to implement multiple quotes at once, as there isn't a fixed chance that that page has a quote.
Edit: I am thinking this way. Your implementation might vary. @itz-rj-here Anything you thought? I am just reading through their massive api.

I already saw that... If we had a perfect quotes api like zenquotes we could continue. But cause of there is no free quotes system, we can't continue. Almost most of the free quotes got discontinued after 2022.
If we continue with the wikiquotes we need to deep check the whole api system so if there anything else we can do.

Wikiquotes will continue for many years, its maintained by mediawiki, they also maintain wikipedia so no worries!

Edit: I am making a cli tool named getquotes, written in rust. Because of that, I am everyday chugging up the api. Maybe you will get a pr from me ( I know web development also).

It would be very helpful. Thank you so much in advance. Additionally, if you don't see me online you can mention @prem-k-r for assistance. I may not be able to contribute for some few days cause of sickness.

@itz-rj-here itz-rj-here self-assigned this Jan 15, 2025
@itz-rj-here itz-rj-here added enhancement New feature or request work in progress The issue is on progress to fix labels Jan 15, 2025
@itz-rj-here itz-rj-here changed the title Can't see motivational quotes feature in dev version Motivational Quotes feature in main branch and Quotes API improvement Jan 15, 2025
@MuntasirSZN
Copy link

I looked at it a bit. As there is even a library for extracting random quotes from WikiQuotes, it's based on selection of random content page from WikiQuotes and extraction of potential quotes from there. As there are a lot of content pages without quotes, it quite often produces nonsense outputs. So, the option is to first select random author and after use your existing script for selecting his/her/their random quote. Alternatively we can just make a static list as you proposed. What do you think?

If we do fixed list, then we probably need add a settings option to add more authors. But, the problem is that they won't get outside of them. Or, if we do random selection, then we need to implement multiple quotes at once, as there isn't a fixed chance that that page has a quote.
Edit: I am thinking this way. Your implementation might vary. @itz-rj-here Anything you thought? I am just reading through their massive api.

I already saw that... If we had a perfect quotes api like zenquotes we could continue. But cause of there is no free quotes system, we can't continue. Almost most of the free quotes got discontinued after 2022.
If we continue with the wikiquotes we need to deep check the whole api system so if there anything else we can do.

Wikiquotes will continue for many years, its maintained by mediawiki, they also maintain wikipedia so no worries!

Edit: I am making a cli tool named getquotes, written in rust. Because of that, I am everyday chugging up the api. Maybe you will get a pr from me ( I know web development also).

It would be very helpful. Thank you so much in advance. Additionally, if you don't see me online you can mention @prem-k-r for assistance. I may not be able to contribute for some few days cause of sickness.

Get well soon! 👍

@MuntasirSZN
Copy link

Sorry But I am currently a bit busy. It would take a bit of time for the pr. Sorry.

@itz-rj-here
Copy link
Collaborator

Sorry But I am currently a bit busy. It would take a bit of time for the pr. Sorry.

No worry. Take your time. I'm also going to the hospital for a checkup. Then i will again work to the extention.

@MuntasirSZN
Copy link

Sorry, was busy, my grandfather was ill. This week you will get a pr from me.

@itz-rj-here
Copy link
Collaborator

Sorry, was busy, my grandfather was ill. This week you will get a pr from me.

Np. Take your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request work in progress The issue is on progress to fix
Projects
None yet
Development

No branches or pull requests

4 participants