swapagarwal / JARVIS-on-Messenger

:speech_balloon: A community-driven python bot that aims to be as simple as possible to serve humans with their everyday tasks
https://m.me/J.A.R.V.I.S.on.Messenger
MIT License
1.35k stars 990 forks source link

Quote of the day #327

Open umangahuja1 opened 6 years ago

umangahuja1 commented 6 years ago

I saw that quote feature provide quotes from one of the few listed. How about using this to provide quote of the day by web scraping?

utkarshdeep commented 6 years ago

If it's just randomly selecting quotes from a bag of quotes, then I agree it needs improvement. I have quite a good experience with scrapy, I think I can work on this. Do you know any publically available API to get quotes?

KonstantinBork commented 6 years ago

Hey, I found two APIs for quotes: https://quotesondesign.com/api-v4-0/ & http://forismatic.com/en/api From my point of view, it's unnecessary to scrape the quotes we get by the APIs and save them. We can simply request a quote when the user does so similar to the movie or music modules.

utkarshdeep commented 6 years ago

This is great. We can pick one of them or both, and start the work. I think I will take this up. @KonstantinBork thanks, man. Will let you know.

KonstantinBork commented 6 years ago

If you need any help, I'll be available.

utkarshdeep commented 6 years ago

@KonstantinBork I was thinking of introducing a class that will help us to call above API's, and more in future, which will basically have attributes to set request method type, query param, headers (if any) etc. And then randomly selecting the available API resources and calling it using the above class. Sounds good? Or if you have anything better please let me know.

KonstantinBork commented 6 years ago

This should be the way to go. I think there already exists a util folder where you can put the class into.

utkarshdeep commented 6 years ago

@KonstantinBork I was also thinking, rather than being completely dependent on random selection, we should incorporate a system that checks for repetition of quotes based on what was generated previously. But to implement this we then also have to consider the various active chat session, which will make the system bit complicated.

KonstantinBork commented 6 years ago

You should keep it as simple as possible at first. Implement a first working draft and when this is merged with the main code, you can think about improving the system. Just my two cents.

umangahuja1 commented 6 years ago

How about scraping quote of the day from https://www.brainyquote.com/quote_of_the_day?

Rohithgilla12 commented 6 years ago

Is this issue still open? I am ready to take this.

utkarshdeep commented 6 years ago

I have raised a PR. Still not merged.