File tree Expand file tree Collapse file tree 1 file changed +9
-21
lines changed
Expand file tree Collapse file tree 1 file changed +9
-21
lines changed Original file line number Diff line number Diff line change 2525 (return-from ascii-p nil ))))
2626 t )
2727
28-
29- (defun known-binary (url)
30- " Given a URL, returns a truthy value if its a binary.
31-
32- A poor way to determine if we want to go grab something for link
33- examination. Really needs to be a regex or a smart substring chop."
34- (or (search " .png" url)
35- (search " .bmp" url)
36- (search " .jpg" url)
37- (search " .exe" url)
38- (search " .dmg" url)
39- (search " .package" url)
40- (search " .css" url)
41- (search " .ico" url)
42- (search " .gif" url)
43- (search " .dtd" url)
44- (search " .pdf" url)
45- (search " .xml" url)
46- (search " .tgz" url))
47- )
28+ (defun known-binary-p (url)
29+ " Is this url a binary file?"
30+ (let ((binaries
31+ ' (" .png" " .bmp" " .jpg" " .exe" " .dmg" " .package" " .css"
32+ " .ico" " .gif" " .dtd" " .pdf" " .xml" " .tgz" )))
33+ (dolist (b binaries NIL )
34+ (when (search b url)
35+ (return T )))))
4836
4937(defun find-links (url)
5038 " Scrapes links from a URL. Prints to STDOUT if an error is caught"
5139 (when (and (http-p url)
52- (not (known-binary url)))
40+ (not (known-binary-p url)))
5341 (handler-case
5442 (let ((page (drakma :http-request url)))
5543 (when page
You can’t perform that action at this time.
0 commit comments