Looks like some shenanigans going on... They're blocking Rainmeter, at least from the USA side. The UserAgent trick balala mentioned is working, tho the regexp needs tweaking. RainRegExp isn't working either.Yincognito wrote: ↑January 11th, 2024, 10:43 pm Hmm... the code here still works for me, after adding the UserAgent suggested by balala (plus, I am able to CTRL+F the time in the page source, so it doesn't look to be hidden behind javascript... yet):
TimeIs.jpg
That being said, at the time I posted the code, Rube_Goldfish above got something different than I did too, so maybe the site provides slightly different results depending on user location...
It is currently April 28th, 2024, 4:01 pm
Clock syncs from time.is
-
- Rainmeter Sage
- Posts: 2613
- Joined: March 23rd, 2015, 5:26 pm
Re: Clock syncs from time.is
-
- Rainmeter Sage
- Posts: 2613
- Joined: March 23rd, 2015, 5:26 pm
Re: Clock syncs from time.is
Code: Select all
PS> curl https://time.is/New_York
curl : The remote server returned an error: (403) Forbidden.
At line:1 char:1
+ curl https://time.is/New_York
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
PS> curl https://time.is/New_York -UserAgent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36 Edg/92.0.902.84'
StatusCode : 200
StatusDescription : OK
Content : <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en"><head><title>Time in New York, United States now - Time.is</title>
<link rel="preconnect" href="https://a.pub.network/...
RawContent : HTTP/1.1 200 OK
....
-
- Rainmeter Sage
- Posts: 7179
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Clock syncs from time.is
SilverAzide wrote: ↑January 11th, 2024, 10:53 pm Looks like some shenanigans going on... They're blocking Rainmeter, at least from the USA side. The UserAgent trick balala mentioned is working, tho the regexp needs tweaking. RainRegExp isn't working either.
Well, that explains it. The site must really need an user agent to provide data, it seems.SilverAzide wrote: ↑January 11th, 2024, 10:59 pmCode: Select all
PS> curl https://time.is/New_York curl : The remote server returned an error: (403) Forbidden. At line:1 char:1 + curl https://time.is/New_York + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand PS> curl https://time.is/New_York -UserAgent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36 Edg/92.0.902.84' StatusCode : 200 StatusDescription : OK Content : <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title>Time in New York, United States now - Time.is</title> <link rel="preconnect" href="https://a.pub.network/... RawContent : HTTP/1.1 200 OK ....