Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,34 +0,0 @@
with AWS.Client, AWS.Response, AWS.Resources, AWS.Messages;
with Ada.Text_IO, Ada.Strings.Fixed;
use Ada, AWS, AWS.Resources, AWS.Messages;
procedure Get_UTC_Time is
Page : Response.Data;
File : Resources.File_Type;
Buffer : String (1 .. 1024);
Position, Last : Natural := 0;
S : Messages.Status_Code;
begin
Page := Client.Get ("http://tycho.usno.navy.mil/cgi-bin/timer.pl");
S := Response.Status_Code (Page);
if S not in Success then
Text_IO.Put_Line
("Unable to retrieve data => Status Code :" & Image (S) &
" Reason :" & Reason_Phrase (S));
return;
end if;
Response.Message_Body (Page, File);
while not End_Of_File (File) loop
Resources.Get_Line (File, Buffer, Last);
Position :=
Strings.Fixed.Index
(Source => Buffer (Buffer'First .. Last),
Pattern => "UTC");
if Position > 0 then
Text_IO.Put_Line (Buffer (5 .. Position + 2));
return;
end if;
end loop;
end Get_UTC_Time;

View file

@ -1,4 +0,0 @@
$wc = New-Object Net.WebClient
$html = $wc.DownloadString('http://tycho.usno.navy.mil/cgi-bin/timer.pl')
$html -match ', (.*) UTC' | Out-Null
Write-Host $Matches[1]

View file

@ -1 +0,0 @@
[System.DateTime]::UtcNow

View file

@ -1 +0,0 @@
[System.DateTime]::Now

View file

@ -1,25 +0,0 @@
Rebol [
Title: "Web Scraping"
URL: http://rosettacode.org/wiki/Web_Scraping
]
; Notice that REBOL understands unquoted URL's:
service: http://tycho.usno.navy.mil/cgi-bin/timer.pl
; The 'read' function can read from any data scheme that REBOL knows
; about, which includes web URLs. NOTE: Depending on your security
; settings, REBOL may ask you for permission to contact the service.
html: read service
; I parse the HTML to find the first <br> (note the unquoted HTML tag
; -- REBOL understands those too), then copy the current time from
; there to the "UTC" terminator.
; I have the "to end" in the parse rule so the parse will succeed.
; Not strictly necessary once I've got the time, but good practice.
parse html [thru <br> copy current thru "UTC" to end]
print ["Current UTC time:" current]

View file

@ -1,30 +0,0 @@
Function GetUTC() As String
Url = "http://tycho.usno.navy.mil/cgi-bin/timer.pl"
With CreateObject("MSXML2.XMLHTTP.6.0")
.Open "GET", Url, False
.send
arrt = Split(.responseText, vbLf)
End With
For Each t In arrt
If InStr(t, "UTC") Then
GetUTC = StripHttpTags(t)
Exit For
End If
Next
End Function
Function StripHttpTags(s)
With New RegExp
.Global = True
.Pattern = "\<.+?\>"
If .Test(s) Then
StripHttpTags = .Replace(s, "")
Else
StripHttpTags = s
End If
End With
End Function
WScript.StdOut.Write GetUTC
WScript.StdOut.WriteLine