Skip to content
/ net Public

net is a simple and handy common lisp dramka wrapper

Notifications You must be signed in to change notification settings

scinart/net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

description

net is a simple and handy wrapper of common lisp package dramka.

usage

use quicklisp to load this package.

(ql:quickload :net)
;; get raw content
(defvar raw-content (net:wget "http://some.url.com/"))
;; use [Closure HTML](http://common-lisp.net/project/closure/closure-html/) to parse
(defvar list-content (net:parse raw-content))
;; select your content.
(defvar useful (net:find-node list-content
                              #'(lambda (x) (and (listp x)
                                           (eq :div (first x))))
                              #'third))
;; now useful is the collection of content of outermost <div>.

example

First it is super simple that I suggest you read the source code.

Crawl Example

cookies or post

gbk encoding:
(babel:octets-to-string (net:wget url) :encoding :gbk)

recommand packages

;; very good json library
;; (ql:quickload :st-json)
;; GBK codec facility
;; (ql:quickload :babel)
;; regular expression library
;; (ql:quickload :cl-ppcre)

license

BSD 2-Clause License.

About

net is a simple and handy common lisp dramka wrapper

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published