use Firefox bookmarks-YYYY-MM-DD.json

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

use Firefox bookmarks-YYYY-MM-DD.json

Post by AUGE_OHR »

hi,

did somebody have Code to "read" Firefox *.JSON Backup File :?:
have fun
Jimmy
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

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

Post 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.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

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

Post 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 4600 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

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

Post by Rathinagiri »

If you want to read it from HMG, use SQLite library!

Yes! SQLite can convert JSON to tables!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

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

Post 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 :?:
have fun
Jimmy
User avatar
mol
Posts: 3825
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

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

Post by mol »

character field maybe longer than 255 character, is it problem?
User avatar
jairpinho
Posts: 420
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Contact:

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

Post 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 )
Jair Pinho
HMG ALTA REVOLUÇÃO xBASE
HMG xBASE REVOLUTION HIGH
http://www.hmgforum.com.br
Post Reply