Created
October 13, 2022 16:48
-
-
Save Irwin1985/633e06f84820616d94f49eeaccba3d2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* ===================================================================================== | |
* Consulta las tasas del dolar desde el sitio web: | |
* https://www.datos.gov.co/resource/32sa-8pi3.json?vigenciadesde= | |
* | |
* Dependencias: | |
* VfpRestClient: https://github.com/Irwin1985/VFPRestClient | |
* JSONFox: https://github.com/Irwin1985/JSONFox | |
* | |
* NOTA: | |
* 1. Cambie las rutas de vfpRestClient y JSONFox por las correspondientes. | |
* | |
* Créditos especiales: | |
* Alejandro García Garay | |
* ===================================================================================== * | |
Local lcVfpRestClientDir, lcJsonFoxDir, loRest | |
lcVfpRestClientDir = "f:\desarrollo\github\vfprestclient\vfprestclient.prg" | |
lcJsonFoxDir = "f:\desarrollo\github\jsonfox\jsonfox.app" | |
Set Procedure To (lcVfpRestClientDir) Additive | |
lcDate = Date() | |
lcURL = 'https://www.datos.gov.co/resource/32sa-8pi3.json?vigenciadesde=' | |
lcURLFin = 'T00:00:00.000' | |
lcDate = Alltrim(Str(Year(lcDate))) + "-" + Padl(Month(lcDate), 2, '0') + "-" + Padl(Day(lcDate), 2, '0') | |
*--- Se arma la dirección a consultar completa | |
lcURLTotal = lcURL + lcDate + lcURLFin | |
loRest = Createobject("Rest") | |
loRest.AddRequest(loRest.Get, lcURLTotal) | |
loRest.addHeader("Content-Type", "application/json") | |
loRest.Send() | |
If loRest.Status != 200 | |
Messagebox(loRest.LastErrorText, 16, "Error") | |
Return | |
Endif | |
Do (lcJsonFoxDir) | |
_Screen.json.JSONToCursor(loRest.ResponseText, 'cData', Set("Datasession")) | |
Select cData | |
Browse |
Hola, cuando descargo el ultimo jsonfox.app, ya deja de funcionar el tema de la tasa
Hola, cuando descargo el ultimo jsonfox.app, ya deja de funcionar el tema de la tasa
Hola, el problema estaba en la cadena JSON que devuelve el servicio web ya que agrega caracteres no válidos, esto me ha servido para sanear la cadena de entrada justo antes de comenzar a convertir a JSON. Prueba ahora con la versión 9.9 que ya debe funcionar.
Perfecto Irwin
Gracias
Saludos desde Bogota, Colombia.
…On Fri, Aug 11, 2023 at 4:21 PM 易文翰 (Irwin) ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Hola, cuando descargo el ultimo jsonfox.app, ya deja de funcionar el tema
de la tasa
Hola, el problema estaba en la cadena JSON que devuelve el servicio web ya
que agrega caracteres no válidos, esto me ha servido para sanear la cadena
de entrada justo antes de comenzar a convertir a JSON. Prueba ahora con la
versión 9.9 que ya debe funcionar.
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/Irwin1985/633e06f84820616d94f49eeaccba3d2b#gistcomment-4658733>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEDZJFUMCB5XQK6MZ2XVHVTXU2O7BBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFQKSXMYLMOVS2I5DSOVS2I3TBNVS3W5DIOJSWCZC7OBQXE5DJMNUXAYLOORPWCY3UNF3GS5DZVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTCOBYGM4DINBRU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
--
Rodrigo Bedoya Zuluaga
Movil (57) 300 6649509
Sitio Web:* http://focussoft.com.co <http://focussoft.com.co>*
***@***.***
***@***.***
Contacteme <http://www.rodribezul.blobspot.com> Blogger
<http://www.rodribezul.blobspot.com> <http://facebook.com/rodribezul>
Facebook <http://facebook.com/rodribezul> <http://twitter.com/rodribezul>
Twitter <http://twitter.com/rodribezul> <http://ixogroup.wordpress.com>
WordPress <http://ixogroup.wordpress.com>
Chat [image: Skype/] rodribezul
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Gracias por tu ayuda y colaboración siempre. Un saludos. Espero que le sirva a los compañeros.