New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

4chan-list-webm

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

4chan-list-webm

List all webms within a 4chan thread

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
56
increased by55.56%
Maintainers
1
Weekly downloads
 
Created
Source

4chan-list-webm

Given a board and thread number, returns a Promise with an array of objects containing the filename, video and thumbnail URLs of all webm files in the thread.

Here's a little demonstration of 4chan-list-webm, http://4webm.org, in action (plz star).

UPDATE 3.0.0 BREAKING CHANGE

4chan-list-webm now returns a Promise. See "Usage" for an example.

Installation

$ yarn add 4chan-list-webm

# OR

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

Usage

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

// Consider the following URL: http://boards.4chan.org/wsg/thread/2045456
// The board is 'wsg' and the thread number is 2045456
// Note: This thread will likely 404 by the time you see this

listWebms('wsg', 2045456).then(function (webms) {
  console.log(webms)
})

The data looks like this:

[{ "filename": "1478018951860",
    "url": "http://i.4cdn.org/wsg/1514757619690.webm",
    "thumbnail": "http://i.4cdn.org/wsg/1514757619690s.jpg" },
 { "filename": "1505294337138",
    "url": "http://i.4cdn.org/wsg/1514834417503.webm",
    "thumbnail": "http://i.4cdn.org/wsg/1514834417503s.jpg" }]

API

listWebm(board, threadNo, options)

  • board (string): The board the thread is in (if you have good taste, then it'll likely /wsg/)
  • threadNo (number): The thread number
  • options (object): An options object, see below for more information
  • return Promise

Options

OptionDescriptionType
httpsUse https instead of httpBoolean

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.

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.

Keywords

FAQs

Package last updated on 29 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc