content: 
  sub Init()
      m.top.functionName = "GetMovies"
  end sub
  
  sub GetMovies()
      seconds = CreateObject("roDateTime").AsSeconds().toStr()
      req = CreateObject("roURLTransfer")
      req.SetCertificatesFile("common:/certs/ca-bundle.crt")
      req.SetUrl("https://gist.githubusercontent.com/leosantosw/c7a774a1e509af23427778578b653ea2/raw/e84a576ac0c1307c6f9d9639160a24688836c8d6/movies.json?timestamp=" + seconds)
      response = req.GetToString()
      json = ParseJson(response)
  
      if json <> invalid
          ' Cria o ContentNode raiz
          contentNode = CreateObject("roSGNode", "ContentNode")
  
          for each category in json
              value = json.Lookup(category)
              if Type(value) = "roArray"
                  rowNode = CreateObject("roSGNode", "ContentNode")
                  rowNode.title = category
  
                  for each movie in value
                      movieNode = CreateObject("roSGNode", "ContentNode")
                      movieNode.title = movie["nome"]
                      movieNode.description = movie["descrição"]
                      movieNode.length = movie["duração"]
                      movieNode.hdPosterURL = movie["imagem"]
                      rowNode.appendChild(movieNode)
                  end for
  
                  contentNode.appendChild(rowNode)
              end if
          end for
  
          ' Atribui o contentNode ao campo 'movies' do componente
          m.top.movies = contentNode
      else
          print "Erro: JSON inválido ou vazio."
      end if
  end sub
  