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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. lulco/rich-social-messages

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

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

Library for parsing and improving mesages from social networks

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

Since Apr 17Pushed 10y ago1 watchersCompare

[ 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 master Synced 4w 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 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

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

3726d 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.4k22.3M78](/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.5M53](/packages/nystudio107-craft-seomatic)[edbizarro/laravel-facebook-ads

Facebook &amp; Instagram Ads for Laravel 5.6+

13429.8k](/packages/edbizarro-laravel-facebook-ads)[hut6/oembed

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

102.3k](/packages/hut6-oembed)[and/oauth

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

4345.2k2](/packages/and-oauth)[ballen/linguist

Linguist is a PHP library for parsing strings and extracting prefixed words in content ideal for working with @mentions, #topics and custom tags.

212.1k](/packages/ballen-linguist)

PHPackages © 2026

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