diff options
author | nathansmith <nathansmith@posteo.com> | 2025-05-23 07:43:34 -0600 |
---|---|---|
committer | nathansmith <nathansmith@posteo.com> | 2025-05-23 07:43:34 -0600 |
commit | 4e749697600bab526b1cf51bcca493f6d31d2e34 (patch) | |
tree | 10a0274c96667d1482dd7f07d768feaf518d6187 /testTheThing/clean_up_html.scm | |
parent | d194694f31002068868a378d121ed0e2db01c378 (diff) |
Almost done with this stupidness
Diffstat (limited to 'testTheThing/clean_up_html.scm')
-rwxr-xr-x | testTheThing/clean_up_html.scm | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/testTheThing/clean_up_html.scm b/testTheThing/clean_up_html.scm deleted file mode 100755 index 6ee81c5..0000000 --- a/testTheThing/clean_up_html.scm +++ /dev/null @@ -1,45 +0,0 @@ -#! /usr/bin/guile \ --e main -s -!# - -;; Loads an entire text file into a string -(define (read-entire-file-port fp) - (letrec ((read-characters - (lambda (fp) - (let ((character (read-char fp))) - (if (eof-object? character) - "" - (string-append (string character) - (read-characters fp))))))) - (read-characters fp))) - -(define (trim-words-all content word) - (let ((index (string-contains content word))) - (if index - (trim-words-all (string-append - (substring content 0 index) - (substring content - (+ index (string-length word)) - (string-length content))) - word) - content))) - -(define (clean-up-html file-name) - (call-with-input-file file-name - (lambda (fp) - (let ((content (read-entire-file-port fp)) - (remove-list '("<table border=\"1\" width=\"60%\">" - "<table>" - "</table>" - "<tr>" - "<td>" - "</tr>" - "</td>"))) - (for-each - (lambda (item) - (set! content (trim-words-all content item))) - remove-list) - (display content))))) - -(define (main args) - (clean-up-html (cadr args))) |