4chanjs 中文文档教程

发布于 3年前 浏览 25 项目主页 更新于 3年前

构建状态

 NPM version

Information

Package4chanjs
DescriptionNodeJS and Browser 4chan API client
Node Version>= 0.4

Usage

var chan = require('4chanjs');

chan.boards(function(err, boards){
    // boards is an array
});

var random = chan.board('b');

random.catalog(function(err, pages){
    // catalog returns all pages from a board
    // but the list of threads only contains the OP
});

random.page(0, function(err, threads){
    // this will return an array of threads
});

random.threads(function(err, threads){
    // this is the same as catalog
    // but shows only thread ids
});

random.thread(495627174, function(err, posts){
    // this will return an array of posts
});

// sugar for getting an image url from a filename in a post
var img = random.image("somefile.jpeg");

WTF is this data

您可以在此处查看有关字段内容的解释。

LICENSE

(MIT 许可证)

版权所有( c) 2013 Fractal contact@wearefractal.com

特此免费授予任何获得许可的人 此软件和相关文档文件的副本( “软件”),不受限制地处理软件,包括 但不限于使用、复制、修改、合并、发布、 分发、再许可和/或出售软件的副本,以及 允许向其提供软件的人这样做,但须遵守 下列条件:

上述版权声明和本许可声明应 包含在软件的所有副本或重要部分中。

本软件“按原样”提供,不提供任何形式的保证, 明示或暗示的,包括但不限于 适销性、特定用途的适用性和 非侵权。 在任何情况下,作者或版权持有人均不得 对任何索赔、损害或其他责任负责,无论是在诉讼中 合同、侵权行为或其他由其引起、由其引起或与之相关的 与软件或软件的使用或其他交易。

Build Status

NPM version

Information

Package4chanjs
DescriptionNodeJS and Browser 4chan API client
Node Version>= 0.4

Usage

var chan = require('4chanjs');

chan.boards(function(err, boards){
    // boards is an array
});

var random = chan.board('b');

random.catalog(function(err, pages){
    // catalog returns all pages from a board
    // but the list of threads only contains the OP
});

random.page(0, function(err, threads){
    // this will return an array of threads
});

random.threads(function(err, threads){
    // this is the same as catalog
    // but shows only thread ids
});

random.thread(495627174, function(err, posts){
    // this will return an array of posts
});

// sugar for getting an image url from a filename in a post
var img = random.image("somefile.jpeg");

WTF is this data

You can see an explanation on what the fields are here.

LICENSE

(MIT License)

Copyright (c) 2013 Fractal contact@wearefractal.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文