GPL headers.
This commit is contained in:
parent
d94fe71f96
commit
3560243e78
3 changed files with 68 additions and 14 deletions
|
@ -1,4 +1,24 @@
|
|||
#!/usr/bin/env -S guile -e main -s
|
||||
#!/usr/bin/guile \
|
||||
-e main -s
|
||||
|
||||
De-Blogger script for cleaning up data exported from blogger and downloading
|
||||
linked images from the Blogger CDN.
|
||||
|
||||
Copyright (C) 2024 Ray Miller <ray@1729.org.uk>.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
!#
|
||||
|
||||
(use-modules (srfi srfi-26)
|
||||
|
@ -62,13 +82,13 @@
|
|||
filename)))))
|
||||
|
||||
(define (replace-images doc)
|
||||
(for-each (lambda (m)
|
||||
(let* ((url (match:substring m 1))
|
||||
(filename (download-image url))
|
||||
(new-url (string-append "/img/" filename)))
|
||||
(set! doc (string-replace-substring doc url new-url))))
|
||||
(list-matches md-img-rx doc))
|
||||
doc)
|
||||
(for-each (lambda (m)
|
||||
(let* ((url (match:substring m 1))
|
||||
(filename (download-image url))
|
||||
(new-url (string-append "/img/" filename)))
|
||||
(set! doc (string-replace-substring doc url new-url))))
|
||||
(list-matches md-img-rx doc))
|
||||
doc)
|
||||
|
||||
(define (replace-image-links doc)
|
||||
(for-each (lambda (m)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue