0

Please help build a scenario.

I want to recursively call an API with a different URL each time:

https://api.lunaciarover.com/.../0x38129b256a895afb06f5e3...

https://api.lunaciarover.com/.../0xc151798ffca08c8c8f95e2...

Then I want to parse the results into a single block of text:

ign: coinvision.co | bob, mmr: 3344, total slp: 500

ign: coinvision.co | fred, mmr: 1020, total slp: 200

...

etc.

From there I will send the text to Discord in a single message. I have made an effort, but I'm stuck on two things:

  • how to iterate and change the URL of the API call
  • how to append the string to the same message

Attempt shown in image below.

enter image description here

Luke Allison
  • 3,118
  • 3
  • 24
  • 40
  • 1
    Hi @Luke, If you are still facing the issue just let me know, I can help you resolve this. – Runcorn Sep 02 '21 at 16:19
  • The only thing I still don't know is how to do a one-shot task after a loop, ie. iterate through the modules in the scenario multiple times until complete and then once the loop is complete, run a module ONCE and finish. – Luke Allison Sep 11 '21 at 03:15
  • You can use Aggregrator Module and then run the module that you want to trigger at the end. Or, If you are comfortable with routers then you can use router to separate the path, when first route is complete then second one will be executed – Runcorn Sep 11 '21 at 18:43

1 Answers1

0

You should use Iterator and select as source split function with all values separated per commas. split(a,b,c;,) returns an array with 3 elements (a, b and c) and the iterator iterate over each element.

enter image description here

By other hand, to append multiple outputs to unique input you should use Flow Controls > Array aggregator.

Sergio Gragera
  • 786
  • 7
  • 10