PHPackages                             unniks/twitter-powertracker - 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. [API Development](/categories/api)
4. /
5. unniks/twitter-powertracker

ActiveLibrary[API Development](/categories/api)

unniks/twitter-powertracker
===========================

A Laravel Package for Twitter Powertrack

1.0.1(6y ago)055MITPHPPHP ^7.0CI failing

Since Sep 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Unniks-here/twitter-power-tracker)[ Packagist](https://packagist.org/packages/unniks/twitter-powertracker)[ RSS](/packages/unniks-twitter-powertracker/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

Twitter Power Tracker
---------------------

[](#twitter-power-tracker)

Twitter Power Tracker is the package for connecting and streaming data with twitter's enterprise streaming plans.

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

[](#installation)

```
$ composer require unniks/twitter-powertracker
```

#### Don't forget to add service provider

[](#dont-forget-to-add-service-provider)

```
unniks\TwitterPowertracker\PowerTrackerServiceProvider::class,
```

#### Twitter Power Tracker comes with facade. Add following lines in aliases

[](#twitter-power-tracker-comes-with-facade-add-following-lines-in-aliases)

```
'TwitterPowertracker' => unniks\TwitterPowertracker\PowerTrackFacade::class,
```

#### Publish Vendor Files for configuration

[](#publish-vendor-files-for-configuration)

```
$ php artisan vendor:publish --provider="unniks\TwitterPowertracker\PowerTrackerServiceProvider"
```

Usage
-----

[](#usage)

We need GNIP account before using with this feature. If you have GNIP username and password, add following variables in your .env file

```
TWITTER_GNIP_USERNAME=test@test.xyz
TWITTER_GNIP_PASSWORD=xxxxx
TWITTER_GNIP_URL=https://gnip-stream.twitter.com/stream/powertrack/accounts/{username}/publishers/twitter/{variable}.json
TWITTER_GNIP_REPLAY_URL=https://gnip-stream.gnip.com/replay/powertrack/accounts/{username}/publishers/twitter/{variabale}.json
TWITTER_GNIP_STREAMING_30_DAYS_URL=https://gnip-api.twitter.com/search/30day/accounts/{username}/{variabale}.json
TWITTER_GNIP_RULES_URL=https://gnip-api.twitter.com/rules/powertrack/accounts/{username}/publishers/twitter/{variabale}.json
```

#### Use this facade

[](#use-this-facade)

```
use TwitterPowertracker;
```

#### For Rule Creation

[](#for-rule-creation)

###### if you can pass json format recomended by GNIP console

[](#if-you-can-pass-json-format-recomended-by-gnip-console)

\_

```
 $json =  {"rules" :[{"value" : "from:foo","tag" : "some_foo_tag"},{"value" : "foo:keyword"}]} ;
TwitterPowertracker::ruleCreationByJson($json);
```

###### or just pass array of rules like this using ruleCreationByArray()

[](#or-just-pass-array-of-rules-like-this-using-rulecreationbyarray)

\_

```
$rules =['from:rahul','@shami'];
TwitterPowertracker::ruleCreationByArray($rules);
```

###### if you need to pass tags as array just use like this

[](#if-you-need-to-pass-tags-as-array-just-use-like-this)

\_

```
$rules = ['from:rahul','@shami'];
$tags = ['rahul_tag','sham_tag'];
TwitterPowertracker::ruleCreationByArray($rules,$tags);
```

note: array index of $tags should have matched to array index of $rules

#### For Rule Deletion

[](#for-rule-deletion)

###### you can use above mentioned same techniques for

[](#you-can-use-above-mentioned-same-techniques-for)

\_

```
TwitterPowertracker::ruleDeletionByJson($json);
```

###### and

[](#and)

\_

```
TwitterPowertracker::ruleDeletionByJson($json);
TwitterPowertracker::ruleDeletionByArray($rules,$tags);
```

What is rules? Please go through this documentation:

#### For streaming data

[](#for-streaming-data)

```
use TwitterPowertracker;
TwitterPowertracker::powerStream();
```

By calling powerStream() data will be continuously streamed to the model app/TwitterPowerTrackerStream.php

```
public static function getPowerTrack($data)
{
    //do some stuff with incoming $data
}
```

#### For force stopping the live streaming

[](#for-force-stopping-the-live-streaming)

```
//return "exit" in the function "app/TwitterPowerTrackerStream.php"

public static function getPowerTrack($data)
{
    //some code
    if(//some condition)
    {
      return "exit";
    }
}
```

#### For 30 days twitter data

[](#for-30-days-twitter-data)

##### Method 1

[](#method-1)

```
$results = TwitterPowertracker::thirtyDaysGet($rule);
```

##### Method 2

[](#method-2)

```
$results = TwitterPowertracker::thirtyDaysGet($rule,$maxResults);
```

##### Method 3

[](#method-3)

```
$results = TwitterPowertracker::thirtyDaysGet($rule,$maxResults,$startDate,$endDate);
```

##### Method 4

[](#method-4)

```
$results = TwitterPowertracker::thirtyDaysGet($rule,$maxResults,$startDate,$endDate,$next);
```

(use [https://support.gnip.com/apis/search\_api2.0/api\_reference.html](https://support.gnip.com/apis/search_api2.0/api_reference.html) for reference)

#### \*\*\*\*\*\*\*\*\* Awaiting Brilliant Contributions for this simple Package \*\*\*\*\*\*\*\*\*\*

[](#-awaiting-brilliant-contributions-for-this-simple-package-)

License
-------

[](#license)

The unniks/twitter-powertracker is open-sourced software licensed under the \[MIT license\]

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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 ~1 days

Total

2

Last Release

2415d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/05faced7522d94cde1a3557f01dfd6f95b548d1ef99f3b6184c160cd262a5b29?d=identicon)[unniks.here](/maintainers/unniks.here)

---

Top Contributors

[![Unniks-here](https://avatars.githubusercontent.com/u/7260715?v=4)](https://github.com/Unniks-here "Unniks-here (36 commits)")

---

Tags

30-days-twitter-apipower-trackpower-track-laravel-packagestreaming-datatwittertwitter-apitwitter-enterprise-apistwitter-enterprise-datatwitter-powetracktwittertwitter-power-trackunni kstwitter streamingtwitter power trackinglaravel twitter enterprise package

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/unniks-twitter-powertracker/health.svg)

```
[![Health](https://phpackages.com/badges/unniks-twitter-powertracker/health.svg)](https://phpackages.com/packages/unniks-twitter-powertracker)
```

###  Alternatives

[jublonet/codebird-php

Easy access to the Twitter REST API, Direct Messages API, Account Activity API, TON (Object Nest) API and Twitter Ads API — all from one PHP library.

770865.9k10](/packages/jublonet-codebird-php)[atymic/twitter

Twitter API for PHP &amp; Laravel

945555.4k2](/packages/atymic-twitter)[noweh/twitter-api-v2-php

This library provides methods for sending messages to Twitter and receiving statuses.

131225.2k1](/packages/noweh-twitter-api-v2-php)[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36205.0k3](/packages/wrav-oembed)[philo/laravel-twitter

A simple Laravel 4 service provider for including the TwitterOAuth library.

5019.5k](/packages/philo-laravel-twitter)[makotokw/twient

Twitter Client for PHP 5.3+

2632.0k](/packages/makotokw-twient)

PHPackages © 2026

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