承接 naffiq/yii2-twitter-api 相关项目开发

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

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

naffiq/yii2-twitter-api

最新稳定版本:1.0.0

Composer 安装命令:

composer require naffiq/yii2-twitter-api

包简介

Yii2 component wrapper for J7mbo/twitter-api-php

README 文档

README

Test Coverage Code Climate Build Status

This package provides component wrapper for J7mbo/twitter-api-php library. Basically it just helps you to move settings to your app config.

Installation

The preferred way to install this package is through composer:

$ composer require naffiq/yii2-twitter-api

Configuration

Add following code to your components config section:

<?php
return [
    // Your app settings ...
    'components' => [
        // Other components ...
        'twitter' => [
            'class' => 'naffiq\twitterapi\TwitterAPI',
            'oauthAccessToken' => 'YOUR_OAUTH_ACCESS_TOKEN',
            'oauthAccessTokenSecret' => 'YOUR_OAUTH_ACCESS_TOKEN',
            'consumerKey' => 'YOUR_CONSUMER_KEY',
            'consumerSecret' => 'YOUR_CONSUMER_SECRET'
        ]        
    ]
    // ...
];

And we are ready to roll

Usage

Once you set up the component, you can use all of the J7mbo/twitter-api-php library's methods, just like this:

<?php

/**
 * @var \naffiq\twitterapi\TwitterAPI $twitter
 */
$twitter = \Yii::$app->get('twitter');

$url = 'https://api.twitter.com/1.1/blocks/create.json';
$requestMethod = 'POST';
$postFields = [
    'screen_name' => 'usernameToBlock', 
    'skip_status' => '1'
];

$twitter->buildOauth($url, $requestMethod)
    ->setPostfields($postFields)
    ->performRequest();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固