REBOL [
    Title: "Load CureCode"
    Date: 20-Feb-2013
    Author: "Christopher Ross-Gill"
]

load-ccpage: use [page! comment! comment-rule][
    page!: context [
        id: html:
        status: version: date: category: submitter: platform: severity:  priority:
        summary: content: comments: none
    ]

    comment!: context [
        id: by: date: content: none
    ]

    comment-rule: [
        <small> set id string! </small> string! <br>
        <b> set name string! </b> <br> set date string! 5 skip
        <td valign="top"> copy content to </td>
        (content: trim/head/tail join "" content)
    ]

    func [
        id [url! integer!]
        /local page comment
    ][
        if integer? id [id: join http://curecode.org/rebol3/ticket.rsp?id= id]

        page: make page! []
        page/id: :id
        page/html: load/markup id

        parse page/html bind [
            (comments: copy [])
            some [
                  "Status" </th> skip set status string!
                | <th> "Date" </th> skip set date string!
                | "Version" </th> skip set version string!
                | "Category" </th> skip set category string!
                | "Submitted by" </th> skip set submitter string!
                | "Platform" </th> skip set platform string!
                | "Severity" </th> skip set severity string!
                | "Priority" </th> skip set priority string!
                | "Summary" </th> string! <td valign="top" class="sum"> set summary string!
                | "Description" </th> skip skip copy content to </td>
                  (content: trim/head/tail join "" content)
                | <a name="comments"> "Comments" (bind comment-rule comment: make comment! [])
                | comment-rule (
                    append comments comment
                    bind comment-rule comment: make comment! []
                )
                | skip
            ]
        ] page
        page 
    ]
]