定制 cwramsey/gnip-rules 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

cwramsey/gnip-rules

Composer 安装命令:

composer require cwramsey/gnip-rules

包简介

README 文档

README

This is a simple library for interacting with the GNIP Powertrack rules API.

Installation

Run $ composer require cwramsey/gnip-rules

Usage

Creating a client

require_once(__DIR__ . '/vendor/autoload.php');

use Gnip\GnipRules;

$username = '';
$password = '';
$gnip_account_name = 'your_account_name';
$data_source = 'twitter';
$stream_label = 'stream_name';

$client = new GnipRules($username, $password, $gnip_account_name, $data_source, $stream_label);

Reading your rules

$rules = $client->read(); // returns a Gnip\RuleList iterable with your full rule list.

foreach ($rules as $rule) {
	echo $rule->getValue() . " - " . $rule->getTag();
}

Creating new rules

$new_rules = [
	[
    	'value' => 'rule1',
        'tag' => '123'
    ],
	[
    	'value' => 'rule2',
        'tag' => '123'
    ],
	[
    	'value' => 'rule3',
        'tag' => '123'
    ],
];

$updated_rules = $client->create($new_rules); // returns a GnipRuleList iterable with updated rules

Deleting rules

$rules_to_delete = [
	[
    	'value' => 'rule1',
    ],
	[
    	'value' => 'rule2',
    ],
	[
    	'value' => 'rule3',
    ],
]; // please note that Gnip does not allow you to delete by tag, so you must only include the `value`.

$updated_rules = $client->delete($rules_to_delete); // returns a GnipRuleList iterable with updated rules

TODO

  • Add data collector support
  • Add support for PowerTrack 2.0

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固