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

weather function occasionally fails in US #160

Closed sudocanttype closed 3 years ago

sudocanttype commented 3 years ago

Steps to Reproduce the Problem

The test script fails on random while testing weather, and when I was testing it. image

Expected Behavior

It to return the weather

Actual Behavior

Look at the picture

Log

No Log

BeyondMagic commented 3 years ago

main?

sudocanttype commented 3 years ago

Yep, and lemme get you the testoutput. It seems to be a very rare error, but still a bug. I kinda just ignored it, but it failed 2 times in a row for my while running the quality test image

BeyondMagic commented 3 years ago

Did the class scrapping changed after fixing the ºC and ºF bug?

sudocanttype commented 3 years ago

I am not sure, I thought they just improved the regex/filtering

BeyondMagic commented 3 years ago

Can you comment the lines of the new scrapping lines for weather, 205-211 and uncomment 204, and try it again? Even though it will show ºC and ºF swapped.

sudocanttype commented 3 years ago

Yep, still failed. image

BeyondMagic commented 3 years ago

Then it's a problem with Google UI returning you those results, get the query that normally fails and instead of passing the results to tuxi to scrap, debug it to a file. Can you do it?

BeyondMagic commented 3 years ago

Actually, don't comment line 156, just add in the next one curl -Gs --compressed "$google_url" --user-agent "$user_agent" --data-urlencode "q=$query" > output.html

When it gives you an error, share the output.html file.

sudocanttype commented 3 years ago

Strange. It looks like it just doesnt load some times for me. output.txt (HTML is not supported by github apparently)

BeyondMagic commented 3 years ago

soooo this can be either curl failing rarely to get Google's html data, or Google giving you just this result because they're trolling you, I don't think there's a solution for that since the html file that you gave doesn't give any information at all

can be just javascript trying to load the information in (question of milliseconds) and curl already exporting the data, well

ヾ( 。)

sudocanttype commented 3 years ago

Yep, it's not a problem until someone else reports it. I'm going to assume its just a me thing and close this.