Bugswriter / tuxi

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

cant search what time it is #183

Open CatFoodEnthusiast opened 3 years ago

CatFoodEnthusiast commented 3 years ago

Steps to Reproduce the Problem

if you search "time right now" or "time in [random country or timezone] right now" the time is not gonna show up, instead, you will get "no result" and some websites.

Expected Behavior

i expected the time to show up

Actual Behavior

i get "no result" and some websites.

Log

no logs i think

time

googlesearch

this used to work in older versions of tuxi but it doesnt work anymore

Genghius commented 3 years ago

I propose we call this a feature. We leave it as an exercise for the user to figure out what time it is. Celcius and Fahrenheit flashbacks further intensify.

PureArtistry commented 3 years ago

I'll add this soon, probably the weekend - thanks for the suggestion

BeyondMagic commented 3 years ago

this used to work in older versions of tuxi but it doesnt work anymore

Indeed, I think this was the element that tuxi was getting the time from, div.XcVN5d. sudocanttype #99 added it, but Google UI probably updated in the last days because now you can see graphs from equations,

image

maybe something else was added/changed.

PureArtistry commented 3 years ago

div.XcVN5d is not an element per se, the XcVN5d part is a common suffix for a lot of things that appear in bold at the top of the page. I got rid of the snippet that grabbed just that because it broke an number of the other snippets, dictionary being the main one.

for just the time the div would be div.gsrt.vk_bk.dDoNo.FzvWSb.XcVN5d.DjWnwf (it's better to be specific so the script doesn't give you false positives)

if you also wanted the date and location vk_c.vk_gy.vk_sh.card-section.sL6Rbf.R36Kq would be the div to use

BeyondMagic commented 3 years ago

div.XcVN5d is not an element per se, the XcVN5d part is a common suffix for a lot of things that appear in bold at the top of the page.

I mean, I wasn't trying to be specific, if so, XcVN5d is a class, we really can't get elements per se because none of the ones that we get come from IDs, just classes, so even using div.gsrt.vk_bk.dDoNo.FzvWSb.XcVN5d.DjWnwf is betting on lucky because we really can't know if some other snippet actually have the same div with the same classes in some place, even though we have way more lucky using more classes for an element that we know where it comes from.