old_contents: 
  from requests import get as rget
  from changeffapi import Loader
  
  NODESJSON = 'http://map.freifunk-mainz.de/nodes.json'
  FFAPIJSON = 'ffapi_file.json'
  
  def scrape(url):
      '''returns remote json'''
      try:
          return rget(url).json()
      except Exception as ex:
          print('Error: %s' %(ex))
  
  if __name__ == '__main__':
      nodes = scrape(NODESJSON)
  
      if nodes:
          online = 0
          loader = Loader(FFAPIJSON)
  
          for node in nodes['nodes']:
              if node['flags']['online'] and node['name']:
                  online += 1
  
          if online != int(loader.find(['state', 'nodes'])):
              loader.set(['state', 'nodes'], online)
              print('state,nodes => %s\n' %(loader.find(['state', 'nodes'])))
              loader.dump(overwrite=True)
  
new_contents: 
  from sys import argv
  from requests import get as rget
  from changeffapi import Loader
  
  NODESJSON = 'http://map.freifunk-mainz.de/nodes.json'
  FFAPIJSON = 'ffapi_file.json'
  
  def scrape(url):
      '''returns remote json'''
      try:
          return rget(url).json()
      except Exception as ex:
          print('Error: %s' %(ex))
  
  if __name__ == '__main__':
      nodes = scrape(NODESJSON)
  
      if nodes:
          online = 0
          nonclient = 0
          loader = Loader(FFAPIJSON)
  
          for node in nodes['nodes']:
              if node['flags']['online']:
                  online += 1
                  if not node['flags']['client']:
                      nonclient += 1
  
          if nonclient != int(loader.find(['state', 'nodes'])):
              loader.set(['state', 'nodes'], nonclient)
  
              if len(argv) > 1:
                  print('state,nodes => %s' %(loader.find(['state', 'nodes'])))
                  print('Status: online: %d -> [nonclient: %d, client: %d]' %(online, nonclient, online-nonclient))
              else:
                  loader.dump(overwrite=True)
  
subject: correct counting, some flag will only show statistics without overwriting.