PHPackages                             htmlburger/carbon-twitter - 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. htmlburger/carbon-twitter

ActiveLibrary[API Development](/categories/api)

htmlburger/carbon-twitter
=========================

Helper library for retrieving information from the Twitter API.

v2.0.0(8y ago)35942GPL-2.0PHPPHP &gt;=5.3

Since Jan 26Pushed 8y ago4 watchersCompare

[ Source](https://github.com/htmlburger/carbon-twitter)[ Packagist](https://packagist.org/packages/htmlburger/carbon-twitter)[ RSS](/packages/htmlburger-carbon-twitter/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (1)Versions (5)Used By (0)

Carbon Twitter
==============

[](#carbon-twitter)

Helper library for retrieving tweets from the Twitter API.

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

[](#installation)

The library is available as Composer package. You can include it in your Project with:

`composer require htmlburger/carbon-twitter`

Usage
-----

[](#usage)

```
use Carbon_Twitter\Carbon_Twitter;

Carbon_Twitter::config( array(
  'api' => array(
    'access_token'        => '',
    'access_token_secret' => '',
    'consumer_key'        => '',
    'consumer_secret'     => '',
  ),
  'cache_lifetime'   => 300,
  'verbose'          => false,
  'cache_candidates' => [ 'WordPress', 'File' ],
) );

$tweets = Carbon_Twitter::get_tweets( 'wordpress', 5 );

foreach ( $tweets as $tweet ) {
  echo $tweet->text;
}
```

or by using the helper functions:

```
carbon_twitter_set_config( array(
  'api' => array(
    'access_token'        => '',
    'access_token_secret' => '',
    'consumer_key'        => '',
    'consumer_secret'     => '',
  ),
  'cache_lifetime'   => 300,
  'verbose'          => false,
  'cache_drivers'    => [ 'WordPress', 'File' ],
) );

$tweets = carbon_twitter_get_tweets( 'wordpress', 5 );

foreach ( $tweets as $tweet ) {
  echo $tweet->text;
}
```

Configuration Parameters
------------------------

[](#configuration-parameters)

`api (array) - required`

The `api` parameter holds an array of 4 elements:

- `access_token`
- `access_token_secret`
- `consumer_key`
- `consumer_secret`

`cache_lifetime (int) - optional`

The cache duration defined in seconds. Defaults to `300` seconds (5 minutes)

`verbose (boolean) - optional`

Whether to enable Verbose mode. Defaults to `false`.

`cache_drivers (array) - optional`

An array of Cache Drivers to use. Uses the first Driver which is supported in the Project environment. Defaults to `array( 'WordPress', 'File' )`

In WordPress environment
------------------------

[](#in-wordpress-environment)

Once the library is installed in your WordPress project, the receive the following features out of the box:

- Carbon\_Twitter\_Feed widget is being registered
- A new Carbon Container is registered - Twitter Settings

There are several hooks that you can use in order to customize the functionality

### Carbon\_Twitter\_Feed\_Widget

[](#carbon_twitter_feed_widget)

**carbon\_twitter\_widget\_id**

Allows you to modify the Widget ID.

```
apply_filters( 'carbon_twitter_widget_id', 'carbon_twitter_feed_widget' );
```

**carbon\_twitter\_widget\_title**

Allows you to modify the default Widget title.

```
apply_filters( 'carbon_twitter_widget_title', __( 'Carbon Twitter Feed', 'carbon-twitter' ) )
```

**carbon\_twitter\_widget\_description**

Allows you to modify the default Widget description.

```
apply_filters( 'carbon_twitter_widget_description', __( 'Displays a Twitter Feed.', 'carbon-twitter' ) )
```

**carbon\_twitter\_widget\_fields**

Allows you to modify the array of the default Widget fields.

```
apply_filters( 'carbon_twitter_widget_fields', array(
  Field::make( 'text', 'title', __( 'Title', 'carbon-twitter' ) ),
  Field::make( 'text', 'twitter_username', __( 'Twitter Username', 'carbon-twitter' ) ),
  Field::make( 'text', 'count_tweets', __( 'Number of Tweets to Display', 'carbon-twitter' ) )
    ->set_default_value( 5 ),
) )
```

**carbon\_twitter\_widget\_classes**

Allows you to modify the CSS classes that will be added to the Widget.

```
apply_filters( 'carbon_twitter_widget_classes', 'carbon-twitter-feed' )
```

### Twitter Settings Carbon Container

[](#twitter-settings-carbon-container)

**carbon\_twitter\_settings\_title**

Allows you to change the title of the Twitter Settings Carbon Container.

```
apply_filters( 'carbon_twitter_settings_title', __( 'Twitter Settings', 'carbon-twitter' ) )
```

**carbon\_twitter\_settings\_page\_parent**

Allows you to change the Page Parent of the Twitter Settings Carbon Container.

```
apply_filters( 'carbon_twitter_settings_page_parent', 'crbn-theme-options.php' )
```

**carbon\_twitter\_settings\_custom\_help\_text**

Allows you to modify the help text of the Twitter Settings Carbon Container.

**carbon\_twitter\_settings\_fields**

Allows you to modify the default fields in the Twitter Settings Carbon Container.

```
apply_filters( 'carbon_twitter_settings_fields', array(
    Field::make( 'html', 'carbon_twitter_settings_html' )
      ->set_html( carbon_twitter_get_options_help_text() ),
    Field::make( 'text', 'carbon_twitter_consumer_key', __( 'Consumer Key', 'carbon-twitter' ) ),
    Field::make( 'text', 'carbon_twitter_consumer_secret', __( 'Consumer Secret', 'carbon-twitter' ) ),
    Field::make( 'text', 'carbon_twitter_access_token', __( 'Access Token', 'carbon-twitter' ) ),
    Field::make( 'text', 'carbon_twitter_access_token_secret', __( 'Access Token Secret', 'carbon-twitter' ) ),
  ) )
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 57.9% 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 ~193 days

Total

4

Last Release

3222d ago

Major Versions

v1.0.2 → v2.0.02017-08-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1150772?v=4)[HTMLBurger](/maintainers/htmlburger-git)[@htmlburger-git](https://github.com/htmlburger-git)

---

Top Contributors

[![jorostoyanov](https://avatars.githubusercontent.com/u/6777091?v=4)](https://github.com/jorostoyanov "jorostoyanov (11 commits)")[![tyxla](https://avatars.githubusercontent.com/u/8436925?v=4)](https://github.com/tyxla "tyxla (4 commits)")[![pkostadinov-2create](https://avatars.githubusercontent.com/u/6572699?v=4)](https://github.com/pkostadinov-2create "pkostadinov-2create (2 commits)")[![catahac](https://avatars.githubusercontent.com/u/510614?v=4)](https://github.com/catahac "catahac (1 commits)")[![htmlburger-git](https://avatars.githubusercontent.com/u/1150772?v=4)](https://github.com/htmlburger-git "htmlburger-git (1 commits)")

---

Tags

twittertwitter-feedfeedtwittertwitter feed

### Embed Badge

![Health badge](/badges/htmlburger-carbon-twitter/health.svg)

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

###  Alternatives

[laminas/laminas-feed

provides functionality for creating and consuming RSS and Atom feeds

16650.6M55](/packages/laminas-laminas-feed)[pgrimaud/instagram-user-feed

This is a scraper to easily fetch any feed and interact with Instagram (like, follow, etc.) without OAuth for PHP.

943664.4k5](/packages/pgrimaud-instagram-user-feed)[atymic/twitter

Twitter API for PHP &amp; Laravel

951581.0k2](/packages/atymic-twitter)[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.

769876.6k10](/packages/jublonet-codebird-php)[mibe/feedwriter

Generate feeds in either RSS 1.0, RSS 2.0 or ATOM formats

1951.1M5](/packages/mibe-feedwriter)[debril/rss-atom-bundle

RSS / Atom and JSONFeed support for Symfony

1381.3M2](/packages/debril-rss-atom-bundle)

PHPackages © 2026

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