But nothing appears in the Console app?Hi! Thank you! Unfortunately this did not help. However, something changed. Now the widget shows Cupertino in the city field. Previously it was blank. Anyway, the "validating" issue still present.
But nothing appears in the Console app?Hi! Thank you! Unfortunately this did not help. However, something changed. Now the widget shows Cupertino in the city field. Previously it was blank. Anyway, the "validating" issue still present.
That's what i see in the Console:But nothing appears in the Console app?
function performXMLRequest (encodedText, encodingType, translationType, callback)
{
var sourceLang = translationType.substr(0, translationType.indexOf('_')).toUpperCase();
var targetLang = translationType.substr(translationType.indexOf('_') + 1, translationType.length).toUpperCase();
var url = 'https://api-free.deepl.com/v2/translate';
var body = 'text='+encodeURI(encodedText)+'&source_lang='+sourceLang+'&target_lang='+targetLang;
var xml_request = new XMLHttpRequest();
xml_request.onload = function(e) {xml_loaded(e, xml_request, requestID++, callback);}
xml_request.onerror = function() {callback(null,"");}
xml_request.open("POST", url);
xml_request.setRequestHeader("Authorization", "DeepL-Auth-Key "+deeplAuthKey);
xml_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xml_request.setRequestHeader("Cache-Control", "no-cache");
xml_request.send(body);
//alert("Translation URL: " + url); //uncomment for debugging
return xml_request;
}
Thank you! I have a bunch of really minor updates I need to do, I'm really hoping I can get to them soon!@Wowfunhappy DeepL recently updated their API, and the current translation widget no longer works. It looks like you'll have to use a POST request now.
it's a really quick fix:
JavaScript:function performXMLRequest (encodedText, encodingType, translationType, callback) { var sourceLang = translationType.substr(0, translationType.indexOf('_')).toUpperCase(); var targetLang = translationType.substr(translationType.indexOf('_') + 1, translationType.length).toUpperCase(); var url = 'https://api-free.deepl.com/v2/translate'; var body = 'text='+encodeURI(encodedText)+'&source_lang='+sourceLang+'&target_lang='+targetLang; var xml_request = new XMLHttpRequest(); xml_request.onload = function(e) {xml_loaded(e, xml_request, requestID++, callback);} xml_request.onerror = function() {callback(null,"");} xml_request.open("POST", url); xml_request.setRequestHeader("Authorization", "DeepL-Auth-Key "+deeplAuthKey); xml_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xml_request.setRequestHeader("Cache-Control", "no-cache"); xml_request.send(body); //alert("Translation URL: " + url); //uncomment for debugging return xml_request; }
well, millions of users spammed the api with that key every day in that era. and the ones who are on older devices with ios 15 still do. it probably has an unlimited quota anyways, i don't think apple or the weather channel would care.^ Super cool! I'd be a little nervous about repurposing their commercial API key like that, but it's neat that it works!
sorry, the search results are out of my control and the widget is just programmed to display whatever the apple maps server gives back. however, i did find that taipei is under the SubAdministrativeArea type rather than Locality, which is what most cities are under. i have updated the attachment in my reply with a new version that also adds SubAdministrativeArea to the search parameters. taipei appears in the results.A suggestion for those users facing the Weather Widget location "Validating..." issue. If your Mac has wifi, enable it and connect to your local network. Then reboot. Hopefully this will push the Widget to the next step. This helped me and the Weather Widget is working fine again.
The Weather Widget (Wowfunhappy's version) was working fine for me for many months. I tried iPodNano3's version and it worked fine for a few days then everything went blank as I got hit by the location "Validating..." issue. This happened on my Mac Pro (Ethernet) but not on my MacBook Pro (wifi) both running Mojave. I suspected that the location input was not being passed along onto the system. Tried many workarounds (e.g. re-enabling Location Services, etc.) but nothing worked until I enabled wifi.
During the many reboots, I reinstalled both versions of the Widget mentioned and both failed and worked again after wifi was enabled. I am now using iPodNano3's version on the Mac Pro but Wowfunhappy's version on the MacBook Pro. For some strange reason iPodNano's version does not recognise "Taipei, Taiwan" as a valid location when is running on the MacBook Pro using wifi. Can't explain this... makes no sense at all.
Here is where I got the idea to enable wifi... the Weather Widget in Tahoe sometimes fails to update until wifi is enabled even for desktop Macs on a wired network. Apparently this is a well known bug. I have experienced this several times on my Mac mini M4 Pro. In Tahoe and now Mojave, you can disable wifi after the weather is updated.
"Taipei City, Taiwan" weather now available. Thank you very much!sorry, the search results are out of my control and the widget is just programmed to display whatever the apple maps server gives back. however, i did find that taipei is under the SubAdministrativeArea type rather than Locality, which is what most cities are under. i have updated the attachment in my reply with a new version that also adds SubAdministrativeArea to the search parameters. taipei appears in the results.
Just downloaded & unzipped & clicked on the Ski Report.wdgt on my 10.14.6 (Mojave) it said (translated from Turkish) Ski Report.wdgt can't be opened because it's been damaged. You should place it in Recycle Bin.ski report widget fix that uses the weather channel's ski conditions api endpoint and current observations api endpoint to get data. uses apple maps to search for ski resorts. still using apple's weather.com api key and mapkit js tokens. it properly displays the new (past 24 hours) snowfall, the base snow length, number of open trails, snow condition, and temperature. it will also display a big "CLOSED" sign if the resort is currently closed.
simply go to the back and enter in a ski resort name. it should (hopefully) get validated by apple maps. you can choose from multiple results. the full address of the ski resort will be displayed.
View attachment 2624555View attachment 2624556
Turn off Gatekeeper. You may need to use the Terminal command on Mojave. (I don't think the opt-click > open trick works for Dashboard Widgets?)Just downloaded & unzipped & clicked on the Ski Report.wdgt on my 10.14.6 (Mojave) it said (translated from Turkish) Ski Report.wdgt can't be opened because it's been damaged. You should place it in Recycle Bin.