Skip to content

Instantly share code, notes, and snippets.

@sansmoraxz
Last active March 26, 2023 09:33
Show Gist options
  • Save sansmoraxz/ea6bd5bad1ca4e259ba504bd51ba7905 to your computer and use it in GitHub Desktop.
Save sansmoraxz/ea6bd5bad1ca4e259ba504bd51ba7905 to your computer and use it in GitHub Desktop.
Gotoscrap- api spec
# Srapping Spec
template-version: v0.0.1
parameters:
- name: num
value: 1
request:
method: POST
url:
fn::sub: https://api.github.com/repos/itchyny/gojq/issues/${num}/comments
headers:
authorization: token {{ github_token }}
content-type: application/json
body: |
{
"body": "Hello World"
}
response:
status:
fn::ok: ~
headers:
Content-type: application/json
body: ~ # anything is ok
callbacks:
- fn::condition:
condition:
fn::lessThan:
- fn::ref: parameters::num
- 100
true:
- ~
false:
- fn::stop:
message: "number is >= 100"
- fn::saveToFile:
path:
fn::sub: /tmp/responses/${num}.json
content:
Struct::response:
body: ~
- fn::log:
message:
Struct::response:
body: ~
- fn::generate_next_request:
parameters:
num:
fn::add:
- fn::ref: parameters::num
- 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment