Skip to content

Instantly share code, notes, and snippets.

@9214
Last active August 19, 2024 04:18
Show Gist options
  • Save 9214/4b8d66800bfdebd6a4f2f00258f6cfc0 to your computer and use it in GitHub Desktop.
Save 9214/4b8d66800bfdebd6a4f2f00258f6cfc0 to your computer and use it in GitHub Desktop.

Revisions

  1. 9214 revised this gist Mar 30, 2024. No changes.
  2. 9214 revised this gist Mar 30, 2024. No changes.
  3. 9214 revised this gist Oct 16, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion scrape.red
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    Red [
    Title: "The world's smallest web scraper"
    Title: "A Parse-based port of Michael Gilliland's web scraper"
    Author: @9214
    Date: 16-Oct-2020
    Link: https://youtu.be/HDMa4gcgEgI
  4. 9214 revised this gist Oct 16, 2020. No changes.
  5. 9214 revised this gist Oct 16, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion scrape.red
    Original file line number Diff line number Diff line change
    @@ -7,5 +7,6 @@ Red [

    page: read-thru/binary to url! system/script/args
    link: [copy match [ahead https:// url!]]
    rule: [collect any [link keep (to url! match) | skip]]

    parse page [collect any [link keep (to url! match) | skip]]
    parse page rule
  6. 9214 revised this gist Oct 16, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion scrape.red
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,6 @@ Red [
    ]

    page: read-thru/binary to url! system/script/args
    link: [copy match [ahead https:// url!] (take/last match)]
    link: [copy match [ahead https:// url!]]

    parse page [collect any [link keep (to url! match) | skip]]
  7. 9214 revised this gist Oct 16, 2020. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions scrape.red
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,11 @@
    Red [
    Title: "The world's smallest web scraper"
    Author: @9214
    File: %scrape.red
    Date: 16-Oct-2020
    Link: https://youtu.be/HDMa4gcgEgI
    ]

    page: read-thru/binary to url! system/script/args
    link: [copy match [ahead https:// url!] (take/last match)]

    parse read-thru/binary to url! system/script/args [
    collect any [link keep (to url! match) | skip]
    ]
    parse page [collect any [link keep (to url! match) | skip]]
  8. 9214 created this gist Oct 16, 2020.
    13 changes: 13 additions & 0 deletions scrape.red
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    Red [
    Title: "The world's smallest web scraper"
    Author: @9214
    File: %scrape.red
    Date: 16-Oct-2020
    Link: https://youtu.be/HDMa4gcgEgI
    ]

    link: [copy match [ahead https:// url!] (take/last match)]

    parse read-thru/binary to url! system/script/args [
    collect any [link keep (to url! match) | skip]
    ]