-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathyotsubAPI.scrbl
62 lines (48 loc) · 2.32 KB
/
yotsubAPI.scrbl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#lang scribble/manual
@(require (for-label racket/base
"main.rkt"))
@title{4chan API Client Library}
@defmodule[yotsubAPI]
yotsubAPI is an interface to the 4chan JSON API. The catalog is a list of threads
and the threads are @racket[hasheq]'s.
@section{Procedures}
@defproc[(4chan-data [board string?] [x (or/c string? number?)]) (listof hash-eq?)]{
This procedure is used as the backbone for many other procedures.
It takes a board identifier (e.g. "g" or "a") and either a thread number
or the string "catalog".
}
@defproc[(4chan-data-page [board string?] [n number?]) (listof hash-eq?)]{
This procedure takes a board identifier as a string and a page number
and returns a list of hashes with information about the page.
}
@defproc[(4chan-data-catalog [board string?]) (listof hash-eq?)]{
This procedure takes a board identifier and returns a list of hashes
containing information about that board's catalog.
}
@defproc[(4chan-data-thread [board string?] [id number?]) (listof hash-eq?)]{
This procedure takes a board identifier and a thread number and
returns a @racket[hasheq] containing the information about that thread.
}
@defproc[(4chan-catalog-search [catalog hash-eq?]
[pattern (or/c regexp? byte-regexp? string? bytes?)])
(listof hash-eq?)]{
This procedure takes a list of hashes (created from running @racket[4chan-data-catalog])
and a regexp pattern to search and returns a @racket[hasheq] containing the search results.
}
@defproc[(4chan-thread-match-fn
[pattern (or/c regexp? byte-regexp? string? bytes?)]) procedure?]{
This procedure is a helper procedure where you provide a pattern and
it will return a procedure that you apply to a thread's @racket[hasheq].
}
@defproc[(4chan-thread-is-lisp-general? [thread hash-eq?]) boolean?]{
This procedure is a helper procedure takes takes a thread's @racket[hasheq]
and will return a boolean value.
}
@defproc[(4chan-catalog-find-lisp-general [catalog (listof hash-eq?)]) hash-eq?]{
This procedure takes a catalog's @racket[hasheq] and returns the @racket[hasheq]
for the first Lisp General it finds, if it exists.
}
@defproc[(4chan-thread-url [board string?] [thread hash-eq?]) string?]{
This procedure takes a board identifier and a thread's @racket[hasheq] and returns
its URL as a string.
}