Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scinart/net
net is a simple and handy common lisp dramka wrapper
https://github.com/scinart/net
Last synced: 3 months ago
JSON representation
net is a simple and handy common lisp dramka wrapper
- Host: GitHub
- URL: https://github.com/scinart/net
- Owner: scinart
- Created: 2014-06-14T12:59:00.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-14T15:47:18.000Z (over 10 years ago)
- Last Synced: 2024-05-13T22:50:34.655Z (6 months ago)
- Language: Common Lisp
- Size: 129 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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.example
======First it is super simple that I suggest you read the source code.
[Crawl Example](http://scinart.github.io/lisp/2014/06/14/common-lisp-simple-crawl/#toc4)
[cookies or post](http://scinart.github.io/lisp/2014/06/14/common-lisp-simple-crawl/#toc5)
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.