Catalog npm
PACKAGE EXPLORERView in registry

4chanapi.js

npm

Wrapper around parts of the 4chan JSON api that make it easy to rip media from 4chan en masse.

Versions collected3
Direct dependencies3From release 1.1.1
Last observed20 Oct, 20:07 UTC

README

Current package documentation

#install

The usual.

npm install --save 4chanapi.js

#usage

There are two functions exported, one to grab the threads on a particular board that match any of an array of keywords, and one that returns the media links for a given thread. This is done via promises or async/await.

#example

let chan = require('4chanapi.js')

async function testIt() {
let threads = await chan.threadsWithTopics("v", ["rpg", "metal gear"])
console.log(threads)
let results = await chan.threadMediaLinks(threads[0].url)
console.log(results)
}

testIt()

In the above example threads would be an array of objects like this:

[ { url: 'https://a.4cdn.org/v/thread/123.json',
semantic_url: 'do-people-actually-find-puzzle-maps-in-rpgs-fun' },
{ url: 'https://a.4cdn.org/v/thread/321.json',
semantic_url: 'best-story-in-gaming-with-xenogears' } ]

The url is the url of the json api endpoint for that thread, as used by the other function. The semantic_url is the slugified thread title, suitable for use as a folder name. The output of results is an array of simple string values representing the pictures/webms in the thread.

[ 'https://i.4cdn.org/v/123.png' ]

There's no function provided to actually download the images, that's up to you.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 3

Collected releases
VersionPublishedDirect dependenciesOpen version
1.1.1Registry latest24 Apr 20173
1.1.024 Apr 20173
0.2.020 Apr 20172

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:07 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:182bd53cecf7d30a7915fc7be00968f735e4191c1882feff85f0f803af7254fe