Catalog npm
Back to packageRELEASE DETAILS

1.1.0

npm

4chan-list-webm

Returns an array of objects containing the webm filename and URL.

4chan4webmdownloadjsonthegamevideowebm
Published3 Jan 2018
Direct dependencies3
Transitive dependenciesNot calculated

README

Current package documentation

4chan-list-webm

npm version Build Status Coverage Status install size

Generate a list of webms posted in a thread.

Here's a little demonstration of 4chan-list-webm in action (plz star).

Installation

$ yarn add 4chan-list-webm

# OR

$ npm install --save 4chan-list-webm

Usage

const listWebms = require('4chan-list-webm')

// promise
listWebms('wsg', 2045456)
  .then(data => console.log(data.webms))
  .catch(err => console.error('404!', err))

// async/await
async function run () {
  try {
    const data = await listWebms('http://boards.4chan.org/wsg/thread/2045456')
    console.log(data)
  } catch (err) {
    console.error('Whoa! 404! :c', err)
  }
}

run()

API

listWebm(url)

listWebm(board, threadNo, config)

Returns a promise that resolves to data about webms within a thread (see payload).

url

Type: String

The URL of the thread. The thumbnail and webm links will use https if an https request is made.

board

Type: String

The short-name of the board, eg. 'wsg', 'b', etc.

threadNo

Type: Number

The thread number of the target thread. For example, 2312676 is the thread number of http://boards.4chan.org/wsg/thread/2312676

config

Type: Object

A configuration object, see details below.

config.https

Type: Boolean

Property that determines whether to use https. Setting the key to true enables https.

Payload

Below an example payload. Note that the subject key will be omitted if the thread has no subject.

{
  "subject": "Hawkeye being epic in other roles",
  "webms": [
    {
      "filename": "1534288775634",
      "url": "http://i.4cdn.org/wsg/1534332395477.webm",
      "thumbnail": "http://i.4cdn.org/wsg/1534332395477s.jpg"
    },
    {
      "filename": "1534288802449",
      "url": "http://i.4cdn.org/wsg/1534332452014.webm",
      "thumbnail": "http://i.4cdn.org/wsg/1534332452014s.jpg"
    },
    {
      "filename": "1534288878879",
      "url": "http://i.4cdn.org/wsg/1534332526405.webm",
      "thumbnail": "http://i.4cdn.org/wsg/1534332526405s.jpg"
    },
    {
      "filename": "Dahmer (2002)",
      "url": "http://i.4cdn.org/wsg/1534799616292.webm",
      "thumbnail": "http://i.4cdn.org/wsg/1534799616292s.jpg"
    },
    {
      "filename": "Bourne_legacy",
      "url": "http://i.4cdn.org/wsg/1535117894788.webm",
      "thumbnail": "http://i.4cdn.org/wsg/1535117894788s.jpg"
    }
  ]
}

Miscellaneous

CORS, and why this doesn't work in the browser

Because CORS is only supported with an origin of http(s)://boards.4chan.org, this module does not work in the browser; it only works with Node.js. The ONLY exception to this is if you're creating a Chrome plugin, with http(s)://boards.4chan.org set as the origin.

Rate limits

As stated in the 4chan API, you must ensure that you do not make more than one request per second. It is your responsiblity to ensure that the request limit is respected. I recommend using limiter or bottleneck.

Thumbnails

You will get an 403 Forbidden error if you try to load the thumbnails via inline linking (eg. changing the src attribute of an <img> via JavaScript, or hard-coding it). You can still download these images via a proxy server and serve them there.

Why?

¯\_(ツ)_/¯

Disclaimer

The creator of 4chan-list-webm is not associated with 4chan.org in any way.

Downloads & popularity

Awaiting observations

No metric observations yet

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

Declared dependencies 3

Native requirements
3 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^0.17.1runtime
buble-loader
Environment
{
  "local_name": "buble-loader",
  "alias": false,
  "peer_metadata": null
}
^0.4.1development
webpack
Environment
{
  "local_name": "webpack",
  "alias": false,
  "peer_metadata": null
}
^3.10.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-Th/0RHm1OhVPfRsYGuvjkc/TlAQOr0h9qjsW9xoywX38cMy88oD6naKKVLhGoS3JH+AIgrQragwU4CDUoHHr4Q==",
  "shasum": "ca8453d2cce79f4508510e43a2ab2c51213d9655",
  "tarball": "https://registry.npmjs.org/4chan-list-webm/-/4chan-list-webm-1.1.0.tgz",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIQCmSfBND7bf1KOmDf2tJJ3V0nV25RAbUznbYk2mhF9iOAIgCiTLljAK2PqYDeK+1gSBd7Zl+kPAJ+Vr2xLeZ4HpUMM="
    }
  ]
}

Repository

PENDING
scottyfillups/4chan-list-webm

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
scootykins/4chan-list-webm

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:06 UTC

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

Record identity

package_version:5cc79d91b130f45f2ebef125279347b4368c6fac89f84e9c887b2e1a6bb21343

Other collected versions

4.1.220 Jan4.1.128 Aug4.1.028 Aug4.0.029 Apr3.0.215 Apr3.0.12 FebView all collected versions →