Page 1 of 1

use Firefox bookmarks-YYYY-MM-DD.json

Posted: Fri Aug 20, 2021 5:00 am
by AUGE_OHR
hi,

did somebody have Code to "read" Firefox *.JSON Backup File :?:

Re: use Firefox bookmarks-YYYY-MM-DD.json

Posted: Sat Aug 21, 2021 12:16 am
by danielmaximiliano
Try viewtopic.php?f=15&t=5762&hilit=HBJSON3.0
read
Opening JSON Files with Notepad++

Download and install Notepad++.
Open Notepad++, click the Plugins button at the top and select Plugins Admin.
In the Plugins Admin window, search JSON Viewer and install the JSON Viewer plugin.
When prompted, click Yes. Notepad++ will exit and then restart after the plugin has finished installing.
Now, navigate to File > Open or press the CTRL + O buttons and select the JSON file you want to open.
Once the file is opened, go to Plugins > JSON Viewer and select Format JSON. Then again go to Plugins > JSON Viewer and select Show JSON Viewer.
You can now view and edit the contents of the JSON file.

Re: use Firefox bookmarks-YYYY-MM-DD.json

Posted: Sat Aug 21, 2021 12:28 am
by danielmaximiliano
in firefox menu file, OPEN, SEARCH THE json file and look at its structure
2021-08-20 21_27_29-Window.png
2021-08-20 21_27_29-Window.png (29.54 KiB) Viewed 4603 times

Re: use Firefox bookmarks-YYYY-MM-DD.json

Posted: Sat Aug 21, 2021 4:34 am
by Rathinagiri
If you want to read it from HMG, use SQLite library!

Yes! SQLite can convert JSON to tables!

Re: use Firefox bookmarks-YYYY-MM-DD.json

Posted: Sat Aug 21, 2021 8:27 am
by AUGE_OHR
hi,
Rathinagiri wrote: Sat Aug 21, 2021 4:34 am If you want to read it from HMG, use SQLite library!
Yes! SQLite can convert JSON to tables!
Yes i have "think" about "read" SQlite Table "direct" ... but it need to "learn" how it work under HMG

while Daniel "remind" me that JSON have a "Format-Structure" i user FileIO and search for "Delimiter"

each "Row" start with

Code: Select all

   cSeek := "{"+CHR(34)+"guid"+CHR(34)+":"
and "End" with

Code: Select all

   nEnde := hb_AT( "}", cBuffer , nPosi)
as i only need URI and Description i search for

Code: Select all

   cSeek := CHR(34)+"uri"+CHR(34)+":"
now i got it so far and wanted to transfer it to DBF ... but how LEN ...
nMaxTXT : 142
nMaxURI : 650
so URI will not fit into Type "C", or :?:

Re: use Firefox bookmarks-YYYY-MM-DD.json

Posted: Tue Sep 14, 2021 6:41 pm
by mol
character field maybe longer than 255 character, is it problem?

Re: use Firefox bookmarks-YYYY-MM-DD.json

Posted: Wed Sep 15, 2021 3:23 pm
by jairpinho
hello see if it helps

Code: Select all


#include "hbclass.ch"

/*
 Clase que define los methods que seran necesarios sobrecargar
 para darle funcionalidad */

CLASS BaseService

   // La data uValue inicialmente es un array. Lo he dejado de esta manera
   // pensando más en devolver una lista que un objeto JSON.
   DATA uValue
   DATA lError INIT .F.

   METHOD New()                    CONSTRUCTOR
   METHOD getError()              INLINE ::lError
   METHOD GetJSON()
   METHOD getBydId()
   METHOD findAll()
   METHOD DeleteBydId()
   METHOD Create()
   METHOD Modify()

END CLASS


METHOD New()  CLASS BaseService

   ::uValue := {}

   RETURN Self
/*
 Por defecto, los methods , si no estan sobreescritos, el valor de retorno
 dará un error 501 Not Implemented
*/

METHOD getBydId() CLASS BaseService
   RETURN ( ::lError := .T.,  USetStatusCode( 501 ) )

METHOD findAll()  CLASS BaseService
   RETURN ( ::lError := .T.,  USetStatusCode( 501 ) )

METHOD DeleteBydId() CLASS BaseService
   RETURN ( ::lError := .T.,  USetStatusCode( 501 ) )

METHOD Create() CLASS BaseService
   RETURN ( ::lError := .T.,  USetStatusCode( 501 ) )

METHOD Modify() CLASS BaseService
   RETURN ( ::lError := .T.,  USetStatusCode( 501 ) )

METHOD GetJSON() CLASS BaseService
   RETURN if( ::uValue != NIL, hb_jsonEncode( ::uValue, .T. ), NIL )