Created
November 26, 2019 14:22
-
-
Save toomasv/e6f237d31b4402cac07a1115ccecb3f1 to your computer and use it in GitHub Desktop.
Crude hack for cleaning a web-page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Red [ | |
| Date: 26-Nov-2019 | |
| See: https://gitter.im/red/help?at=5ddd28def65fec1c8e72c7da | |
| ] | |
| clean-url: function [url][ | |
| bin: read/binary url | |
| while [ | |
| error? err: try [str: to-string b: bin] | |
| ][ | |
| while [b: find b err/arg1][remove b] | |
| ] str | |
| ] | |
| ; E.g. | |
| comment [ | |
| >> read http://www.iwritewordsgood.com/apl/patterns/apl014.htm | |
| *** Access Error: invalid UTF-8 encoding: #{8B6E6F20} | |
| *** Where: read | |
| *** Stack: | |
| >> clean-url http://www.iwritewordsgood.com/apl/patterns/apl014.htm | |
| == {<HTML>^/<HEAD>^/<TITLE>14 Indentifiable Neighborhood</TITLE>^/^/^/^/<link rel="stylesheet" href="../patternlanguag... | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment