{{ $regex := `(?i)https?:\/\/(\w+)\.douban\.com\/subject\/(\d+)` }} {{ $urls := findRE $regex .Destination }} {{ if $urls }} {{ $url :=index ($urls) 0 }} {{ $dbtype := replaceRE $regex "$1" $url }} {{ $dbid := replaceRE $regex "$2" $url }} {{ $dbFetch := getJSON "https://dbapi.wpista.com/" $dbtype "/" $dbid }} {{ if $dbFetch }} {{ $subject := $dbFetch }} {{ $number := (float $subject.douban_score) }}
{{ $subject.douban_score }}
{{ $subject.card_subtitle }}
{{else}} {{ .Text | safeHTML }} {{end}} {{ else }} {{ .Text | safeHTML }} {{ end }}