Rebol [
    Title:   "'Whois' Function"
    Date:    11-May-2001
    Version: 0.1.0
    File:    %whois-lookup.r
    Home:    http://www.ross-gill.com/
    Author:  "Christopher Ross-Gill"
    Owner:   "Arran Multimedia Studio"
    Rights:  "Copyright ©2001 Christopher Ross-Gill"
    Purpose: "To Utilise Network Solutions' Whois Database"
    Usage:   {
        print whois 'ross-gill.com
        print whois/server 'ross-gill.com 'whois.nic.com
    }
]

whois: func [
    "Retrieves 'whois' information from Network Solutions' server"
    domain "Domain to Look Up" [string! word!]
    /server
    whois-domain "Alternative Whois Server" [string! word!]
][
    if not server [whois-domain: 'whois.networksolutions.com]
    read join whois:// [domain "@" whois-domain]
]

;o) Usual Network Solutions Info

ns-blurb: decompress #{
789C95544D6FD4400CBDE757F8462B6D57826339012DA2075A892DA01E271327
B1988FE099D96DF8F5D893FD68D54A884BA22463BFE7F79E737B777FF3E91A3E
DC5EC1FDF5B7AF1BB8FB0CDF37D797F0100B184608318329798C4C7FB0831CC1
588B294164F85D90678885E1E797BB9B4DD3996C5A9310F2C8B10CA3DC118A3C
C71E461AC68B6D74C5E34A1B466F32762B408736730C6461E2A89D31ADE17EC4
E64ABA0105F8814C1B1AC29BB4C0C0118692D66CA91362ED7C3C08BD70A32057
C1A0189AA9F014A52FC4E066410FCB1C2951CA3021A7189222C5361B0A1486A7
D560DA58B28ECBE89473A3B5D0C90052128C47F93048275E8E33DAC8DDFAC4A6
8B82AC320EC5B0091985784E2A636163E775F37186545A4F392BB4D94F59C55D
C1AC3E0C2C450ADBCAAC3AAA0ADB47E7E24E4B32B24F2AB2687DD93C9C2A4693
6B036FE6EA431E45B2AAAB2A51757266D717074789AA385A5742872CBC1B4B6C
8B4FD904710776E45CEDF9BC5F8E9770F6F61C8C72125783699D182D0051B8F2
8EE4742AD31439374A5ED40AC99358209209732F6E08648A8E2CD560D8E83DB2
25E3C0745BE44C4967958EFB4355EED46CC9005E88196E2542389CC61816E4DE
D8449E1CBED7A7B377E77B5A358BF0328BCD6B595CC430D3247A89034757CF34
6362A3D09C8A1800694E197D3A5FC2ABAFC9558A2B89C464EC2F3308FF157432
347A0A4B5A0E021DD6E4A4A8DCF1716221E1E646E88CD4AA3062802CA3045255
9C98A4C18E253A18844A4818B2B639D05CC3290D1A419940809AFF59C6D7565E
B19FAFFC93BC0B65E46D554E5643902AAC665487460D0F1F3AEA8717BD741555
5AF119552ECBB8E848C1BAD2690A0E2238F137EF55D634E3A3B6A52D3695680D
4C7F8238FD3A341E3522E40AD7DD3AE5F4C996E91F46D3265BFA8FF97CECA8AF
CAE85ED485D4DC0479451ED77F016AA6F51168050000
}

;o) Little 'Whois' GUI

x-whois: layout [
    space 10
    ;b: backdrop http://www.ross-gill.com/r/back-tartan.png
    h1 "'Whois' Lookup"
    across
    i-domain: field 230 "138.197.133.189" 238.238.238 255.255.255
    edge [color: black effect: none]
    btn 60 "Lookup" [
        o-reply/text: replace/all whois i-domain/text ns-blurb ""
        show x-whois
    ]
    btn 60 "Copy" [
        write clipboard:// o-reply/text
    ]
    btn 60 "Browse" [
        browse join http:// ["www." i-domain/text "/"]
    ]
    return
    o-reply: area 600x300 "" 238.238.238 255.255.255
    feel [
        redraw: func [face idx][
            face/size: x-whois/size - 40x112
        ]
    ]
    edge [color: black effect: none]
    font [name: font-fixed style: 'bold]
    return
]

x-whois/color: 160.180.160
x-whois/effect: [grid 150.170.150]

if not system/script/args [
    view/title/offset/options x-whois "'Whois' Lookup" 50x50 [resize]
]