Skip to content

Instantly share code, notes, and snippets.

@greevex
Created October 13, 2014 12:29
Show Gist options
  • Save greevex/7ea363fa86b19227808b to your computer and use it in GitHub Desktop.
Save greevex/7ea363fa86b19227808b to your computer and use it in GitHub Desktop.
Package "sds.sdk.test.start"
Var Queue $queue
Var Integer $count
Block start {
$queue.append "http://yandex.ru"
Foreach $queue
- set item $item
- call this.process $item
}
Block process {
Input $url
Call SDS.output.print "Processing {$url}"
Load $url
- set proxy "random"
- set userAgent "auto"
- set attempts 5
- put result to $content
Parse:template $content
- set match "auto"
- set on_fail "skip"
- put result to $result
If $result.data.status == false
- call SDS.output.print "Status FAIL"
- set break true
Foreach $result.data.items
- set item $item
- call SDS.api.document.post $item
Foreach $result.data.links
- set item $link
- call $queue.append $link
Call SDS.output.print "Done!"
Return $result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment