-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to get data from API & no cache available !? #104
Comments
Hey @emmgr23 thanks for reaching out. I can see you selected BTC, ETH and another one. Could you share the (FIAT) currency you are trying to convert to and I will look to reproduce this experience |
thanks for the fast answer `#!/usr/bin/python -- coding: utf-8 --import urllib2,json,sys coin_ticker = "ETH" if "ETH"[0] != "{" else "BTC" try:
except urllib2.URLError, e: Please submit any issues https://github.com/chrislennon/Crypto-Touchbar-App/issues with the above script` |
Awesome! Thanks so much. If it's an issue of the notch/touch bar side itself I'll take a look into this in a few hours. Just to double check it's not something else, do you see prices returned when you visit this URL directly? https://min-api.cryptocompare.com/data/histohour?fsym=BTC&tsym=USD |
yes i do see the price |
on my side i tried to check, but i dont see where the problem is, and i dont have a mbp with touchbar, to see if its working fine on it. btw thank you for your time |
Hey @emmgr23 - appreciate the confirmation. So here's my take and a few things to try (also tagging @fifafu if he has any ideas). If you are able to access the API above and get data, its likely not a connection issue. I've also set up a few widgets on my notch bar and it seems to pull data fine, so its doesn't appear to be a code/template issue. Thinking how to isolate this further, do you perhaps have a firewall blocking BetterTouchTool, or perhaps even the underlying python process? To perhaps expose the actual error you could modify the script in the following location (red) inside Better Touch Tool, this removes the error handling and will likely show the actual error you are experiencing (in the blue area) after running the script with the run button (in green)
|
ha yes i didnt see the result section before: |
Hmmmmmmmmm 🤔 Looks like part of the error got cut off, but I suspect it's something like
I am not sure why this could occur, I'll have a think and see if anything makes sense. I assume you have tried things like restarting your machine etc? 😅 (Not that I'm clutching at straws) |
i have a question for you , it is possible to color in red and green the little triangle , sorry i dont know python |
Ah! Superb catch, I think it would be sensible for me to have it enabled by default, I'll have that added at some point soon(ish). With regards to the colour of the arrows, I don't think this is possible unless @fifafu has any ideas. The python side just provides the output to better touch tool. The fonts (and their styles) are then handled by BTT itself. Unless we could add some identifying character which BTT would then use as a conditional for the font change, I'm not sure it would be possible. Perhaps if there are coloured emojis already in existence that could be a workaround 🤔 |
ok, im gonna have a look and ill let you know if i find something |
The Notch Bar can display arbitrary HTML / CSS, but it's not yet enabled for the apple script / shell script widgets. Will be available with the next version. Or maybe, I could update the Notch Bar template used in this project to output one of the new HTML/JS widgets, then we could get rid of the Python dependency and get all the power of HTML/CSS/JS rendering immediately. It should be very easy to convert this Python to JS, I'll have a look! |
@fifafu this could be a massive improvement, it's always made me a tad uncomfortable invoking a sub process (be it pyhon or node or whatever) for these. If the notch (and touch bar) could render small pieces of html (with all the css/js magic) could really open up the interface side of things |
hi, chris :) , is there a problem with the api today , because even your website seems to have a problem to get the data? |
Seems fine from my side - can always check it directly (using BTC -> USD as an example) https://min-api.cryptocompare.com/data/histohour?fsym=BTC&tsym=USD |
yeah its a limitation of the API service that the extension makes use of. It's on an IP basis so you can check out issue #100 covers quite a lot of questions on this some resolutions too for example in this comment |
hi, im trying to get some price on the notch bar, but instead of the price, I have this error message:
"Unable to get data from API & no cache available"
can you help me resolve this issue please ?☺️
The text was updated successfully, but these errors were encountered: