Products:
News
Contact
German Website
Home Features Screenshots Videos Downloads Shop Knowledgebase


Search Knowledgebase:

 

Monitor JSON files

User question:

> I need to monitor the content of a JSON file but WSW only checks the

> file by file date. I would also like to reformat the JSON file as it

> does not have any line breaks. Possible?

Adjust the file type

If WebSite-Watcher monitors the JSON file by file date, you have to manually change the file type to "text" in the bookmark properties first. Then this JSON will be handled as text file and WSW will monitor this file by content instead of the file date.

 

1. Open the bookmark properties

2. Select the "Advanced" tab

3. Select "Check options" on the left side

4. Change the file type to "text"

 

json-1

 

Format JSON file

If the JSON file has no line breaks, then you can create a simple private plugin to apply some basic formatting.

 

1. Open the bookmark properties

2. Select the "Advanced" tab

3. Select "Plugin" on the left side

4. Click the button "Create Private Plugin"

5. Enter this plugin code

 

Sub Wsw_PreprocessPage(ByRef $sMem, ByRef $sStatusMessage, ByRef $iStatusCode)
   $sMem = Replace($sMem, "{", CRLF + "{")
   $sMem = Replace($sMem, ",", "," + CRLF + "   ")
   $sMem = Replace($sMem, "}", CRLF + "}")
End Sub

 

6. Close and check the bookmark

 

 

json-4

 

json-5

Results

Content without private plugin:

 

json-2

 

Content with basic formatting (via private plugin):

 

json-3