Skip to content

Commit

Permalink
add qrator example
Browse files Browse the repository at this point in the history
  • Loading branch information
arriven committed Apr 19, 2022
1 parent aa03e56 commit 37ed26d
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions examples/config/advanced/qrator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# it is here for educational purposes only and is meant to showcase the capabilities of the tool
jobs:
- type: sequence
args:
jobs:
- type: set-value
name: useragent
args:
value: "{{ random_user_agent }}"
- type: http-request
name: initial
args:
request:
method: GET
path: https://www.citilink.ru
headers:
User-Agent: '{{ .Value (ctx_key "data.useragent") }}'
Accept: "text/html"
Accept-Language: "en-US"
Connection: "keep-alive"
- type: set-value
name: source
args:
value: '{{ index (.Value (ctx_key "data.initial")) "response" "body" }}'
- type: set-value
name: extract-script
args:
value: '{{ index (split (index (split (.Value (ctx_key "data.source")) "function() {") 1) "var config") 0 }}'
- type: js
name: exec-script
args:
script: '{{ .Value (ctx_key "data.extract-script") }}'
- type: http-request # replace it with http or parallel for some flood
name: final
args:
request:
method: GET
path: https://www.citilink.ru
headers:
User-Agent: '{{ .Value (ctx_key "data.useragent") }}'
cookies:
_pcl: '{{ .Value (ctx_key "data.exec-script") }}'
- type: log
args:
text: 'result: {{ .Value (ctx_key "data.final") }}'

0 comments on commit 37ed26d

Please sign in to comment.