n4af / TR4W

TRLOG 4 Windows free amateur radio logging application
GNU General Public License v3.0
19 stars 6 forks source link

Add option to automatically download latest CTY.DAT #340

Closed ny4i closed 5 years ago

ny4i commented 6 years ago

Add an option to retrieve the CTY.DAT file from this link: http://www.country-files.com/cty/cty.dat and place in the proper directory.

Extra credit to go check the file to see if there is a newer version.

I recommend rather than using the Win32 API approach that the program currently does to make use of the Indy Library to retrieve a web page. This is with the TIdHTTP object.

function TForm.HttpGet(const url: string): string;
var
  responseStream : TMemoryStream;
  html: string;
  HTTP: TIdHTTP;
begin
  try
      try
        responseStream := TMemoryStream.Create;
        HTTP := TIdHTTP.Create(nil);
        HTTP.Get('http://www.country-files.com/cty/cty.dat', responseStream);
        SetString(html, PAnsiChar(responseStream.Memory), responseStream.Size);
// Once downloaded, save at CTY.DAT in the right place
        result := html;
      except
        on E: Exception do
            Global.LogError(E, 'ProcessHttpRequest');
      end;
    finally
      try
        HTTP.Disconnect;
      except
      end;
    end;
end;
n4af commented 6 years ago

Sounds good Tom, but I do not how to do it with indy.

What I have done of late is just roll latest cty.dat into the monthly update.

73, Howie

On Thu, Mar 22, 2018 at 11:01 AM, Tom Schaefer notifications@github.com wrote:

Add an option to retrieve the CTY.DAT file from this link: http://www.country-files.com/cty/cty.dat and place in the proper directory.

Extra credit to go check the file to see if there is a newer version.

I recommend rather than using the Win32 API approach that the program currently does to make use of the Indy Library to retrieve a web page. This is with the TIdHTTP object.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340, or mute the thread https://github.com/notifications/unsubscribe-auth/AGqxUMkqlUu9iR8Bn4komWKODGPOTpWgks5tg7yugaJpZM4S3Nmv .

ny4i commented 6 years ago

I can do it. I put an example of using TIdHTTP in the ticket in case anyone wanted to take a crack at it.

I put things in the issues so I do not forget them. Tom Principal Solutions Architect, ITIL®v3 Better Software Solutions, Inc. 727-437-BSS1 (727-437-2771) @BSSI_Consulting

On Mar 22, 2018, at 5:53 PM, Howie Hoyt notifications@github.com wrote:

Sounds good Tom, but I do not how to do it with indy.

What I have done of late is just roll latest cty.dat into the monthly update.

73, Howie

On Thu, Mar 22, 2018 at 11:01 AM, Tom Schaefer notifications@github.com wrote:

Add an option to retrieve the CTY.DAT file from this link: http://www.country-files.com/cty/cty.dat and place in the proper directory.

Extra credit to go check the file to see if there is a newer version.

I recommend rather than using the Win32 API approach that the program currently does to make use of the Indy Library to retrieve a web page. This is with the TIdHTTP object.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340, or mute the thread https://github.com/notifications/unsubscribe-auth/AGqxUMkqlUu9iR8Bn4komWKODGPOTpWgks5tg7yugaJpZM4S3Nmv .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340#issuecomment-375470155, or mute the thread https://github.com/notifications/unsubscribe-auth/AL07SkaprfpySp21hCpVo-Uc7U35E9Q6ks5thB10gaJpZM4S3Nmv.

n4af commented 6 years ago

it would be a nice add'n to the tools pulldown. There is api code to check/update tr4w that would apply to cty.dat but indy sounds like a great way to go.

73, Howie

On Thu, Mar 22, 2018 at 5:57 PM, Tom Schaefer notifications@github.com wrote:

I can do it. I put an example of using TIdHTTP in the ticket in case anyone wanted to take a crack at it.

I put things in the issues so I do not forget them. Tom Principal Solutions Architect, ITIL®v3 Better Software Solutions, Inc. 727-437-BSS1 (727-437-2771 <(727)%20437-2771>) @BSSI_Consulting

On Mar 22, 2018, at 5:53 PM, Howie Hoyt notifications@github.com wrote:

Sounds good Tom, but I do not how to do it with indy.

What I have done of late is just roll latest cty.dat into the monthly update.

73, Howie

On Thu, Mar 22, 2018 at 11:01 AM, Tom Schaefer <notifications@github.com

wrote:

Add an option to retrieve the CTY.DAT file from this link: http://www.country-files.com/cty/cty.dat and place in the proper directory.

Extra credit to go check the file to see if there is a newer version.

I recommend rather than using the Win32 API approach that the program currently does to make use of the Indy Library to retrieve a web page. This is with the TIdHTTP object.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340, or mute the thread https://github.com/notifications/unsubscribe-auth/ AGqxUMkqlUu9iR8Bn4komWKODGPOTpWgks5tg7yugaJpZM4S3Nmv .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/n4af/TR4W/issues/340#issuecomment-375470155>, or mute the thread https://github.com/notifications/unsubscribe- auth/AL07SkaprfpySp21hCpVo-Uc7U35E9Q6ks5thB10gaJpZM4S3Nmv.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340#issuecomment-375471022, or mute the thread https://github.com/notifications/unsubscribe-auth/AGqxUPWktprjgZMmRuDQCZv6m3wo84cGks5thB5EgaJpZM4S3Nmv .

ny4i commented 6 years ago

Do you mean we already have code in there to download the CTY.DAT file? If so, I missed that.

Tom Principal Solutions Architect, ITIL®v3 Better Software Solutions, Inc. 727-437-BSS1 (727-437-2771) @BSSI_Consulting

On Mar 22, 2018, at 6:00 PM, Howie Hoyt notifications@github.com wrote:

it would be a nice add'n to the tools pulldown. There is api code to check/update tr4w that would apply to cty.dat but indy sounds like a great way to go.

73, Howie

On Thu, Mar 22, 2018 at 5:57 PM, Tom Schaefer notifications@github.com wrote:

I can do it. I put an example of using TIdHTTP in the ticket in case anyone wanted to take a crack at it.

I put things in the issues so I do not forget them. Tom Principal Solutions Architect, ITIL®v3 Better Software Solutions, Inc. 727-437-BSS1 (727-437-2771 <(727)%20437-2771>) @BSSI_Consulting

On Mar 22, 2018, at 5:53 PM, Howie Hoyt notifications@github.com wrote:

Sounds good Tom, but I do not how to do it with indy.

What I have done of late is just roll latest cty.dat into the monthly update.

73, Howie

On Thu, Mar 22, 2018 at 11:01 AM, Tom Schaefer <notifications@github.com

wrote:

Add an option to retrieve the CTY.DAT file from this link: http://www.country-files.com/cty/cty.dat and place in the proper directory.

Extra credit to go check the file to see if there is a newer version.

I recommend rather than using the Win32 API approach that the program currently does to make use of the Indy Library to retrieve a web page. This is with the TIdHTTP object.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340, or mute the thread https://github.com/notifications/unsubscribe-auth/ AGqxUMkqlUu9iR8Bn4komWKODGPOTpWgks5tg7yugaJpZM4S3Nmv .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/n4af/TR4W/issues/340#issuecomment-375470155>, or mute the thread https://github.com/notifications/unsubscribe- auth/AL07SkaprfpySp21hCpVo-Uc7U35E9Q6ks5thB10gaJpZM4S3Nmv.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340#issuecomment-375471022, or mute the thread https://github.com/notifications/unsubscribe-auth/AGqxUPWktprjgZMmRuDQCZv6m3wo84cGks5thB5EgaJpZM4S3Nmv .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340#issuecomment-375471763, or mute the thread https://github.com/notifications/unsubscribe-auth/AL07SnvJTsR83kKCu4M9kZIh2U3lxA2iks5thB8IgaJpZM4S3Nmv.

n4af commented 6 years ago

NO. Extant code commented out to check and update trlog - i think vc.pas i just meant it could act as a template...

On Thu, Mar 22, 2018 at 6:14 PM, Tom Schaefer notifications@github.com wrote:

Do you mean we already have code in there to download the CTY.DAT file? If so, I missed that.

Tom Principal Solutions Architect, ITIL®v3 Better Software Solutions, Inc. 727-437-BSS1 (727-437-2771 <(727)%20437-2771>) @BSSI_Consulting

On Mar 22, 2018, at 6:00 PM, Howie Hoyt notifications@github.com wrote:

it would be a nice add'n to the tools pulldown. There is api code to check/update tr4w that would apply to cty.dat but indy sounds like a great way to go.

73, Howie

On Thu, Mar 22, 2018 at 5:57 PM, Tom Schaefer notifications@github.com wrote:

I can do it. I put an example of using TIdHTTP in the ticket in case anyone wanted to take a crack at it.

I put things in the issues so I do not forget them. Tom Principal Solutions Architect, ITIL®v3 Better Software Solutions, Inc. 727-437-BSS1 (727-437-2771 <(727)%20437-2771> <(727)%20437-2771>) @BSSI_Consulting

On Mar 22, 2018, at 5:53 PM, Howie Hoyt notifications@github.com wrote:

Sounds good Tom, but I do not how to do it with indy.

What I have done of late is just roll latest cty.dat into the monthly update.

73, Howie

On Thu, Mar 22, 2018 at 11:01 AM, Tom Schaefer < notifications@github.com

wrote:

Add an option to retrieve the CTY.DAT file from this link: http://www.country-files.com/cty/cty.dat and place in the proper directory.

Extra credit to go check the file to see if there is a newer version.

