Skip to content

A 4chan Swift API & command line tool

Notifications You must be signed in to change notification settings

mattlawer/4chan-Swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

4chan-Swift

Browse 4chan like a boss with a Swift API.

Based on 4chan-API.

Swift API Usage

Import the files from the API folder to your project and you're good to go !

Use it just like a regular URLSession dataTask...

let session = URLSession.shared // You also could use your own session

let board = "wg" // The board you want
let threadNum = 6942115 // The thread #
session.chanTask(board, thread: threadNum) { (thread, response, error) in
	// just use the ChanThread object named thread here 😋
}.resume()

Or

let page = 3 // the page you want to load
session.chanTask(board, page: page) { (page, response, error) in
	// just use the ChanPage object named page here 😋
}.resume()

Command-Line Tool

Installation

git clone https://github.com/mattlawer/4chan-Swift.git
cd 4chan-Swift
make
make install

Usage

Usage : 4chan -b <board> [-t <thread> | -p <page>]
	-b <board> : 
	-t <thread> : the thread n°
	-p <page> : the board page to load
	-h show this help screen
	
example:
	4chan -b r -t 123456789