承接 tonoman3g/kaskus-php-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tonoman3g/kaskus-php-sdk

Composer 安装命令:

composer require tonoman3g/kaskus-php-sdk

包简介

Kaskus SDK for PHP

关键字:

README 文档

README

This repository contains the open source PHP SDK that allows you to access Kaskus API from your PHP app.

This version of the Kaskus SDK for PHP requires

  • PHP 5.4 or greater.
  • Composer

Installation

  1. Require this library in your composer.json
{
  "require": {
    "tonoman3g/kaskus-php-sdk": "v0.2.0"
  }
}
  1. Composer is a prerequisite for using Kaskus Sdk for PHP.

Install composer globally, then run composer install to install required files.

  1. Get Consumer Key and Consumer Secret for your application.

  2. Require vendor/autoload.php in your application.

  3. Follow sample script for further usage

Usage

Minimal example:

<?php

// skip these two lines if you use composer 
define('KASKUS_SDK_SRC_DIR', '/path/to/kaskus-sdk-for-php/src/Kaskus/');
require __DIR__ . '/path/to/kaskus-sdk-for-php/autoload.php';

// skip this line if you do not use composer
require 'vendor/autoload.php';

$consumerKey = 'YOUR_API_KEY';
$consumerSecret = 'YOUR_API_SECRET';

$client = new \Kaskus\KaskusClient($consumerKey, $consumerSecret);

try {
    $response = $client->get('v1/hot_threads');
    $forumList = $response->json();
    print_r($forumList);
} catch (\Kaskus\Exceptions\KaskusRequestException $exception) {
    // Kaskus Api returned an error
    
} catch (\Exception $exception) {
    // some other error occured
    
}

Login With Kaskus

Use this Oauth sample

Advance Usage

We use guzzle as HTTP Client, for further usage, read Guzzle

Api Documentation

GET /v1/hot_threads

Get all current hot threads

GET /v1/thread/<thread_id>?field=thread,thread_id,total_post,current_page,per_page,open,total_page,posts,profilepicture,post_username,post_userid,title,decoded,dateline,profilepicture,usertitle,post_id,reputation_box,pagetext,enable_reputation&page=1&limit=20

Parameter:
thread_id : thread id to read
field : fields name separated by comma that we want to filter from response
page : page that we want to read
limit : post per page that we want to read

Get thread detail for certain thread id

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-05-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固