I recommend rather than using the Win32 API approach that the program currently does to make use of the Indy Library to retrieve a web page. This is with the TIdHTTP object.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340, or mute the thread https://github.com/notifications/unsubscribe-auth/ AGqxUMkqlUu9iR8Bn4komWKODGPOTpWgks5tg7yugaJpZM4S3Nmv .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/n4af/TR4W/issues/340#issuecomment-375470155>, or mute the thread https://github.com/notifications/unsubscribe- auth/AL07SkaprfpySp21hCpVo-Uc7U35E9Q6ks5thB10gaJpZM4S3Nmv.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340#issuecomment-375471022, or mute the thread https://github.com/notifications/unsubscribe-auth/ AGqxUPWktprjgZMmRuDQCZv6m3wo84cGks5thB5EgaJpZM4S3Nmv .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/n4af/TR4W/issues/340#issuecomment-375471763>, or mute the thread https://github.com/notifications/unsubscribe-auth/ AL07SnvJTsR83kKCu4M9kZIh2U3lxA2iks5thB8IgaJpZM4S3Nmv.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340#issuecomment-375475050, or mute the thread https://github.com/notifications/unsubscribe-auth/AGqxUDQY5O_JOnhTfWp_6e468YxAup0Mks5thCJDgaJpZM4S3Nmv .

ny4i commented 6 years ago

I understand. Better to do it with Indy so let me look at that.

Thanks,

Tom Principal Solutions Architect, ITIL®v3 Better Software Solutions, Inc. 727-437-BSS1 (727-437-2771) @BSSI_Consulting

On Mar 22, 2018, at 6:19 PM, Howie Hoyt notifications@github.com wrote:

NO. Extant code commented out to check and update trlog - i think vc.pas i just meant it could act as a template...

On Thu, Mar 22, 2018 at 6:14 PM, Tom Schaefer notifications@github.com wrote:

Do you mean we already have code in there to download the CTY.DAT file? If so, I missed that.

Tom Principal Solutions Architect, ITIL®v3 Better Software Solutions, Inc. 727-437-BSS1 (727-437-2771 <(727)%20437-2771>) @BSSI_Consulting

On Mar 22, 2018, at 6:00 PM, Howie Hoyt notifications@github.com wrote:

it would be a nice add'n to the tools pulldown. There is api code to check/update tr4w that would apply to cty.dat but indy sounds like a great way to go.

73, Howie

On Thu, Mar 22, 2018 at 5:57 PM, Tom Schaefer notifications@github.com wrote:

I can do it. I put an example of using TIdHTTP in the ticket in case anyone wanted to take a crack at it.

I put things in the issues so I do not forget them. Tom Principal Solutions Architect, ITIL®v3 Better Software Solutions, Inc. 727-437-BSS1 (727-437-2771 <(727)%20437-2771> <(727)%20437-2771>) @BSSI_Consulting

On Mar 22, 2018, at 5:53 PM, Howie Hoyt notifications@github.com wrote:

Sounds good Tom, but I do not how to do it with indy.

What I have done of late is just roll latest cty.dat into the monthly update.

73, Howie

On Thu, Mar 22, 2018 at 11:01 AM, Tom Schaefer < notifications@github.com

wrote:

Add an option to retrieve the CTY.DAT file from this link: http://www.country-files.com/cty/cty.dat and place in the proper directory.

Extra credit to go check the file to see if there is a newer version.

I recommend rather than using the Win32 API approach that the program currently does to make use of the Indy Library to retrieve a web page. This is with the TIdHTTP object.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340, or mute the thread https://github.com/notifications/unsubscribe-auth/ AGqxUMkqlUu9iR8Bn4komWKODGPOTpWgks5tg7yugaJpZM4S3Nmv .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/n4af/TR4W/issues/340#issuecomment-375470155>, or mute the thread https://github.com/notifications/unsubscribe- auth/AL07SkaprfpySp21hCpVo-Uc7U35E9Q6ks5thB10gaJpZM4S3Nmv.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340#issuecomment-375471022, or mute the thread https://github.com/notifications/unsubscribe-auth/ AGqxUPWktprjgZMmRuDQCZv6m3wo84cGks5thB5EgaJpZM4S3Nmv .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/n4af/TR4W/issues/340#issuecomment-375471763>, or mute the thread https://github.com/notifications/unsubscribe-auth/ AL07SnvJTsR83kKCu4M9kZIh2U3lxA2iks5thB8IgaJpZM4S3Nmv.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340#issuecomment-375475050, or mute the thread https://github.com/notifications/unsubscribe-auth/AGqxUDQY5O_JOnhTfWp_6e468YxAup0Mks5thCJDgaJpZM4S3Nmv .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340#issuecomment-375476310, or mute the thread https://github.com/notifications/unsubscribe-auth/AL07SltOBO8u2pretcRJq8K8r7FLYj3yks5thCN-gaJpZM4S3Nmv.

n4af commented 5 years ago

add to 4.75.3 in absence of indy code change...

ny4i commented 5 years ago

Thanks for implementing this. Sorry I have been out of pocket for a long time. I do intend to get back to this stuff soon.

n4af commented 5 years ago

FB Tom

73, Howie

On Thu, Nov 15, 2018 at 11:50 AM Tom Schaefer notifications@github.com wrote:

Thanks for implementing this. Sorry I have been out of pocket for a long time. I do intend to get back to this stuff soon.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/n4af/TR4W/issues/340#issuecomment-439109655, or mute the thread https://github.com/notifications/unsubscribe-auth/AGqxUCcDXaXtixb6J9RHFvMoVVjxL_1mks5uvZtmgaJpZM4S3Nmv .