PHPackages                             locomotivemtl/charcoal-social-scraper - 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. locomotivemtl/charcoal-social-scraper

ActiveLibrary[API Development](/categories/api)

locomotivemtl/charcoal-social-scraper
=====================================

Provides API and Charcoal Models for querying social media content.

0.3.0(5y ago)0202↓100%MITPHPPHP &gt;=5.6.0CI failing

Since Dec 9Pushed 5y ago13 watchersCompare

[ Source](https://github.com/locomotivemtl/charcoal-social-scraper)[ Packagist](https://packagist.org/packages/locomotivemtl/charcoal-social-scraper)[ Docs](https://charcoal.locomotive.ca)[ RSS](/packages/locomotivemtl-charcoal-social-scraper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (20)Used By (0)

Charcoal Social Scraper
=======================

[](#charcoal-social-scraper)

Provides support for querying social media content and saving results as Charcoal Models.

Usage
-----

[](#usage)

From your application's service provider:

```
$container['instagram/client'] = function (Container $container) {
    $config = $container['config']['apis.instagram.auth'];

    $client = new InstagramClient(
        $config['client_id'],
        $config['client_secret'],
        sprintf('{"access_token":"%s"}', $config['access_token'])
    );

    return $client;
};

$container['twitter/client'] = function (Container $container) {
    $config = $container['config']['apis.twitter.auth'];

    $client = new TwitterClient(
        $config['consumer_key'],
        $config['consumer_secret'],
        $config['access_token'],
        $config['access_token_secret']
    );

    return $client;
};

$container['charcoal/social/scrapers'] = function (Container $container) {
    $parentContainer = $container;
    $scrapers = new Container();

    $scrapers['instagram'] = function (Container $container) use ($parentContainer) {
        $config = $parentContainer['config']['apis.instagram'];

        $scraper = new InstagramScraper([
            'client'   => $parentContainer['instagram/client'],
            'requests' => [
                'default' => [
                    'repository' => 'users',
                    'method'     => 'getMedia',
                    'filters'    => [
                        'id' => 'self'
                    ]
                ]
            ],
            'model_data' => [
                'media' => [
                    'active' => false
                ]
            ],
            'model_factory' => $parentContainer['model/factory']
        ]);

        return $scraper;
    };

    $scrapers['twitter'] = function (Container $container) use ($parentContainer) {
        $config = $parentContainer['config']['apis.twitter'];

        $scraper = new TwitterScraper([
            'client'   => $parentContainer['twitter/client'],
            'requests' => [
                'default' => [
                    'repository' => 'statuses',
                    'method'     => 'user_timeline',
                    'filters'    => [
                        'user_id' => 12345
                    ]
                ],
                'foobar' => [
                    'repository' => 'search',
                    'method'     => 'tweets',
                    'filters'    => [
                        'q' => '#foobar AND from:12345',
                        'include_entities' => true
                    ]
                ]
            ],
            'default_request' => 'foobar',
            'model_map' => [
                'tweet' => 'my-custom/object/tweet'
            ],
            'model_factory' => $parentContainer['model/factory']
        ]);

        return $scraper;
    };

    return $scrapers;
};
```

In this example, the scrapers are defined within a separate service container assigned to `$container['charcoal/social/scrapers']`. The `charcoal/social/scrapers` entry is required by scraper actions and scripts provided by this package.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.8% 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 ~78 days

Recently: every ~260 days

Total

17

Last Release

2178d ago

### Community

Maintainers

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

---

Top Contributors

[![mcaskill](https://avatars.githubusercontent.com/u/29353?v=4)](https://github.com/mcaskill "mcaskill (24 commits)")[![dominiclord](https://avatars.githubusercontent.com/u/1775204?v=4)](https://github.com/dominiclord "dominiclord (17 commits)")[![BeneRoch](https://avatars.githubusercontent.com/u/3017380?v=4)](https://github.com/BeneRoch "BeneRoch (1 commits)")[![JoelAlphonso](https://avatars.githubusercontent.com/u/10762266?v=4)](https://github.com/JoelAlphonso "JoelAlphonso (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/locomotivemtl-charcoal-social-scraper/health.svg)

```
[![Health](https://phpackages.com/badges/locomotivemtl-charcoal-social-scraper/health.svg)](https://phpackages.com/packages/locomotivemtl-charcoal-social-scraper)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[rezozero/mixedfeed

A PHP library to get social networks feeds and merge them

11130.4k](/packages/rezozero-mixedfeed)[utxo-one/twitter-ultimate-php

The Ultimate PHP Wrapper for the Twitter v2 API

214.7k](/packages/utxo-one-twitter-ultimate-php)

PHPackages © 2026

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