PHPackages                             lulco/rich-social-messages - 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. lulco/rich-social-messages

ActiveLibrary

lulco/rich-social-messages
==========================

Library for parsing and improving mesages from social networks

0.1.0(10y ago)017MITPHP &gt;= 5.6.0

Since Apr 17Compare

[ Source](https://github.com/lulco/rich-social-messages)[ Packagist](https://packagist.org/packages/lulco/rich-social-messages)[ RSS](/packages/lulco-rich-social-messages/feed)WikiDiscussions Synced 2mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Rich social messages
====================

[](#rich-social-messages)

Library for parsing and improving mesages from social networks.

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

[](#installation)

### Composer

[](#composer)

The fastest way to install Rich social messages is to add it to your project using Composer ().

1. Install Composer: ```
    curl -sS https://getcomposer.org/installer | php

    ```
2. Require Rich social messages as a dependency using Composer: ```
    php composer.phar require lulco/rich-social-messages

    ```
3. Install Rich social messages: ```
    php composer.phar update

    ```

Usage
-----

[](#usage)

If you have some Twitter tweets, Facebook statuses or Instagram posts as plaintext, you can get more information about them using this library.

### Twitter

[](#twitter)

```
$message = new \RichSocialMessages\Message\Tweet("My tweet with #tag1 and #tag2 and @user1 and @user2 and http://example.com");
$message->getTags();    // will return ['tag1', 'tag2']
$message->getUsers();    // will return ['user1', 'user2']
$message->getLinks();    // will return ['http://example.com']

```

### Instagram

[](#instagram)

```
$message = new \RichSocialMessages\Message\InstagramPost("My instagram post with #tag1 and #tag2 and @user1 and @user2 and http://example.com");
$message->getTags();    // will return ['tag1', 'tag2']
$message->getUsers();    // will return ['user1', 'user2']
$message->getLinks();    // will return ['http://example.com']

```

### Facebook

[](#facebook)

```
$message = new \RichSocialMessages\Message\FacebookStatus("My facebook status with Name #tag1 and #tag2 and http://example.com");
$message->getTags();    // will return ['tag1', 'tag2']
$message->getUsers();    // will return []
$message->getLinks();    // will return ['http://example.com']

```

Unfortunatelly, Facebook statuses don't contain users with some identifiers as Twitter and Instagram does (@user) so it is not possible to parse users automatically. But if you somehow know which parts of Facebook status mention Facebook users, you can identify them in second parameter of FacebookStatus constructor:

```
$message = new \RichSocialMessages\Message\FacebookStatus("My facebook status with Name #tag1 and #tag2 and http://example.com", [4 => 'my_username']);    // 4 is index of word which contains user (Name) and my_username is user's username on Faceboook
$message->getTags();    // will return ['tag1', 'tag2']
$message->getUsers();    // will return [4 => 'name_surname']
$message->getLinks();    // will return ['http://example.com']

```

Transformation
--------------

[](#transformation)

Second part of this library allows you to create richer message from plaintext message, for example from tweet `My tweet with #tag1 and #tag2 and @user1 and @user2 and http://example.com`, you can get this: `My tweet with #tag1 and #tag2 and @user1 and @user2 and http://example.com`

How to do it?

First you have to setup your Transformer:

```
$transformer = new \RichSocialMessages\Transformer\TwitterTransformer();
$transformer->setUserLinkTarget('_top');
$transformer->setTagLinkTarget('_blank');
$transformer->setLinkLinkTarget('_blank');

```

And then you can pass the message to the transformer:

```
$transformer->transform(new \RichSocialMessages\Message\Tweet("My tweet with #tag1 and #tag2 and @user1 and @user2 and http://example.com"));

```

The same way you can use for transforming Facebook statuses and Instagram posts. You just need to setup FacebookTransformer and InstagramTransformer instead of TwitterTransformer.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

3677d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9377319?v=4)[Michal Lulco](/maintainers/lulco)[@lulco](https://github.com/lulco)

---

Top Contributors

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

---

Tags

phpfacebookinstagramtwittertagsUserspostslinkstweetsstatuses

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/lulco-rich-social-messages/health.svg)

```
[![Health](https://phpackages.com/badges/lulco-rich-social-messages/health.svg)](https://phpackages.com/packages/lulco-rich-social-messages)
```

###  Alternatives

[hwi/oauth-bundle

Support for authenticating users using both OAuth1.0a and OAuth2 in Symfony.

2.4k21.5M69](/packages/hwi-oauth-bundle)[nystudio107/craft-seomatic

SEOmatic facilitates modern SEO best practices &amp; implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.

1741.4M46](/packages/nystudio107-craft-seomatic)[edbizarro/laravel-facebook-ads

Facebook &amp; Instagram Ads for Laravel 5.6+

13629.5k](/packages/edbizarro-laravel-facebook-ads)[and/oauth

Simple and amazing OAuth library with many providers. Just try it out!

4645.2k2](/packages/and-oauth)[pdir/social-feed-bundle

Social feed extension for Contao CMS

1414.8k](/packages/pdir-social-feed-bundle)

PHPackages © 2026

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