PHPackages                             rkcreation/socialstream - 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. rkcreation/socialstream

ActiveLibrary[API Development](/categories/api)

rkcreation/socialstream
=======================

PHP helper to aggregate formatted social media posts from Facebook, Twitter, etc ...

3.2(7y ago)03MITPHPPHP &gt;=7.0

Since Nov 20Pushed 4y agoCompare

[ Source](https://github.com/rkcreation/socialstream)[ Packagist](https://packagist.org/packages/rkcreation/socialstream)[ Docs](https://github.com/mathieumaingret/socialstream)[ RSS](/packages/rkcreation-socialstream/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (4)Used By (0)

SocialStream
============

[](#socialstream)

PHP helper to aggregate formatted social media posts from Facebook, Twitter, etc ...

Getting Started
---------------

[](#getting-started)

### Prerequisites

[](#prerequisites)

All you need is PHP (easy part, let's say &gt;= 5.6) and developer accounts for Facebook and/or Twitter.

**Facebook / Instagram** (**)

- ACCESS\_API
- ACCESS\_TOKEN

**Twitter** (**)

- CONSUMER\_KEY
- CONSUMER\_SECRET
- ACCESS\_TOKEN
- ACCESS\_TOKEN\_SECRET

### Installing

[](#installing)

First run a composer to get the Twitter API from

```
composer install

```

And then require the composer autoload file in your code :

```
require_once  'socialstream/vendor/autoload.php';

```

End with an example of getting some data out of the system or using it for a little demo

Simple Use
----------

[](#simple-use)

Example to retrieve the last 8 posts from a Twitter account :

```
$posts = array();
$nbPosts = 8;
$accountName = 'accountName';
$cacheDuration = 10; // Cache expires after 10 min

$media = new \SocialStream\Media\Twitter();
if ($media->isAuthorized()) {
    $media->setAccount($accountName);
    $media->setCacheExpiration($cacheDuration);
    $posts = $media->getLastPosts($nbPosts);
}
var_dump($posts);

```

### Methods

[](#methods)

#### isAuthorized()

[](#isauthorized)

Check if your API keys are allowed to reach the API.

#### setAccount(string $accountName)

[](#setaccountstring-accountname)

Set the account name (yours for instance).

#### setCacheExpiration(int $cacheExpiration)

[](#setcacheexpirationint-cacheexpiration)

Set cache duration in *minutes*.

#### getLastPosts(int $nbPosts)

[](#getlastpostsint-nbposts)

Retrieve the $nbPosts last formatted posts to be displayed.

This method returns an array of *Post* objects :

VariableTypeDescriptionnetworkstringId of the social media (ex: "twitter")id \*stringId of the posttype \*stringType of post (ex for Facebook : post, picture, video, ...)date \*stringDate d/Mhour \*stringDate H:iauthor \*objectContains name &amp; url (of profile)picturestringUrl of post picture if existslink \*stringUrl to the detailed postcontentstringTextual contentBuild a SocialWall
------------------

[](#build-a-socialwall)

In order to retrieve posts from more than one social media, you can use the *\\SocialStream\\Wall* class :

```
$nbPosts = 8; // nb posts for each media
$posts = array();
$mediasTypes = array(
    'facebook' => '',
    'twitter' => ''
);
$socialWall = new \SocialStream\Wall($mediasTypes, $nbPosts);

$socialWall->shufflePosts(); // If you want to display your posts randomly

$posts = $socialWall->getPosts();
foreach($posts as $post) {
    echo $post->id;
}

```

Add your own social media
-------------------------

[](#add-your-own-social-media)

Check *src/SocialStream/Media/\_Example.php* to add a social media.

Then rebuild composer autoload :

```
composer dump-autoload

```

Then you can call :

```
$media = new \SocialStream\Media\MyNewSocialMedia();

```

Built With
----------

[](#built-with)

- [j7mbo/twitter-api-php](https://github.com/j7mbo/twitter-api-php) - The simplest PHP Wrapper for Twitter API v1.1 calls
- [facebook/php-business-sdk](https://developers.facebook.com/docs/business-sdk/getting-started#php) - The Facebook SDK (for FB / Instagram)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

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

Total

3

Last Release

2683d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a17365bd437176c70b897565630e4423a522bb912165b38dc888f810e70fb42e?d=identicon)[rkcreation](/maintainers/rkcreation)

---

Top Contributors

[![rkcreation](https://avatars.githubusercontent.com/u/5804138?v=4)](https://github.com/rkcreation "rkcreation (1 commits)")

---

Tags

phpapiSocial Wall

### Embed Badge

![Health badge](/badges/rkcreation-socialstream/health.svg)

```
[![Health](https://phpackages.com/badges/rkcreation-socialstream/health.svg)](https://phpackages.com/packages/rkcreation-socialstream)
```

###  Alternatives

[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

13998.4k2](/packages/jstolpe-instagram-graph-api-php-sdk)

PHPackages © 2026

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