Bugswriter / tuxi

Tuxi is a cli assistant. Get answers of your questions instantly.
GNU General Public License v3.0
1.33k stars 73 forks source link

added roll dice feature #61

Closed Sd-Shiivam closed 3 years ago

Sd-Shiivam commented 3 years ago

i hop you like it

colonvirus commented 3 years ago

Can you pr to develop instead? CONTRIBUTING.md

Also, this isn't a scraper, so I don't know, should we add this?

And how do you invoke this?

Genghius commented 3 years ago

It is a nice dice rolling function, but has little to do with tuxi. However, google has a way to roll dice and flip coins image image image

If you can get them to be scrapped by tuxi it would be great. in the meantime, I advocate against merging this PR.

colonvirus commented 3 years ago

Yea, that's what I meant by the "Random" feature

Bugswriter commented 3 years ago

I think it's time to decide should we keep tuxi only for scraping some google search results. or turn tuxi into a complete assistant? I have some ideas like using tuxi to manage todo list file (which will be a is a simple text file).

Bugswriter commented 3 years ago

I don't think adding. . so much code just to roll a dice?

colonvirus commented 3 years ago

(i) Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new features.

Other programs do the todo list well, so Tuxi doesn't have to.

Bugswriter commented 3 years ago

(i) Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new features.

LoL I was about to say that. We should keep tuxi only to get goodies from google search results. I think it's better that people add tuxi to create their own voice assistant with .. STT and TTS.

colonvirus commented 3 years ago

https://github.com/h4de5/tuxi/blob/python-port/tuxi.py

This has the div for flip a coin

# RANDOM
# query = "flip a coin" # <div jsname="DyVWtc" class="PmF7Ce" aria-hidden="true">Heads</div>
# query = "roll a dice" #

Myabe we could ask @h4de5 to implement this?

Genghius commented 3 years ago

I think it's time to decide should we keep tuxi only for scraping some google search results. or turn tuxi into a complete assistant? I have some ideas like using tuxi to manage todo list file (which will be a is a simple text file).

tuxi should remain a linux cortana i say. Having unrelated stuff that isnt scrapping doesnt bring much benefit, these may aswell be separate scripts.

Genghius commented 3 years ago

https://github.com/h4de5/tuxi/blob/python-port/tuxi.py

This has the div for flip a coin

# RANDOM
# query = "flip a coin" # <div jsname="DyVWtc" class="PmF7Ce" aria-hidden="true">Heads</div>
# query = "roll a dice" #

Myabe we could ask @h4de5 to implement this?

I can do it once develop and main are even.

BeyondMagic commented 3 years ago

roll a dice query changes the element after ~4 seconds the page was loaded to give the number. When you load it initially it gives only 0 as response.

Genghius commented 3 years ago

looks like such, maybe we should ditch anything that is animated like the coin flip and dice roll then?

BeyondMagic commented 3 years ago

Probably, I don't think pup can load the animation/javascript, and then gives the response code after a few seconds..

Genghius commented 3 years ago

i guess this PR can be closed then, until we figure a different way to scrap random dice / coin .

BeyondMagic commented 3 years ago

The code to get it currently (I made just to test out) is:

# Roll a dice, yes. ( eg: roll a dice )
dice="$(echo "$google_html" | pup 'div.qwCcde text{}' | recode html..ISO-8859-1)"
[ -n "$dice" ] && output "$dice" && exit 0
Genghius commented 3 years ago

but it will only output 0 rigth?

Bugswriter commented 3 years ago

Why we need to roll a dice?

BeyondMagic commented 3 years ago

but it will only output 0 rigth?

yes, just leaving it there if someone wants to try make it possible to roll a dice.

Bugswriter commented 3 years ago

No need of doing unnecessary scraping. We should only scrape when We got something general. Which we get on search query.

BeyondMagic commented 3 years ago

No need of doing unnecessary scraping.

Agreed, then #55 needs to change.

Genghius commented 3 years ago

I propose we remove random from #55 , as it isnt really something you would need scrapping for and we are trying to keep tuxi a scraper only.

Bugswriter commented 3 years ago

Yes scraping google just to get random number is not a good idea.

Bugswriter commented 3 years ago

Also closing this PR since. Tuxi is not going to roll a dice.