ticker.sh icon indicating copy to clipboard operation
ticker.sh copied to clipboard

stopped working again

Open pcause opened this issue 2 years ago • 37 comments

Think it is the cookie stuff. It stopped on one machine a few days ago and I copied the cook cache from another machine and it started working. Now fails on all systems

pcause avatar Aug 01 '23 14:08 pcause

This does appear to be wider spread than just to this piece of code. In that same thread a user reports a different endpoint as still valid, but requires some adjustment to account for the change in results.

Not sure how long that will last. Seems like Yahoo might be playing around with their APIs.

This image appears when navigating the URL reported in the API_ENDPOINT

{"finance":{"result":null,"error":{"code":"Unauthorized","description":"Invalid Crumb. For Developers - https://bit.ly/yahoo-finance-api-feedback"}}}

Followed by a survey ending with:

Similar to like what they did a few months ago :/ :disappointed:

appatalks avatar Aug 02 '23 00:08 appatalks

Here we go. Everything that happened during the last couple of weeks pointed towards this.

pstadler avatar Aug 02 '23 06:08 pstadler

Yep. Mine stopped working again as well. Is there a chance we can switch to Google Finance or is that not an option

phish0r avatar Aug 08 '23 02:08 phish0r

there is tickr and from a quick look at code it uses yahoo. it is working. not sure if the code can provide a hint as to what to change to get working again

pcause avatar Aug 10 '23 13:08 pcause

so I guess we're just waiting at this point to see what yahoo does? there does appear to be some endpoints that are still active, like: https://query1.finance.yahoo.com/v8/finance/chart/AAPL for example. /quote seems to be dead though.

phish0r avatar Aug 11 '23 21:08 phish0r

This pretty much sums it up, unfortunately. I‘m looking for alternatives, but haven’t been able to find any so far.

pstadler avatar Aug 11 '23 21:08 pstadler

I created PR#46 if y'all would like to give that a play with :penguin:

appatalks avatar Aug 14 '23 02:08 appatalks

I created PR#46 if y'all would like to give that a play with penguin

seems to be working for me

pcause avatar Aug 14 '23 15:08 pcause

I created PR#46 if y'all would like to give that a play with penguin

seems to be working for me

I can confirm it's working for me as well.

phish0r avatar Aug 15 '23 07:08 phish0r

If it is working, will the PR #46 merge be done?

g4570n avatar Aug 21 '23 23:08 g4570n

I‘m honestly not convinced that a request per ticker is a good solution, even if it‘s the only way to make it work. Thoughts?

pstadler avatar Aug 23 '23 10:08 pstadler

as you say, the only way to make it work. i can live with this versus not having the capability.

realpshev avatar Aug 23 '23 13:08 realpshev

PR #46 needs to add support for NOCOLOR

pcause avatar Aug 23 '23 19:08 pcause

PR #46 needs to add support for NOCOLOR

I see in the original code:

if [ -z "$NO_COLOR" ]; then
  : "${COLOR_BOLD:=\e[1;37m}"
  : "${COLOR_GREEN:=\e[32m}"
  : "${COLOR_RED:=\e[31m}"
  : "${COLOR_RESET:=\e[00m}"
fi

I'll try to find some time to learn how to get that in place :)

appatalks avatar Aug 23 '23 19:08 appatalks

@pcause I believe I might have got it. Can you try the latest commit to PR#46 and let me know? :penguin:

appatalks avatar Aug 23 '23 21:08 appatalks

in my use case it looks like it works. thanks

pcause avatar Aug 23 '23 23:08 pcause

the pr 46 version seems to have stopped working today

pcause avatar Sep 27 '23 15:09 pcause

it feels like every solution using Yahoo Finance will be short-lived from now on.

pstadler avatar Sep 27 '23 15:09 pstadler

the pr 46 version seems to have stopped working today

I wonder if it might be location based? At the moment, it is still working for me. What error are you getting? and I'll see if I can recreate/play with it on my end too :)

appatalks avatar Sep 27 '23 17:09 appatalks

interesting. it worked on my linux system but not wsl2 on windows

pcause avatar Sep 27 '23 17:09 pcause

@pcause sorry I haven't responded in a bit for this, for WSL issue, I am afraid I am not have much success getting my windows & hardware to work with wsl in general to effectively troubleshoot (this is a me issue on my part) :(

appatalks avatar Oct 06 '23 18:10 appatalks

np. figured it out. was the python issue that someone else posted about separately

pcause avatar Oct 06 '23 18:10 pcause

:wave: Team,

I adjusted the script to not use python, and added a check for bc for use with NO_COLOR recommended by @milanico2309

At first I was going to try to stick with python, but then I was worried about users who require python2 and then I was trying to find logic to get around that, tl'dr ... it got messy.

I think its also faster now :thinking:

appatalks avatar Oct 11 '23 22:10 appatalks

pr45 version - there is a small bug. then computing the percentage change it should be scale=4. bc will calculate to 4 decimal places and the multiply result will give you a percent and factional percent result with this change.

Is there some way to get a clean version. it is hard to find the latest.

pcause avatar Nov 06 '23 20:11 pcause

👋 @pcause

I have my fork here with the master branch currently what I am running for my day-to-day. (In all openness, I am uncertain if it's bug free, but just let me know and Ill be happy to review)

appatalks avatar Nov 06 '23 20:11 appatalks

the one I have uses bc but that version doesn't. it has:

percentChange=$(printf "%.2f" $(echo "scale=4; (($currentPrice - $previousClose) / $previousClose) * 100" | bc))

(original had scale=2)

seems you changed at some point?

pcause avatar Nov 06 '23 20:11 pcause

Ah yes! I remember now, yes, I was also using bc originally, but I kept running against math'ing errors that I couldn't quite figure out. Ran it through AI and it suggested my issue was something to do with bc and floating-point arithmetic and routing or some other way above my head. The AI made the awk suggestion to use instead and so far 🤞 🤞

appatalks avatar Nov 06 '23 20:11 appatalks

interesting. i've been using the bc version without issues other than the one above.

pcause avatar Nov 06 '23 20:11 pcause

I'd be happy to revert and try that scale=2 variable. Not sure if that was something I tried to adjust when trying to get it to work. Might need a bit of time to play with it.

appatalks avatar Nov 06 '23 20:11 appatalks

not worth the effort. i'll grab your version but stash away the one i'm using

pcause avatar Nov 06 '23 20:11 pcause