Shortcode error: bad character U+0022

I’m trying to make a shortcode with two parameters, a CSS class and a Tweet ID. I want to use it like this in post.md:

{{< tweet-single class="alignright" id="1225240565509316608" >}}

to produce the html:

<div class="tweet-in-post alignright">
<twitter-widget class=....
</div>

but using this in tweet-single.html

<!-- tweet-single -->

<div class="tweet-in-post {{ .Get "class" }}">

{{ (getJSON "https://api.twitter.com/1.1/statuses/oembed.json?dnt=1&hide_thread=1&id={{ .Get "id" }}" }}

</div>

gives me the error bad character U+0022 ‘"’.

How can I get this shortcode to work?

There are syntax errors in the line above, you cannot have double brackets within double brackets. Also a fuction can be within a parentheses only if it is nested within another function.

I know I have errors; but how do I fix it? :slight_smile:

The docs has examples with using getJSON and urls.

I see the docs, but there are no examples of how to use multiple inputs, i.e. arg1 and arg 2

{{ $dataJ := getJSON "url prefix" "arg1" "arg2" "arg n" }}

in a shortcode.