Pick data from the same pastebin 2x

I am looking to cut down my command a bit
This is currently how I approach the issue

$(eval cards = $(urlfetch json https://pastebin.com/raw/xxxxx); pick = cards[Math.floor(Math.random() * cards.length)]; BlahBlah1 ${pick.name} BlahBlah2 ${pick.meaning}.:wink: $(eval cards = $(urlfetch json https://pastebin.com/raw/xxxxx); pick = cards[Math.floor(Math.random() * cards.length)]; BlahBlah3 ${pick.name} BlahBlah 4 ${pick.meaning}.:wink:

Pastebin 1
[

{
“name”: “Person1intro Goes Here”,
“meaning”: “person1 longer response goes here”
},
]

Pastebin2
[
{
“name”: “Person2intro Goes Here”,
“meaning”: “person2 longer response goes here”
},
{
“name”: “Person2intro Goes Here”,
“meaning”: “person2 longer response goes here”
},
{
“name”: “Person2intro Goes Here”,
“meaning”: “person2 longer response goes here”
},
]

So the first BlahBlah1 and BlahBlah2 is for response(person1) and then BlahBlah3 and BlahBlah4 is a response(person2)

What I was looking to do is pull all the data from one pastebin more so for a clean code.

I just can’t remember how all that works anymore…
any help is welcomed - JTS

To accomplish this simply return a string that includes both of the properties you’ll looking to add. Here is an example below:

$(eval const res = $(urlfetch json https://pastebin.com/raw/FvmydBLK); const pick = res[Math.floor(Math.random() * res.length)]; `Name: ${pick.name} - Meaning: ${pick.meaning}`)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.