PHPackages                             cwramsey/gnip-rules - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. cwramsey/gnip-rules

ActiveLibrary

cwramsey/gnip-rules
===================

1.0.1(10y ago)043MITPHPPHP ^7.0

Since Apr 6Pushed 10y agoCompare

[ Source](https://github.com/cwramsey/gnip-rules)[ Packagist](https://packagist.org/packages/cwramsey/gnip-rules)[ RSS](/packages/cwramsey-gnip-rules/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Introduction
------------

[](#introduction)

This is a simple library for interacting with the [GNIP Powertrack rules API](http://support.gnip.com/apis/powertrack/api_reference.html).

Installation
------------

[](#installation)

Run `$ composer require cwramsey/gnip-rules`

Usage
-----

[](#usage)

#### Creating a client

[](#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

[](#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

[](#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

[](#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
----

[](#todo)

- Add data collector support
- Add support for PowerTrack 2.0

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3685d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/470ba91fc26e047ae9202c842707c6fa4e1a9886c6760566cd08b488caed2a09?d=identicon)[recursiveplanet](/maintainers/recursiveplanet)

---

Top Contributors

[![cwramsey](https://avatars.githubusercontent.com/u/8377322?v=4)](https://github.com/cwramsey "cwramsey (8 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cwramsey-gnip-rules/health.svg)

```
[![Health](https://phpackages.com/badges/cwramsey-gnip-rules/health.svg)](https://phpackages.com/packages/cwramsey-gnip-rules)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
