Skip to content

Instantly share code, notes, and snippets.

@Guevara-chan
Last active February 5, 2022 16:23
Show Gist options
  • Save Guevara-chan/0324d2831da58bea41424cfc55f2c39c to your computer and use it in GitHub Desktop.
Save Guevara-chan/0324d2831da58bea41424cfc55f2c39c to your computer and use it in GitHub Desktop.
Rebolutionary junk sites URL generation util.
REBOL [Title: "REBOL Dust" Author: "Victoria Guevara" Version: 0.0.1]
def_setup: make object! [
char_pool: "abcdefghijklmnopqrstuvwxyz0123456789"
domains: ['.com '.org '.net]
lim: 5x6
]
cfg_file: %config.cfg
setup: either exists? cfg_file [load cfg_file][save/all cfg_file def_setup def_setup]
random/seed now
random_url: func [len domain pool] [
url: copy ""
loop len [append url (pick pool random (length? pool))]
append url domain
]
promise_ip: func [url /local dns] [
dns: open make port! [scheme: 'dns host: "/async" ]
dns/timeout = 2
insert dns url
return make object! [src: copy url port: dns]
]
requests: []
forever [
for len setup/lim/x setup/lim/y 1 [
foreach domain setup/domains [
either (length? requests) < 500 [
append requests promise_ip random_url len domain setup/char_pool
][first_req: first requests wait firest_req/port]
]
]
remove-each req requests [
either error? try [ip: copy req/port]
[false]
[close req/port if not none? ip [
write/append/lines %results.txt link: join "http://" req/src
print link]
true]
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment