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 - npm Package Compare versions

Comparing version 1.3.0 to 2.0.0

5

lib/index.js
const axios = require('axios')
function getWebmList (url, callback, options) {
function getWebmList (board, threadNo, callback, options) {
options = options || {}
const protocol = options.https ? 'https' : 'http'
const parsedUrl = /http:\/\/boards.4chan.org\/(.*)\/thread\/(.*)\.json/.exec(url)
const [, board, threadNo] = parsedUrl
const apiUrl = `${protocol}://a.4cdn.org/${board}/thread/${threadNo}.json`

@@ -11,0 +8,0 @@

2

package.json
{
"name": "4chan-list-webm",
"version": "1.3.0",
"version": "2.0.0",
"description": "List all webms within a 4chan thread",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

# 4chan-list-webm
Given a thread URL, returns an array of objects containing the filename and URL of every webm.
Given a board and thread number, returns an array of objects containing the filename and URL of every webm.
Because CORS [is only supported](https://github.com/4chan/4chan-API/issues/35) with an origin of `http(s)://boards.4chan.org`,
this module **does not work in the browser; it only works with Node.js**
this module **does not work in the browser; it only works with Node.js**.
### Update 2.0.0
Breaking changes:
* Now requires arguments `board` and `threadNo` (thread number) instead of `url`
## Installation

@@ -26,6 +32,7 @@

// 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
const threadUrl = 'http://boards.4chan.org/wsg/thread/1959335'
listWebms(threadUrl, function (webms) {
listWebms('wsg', 2045456, function (webms) {
console.log(webms)

@@ -32,0 +39,0 @@ })

@@ -6,5 +6,4 @@ const listWebms = require('../')

.then(function (res) {
const url = 'http://boards.4chan.org/wsg/thread/' + res.data[0].threads[1].no + '.json'
console.log(url)
listWebms(url, function(data) {
const threadNo = res.data[0].threads[1].no
listWebms('wsg', threadNo, function(data) {
console.log(data)

@@ -11,0 +10,0 @@ })

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