github.com/everdrone/grab@v0.1.7-0.20230416223925-40674b995521/cmd/grab.hcl.gtpl (about)

     1  global {
     2    location = "{{ .Location }}"
     3  }
     4  
     5  site "unsplash" {
     6    test = "unsplash"
     7  
     8    asset "image" {
     9      pattern = "contentUrl\":\"([^\"]+)\""
    10      capture = 1
    11  
    12      transform filename {
    13        pattern = "(?:.+)photos\\/(.*)"
    14        replace = "$${1}.jpg"
    15      }
    16    }
    17  
    18    info "title" {
    19      pattern = "meta[^>]+property=\"og:title\"[^>]+content=\"(?P<title>[^\"]+)\""
    20      capture = "title"
    21    }
    22  
    23    subdirectory {
    24      pattern = "\\(@(?P<username>\\w+)\\)"
    25      capture = "username"
    26      from    = body
    27    }
    28  }