lns / social-feed
A PHP lib to fetch and mix content from various social networks
Installs: 3 658
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 4
Requires
- commerceguys/enum: ^1.0
- guzzlehttp/guzzle: ~6.0
- guzzlehttp/oauth-subscriber: ~0.2
- league/oauth2-instagram: ^0.2.2
- phpcollection/phpcollection: ~0.4
- symfony/options-resolver: ~3.0
- symfony/var-dumper: ^3.1
- webmozart/json: ^1.2
- webmozart/key-value-store: @beta
Requires (Dev)
- memio/spec-gen: ~0.4
- phpspec/phpspec: ~2.2
- silex/silex: ~2.0
This package is not auto-updated.
Last update: 2025-03-31 10:56:27 UTC
README
Installation
composer require lns\social-feed
Usage
<?php require __DIR__ . '/vendor/autoload.php'; use Lns\SocialFeed\Provider\FacebookPagePostsProvider; use Lns\SocialFeed\Provider\TwitterSearchApiProvider; use Lns\SocialFeed\Client\TwitterApiClient; use Lns\SocialFeed\Client\FacebookApiClient; use Lns\SocialFeed\Factory\FacebookPostFactory; use Lns\SocialFeed\Factory\TweetFactory; use Lns\SocialFeed\SocialFeed; use Lns\SocialFeed\Source; $socialFeed = new SocialFeed(); $facebookPostFactory = new FacebookPostFactory(); $tweetFactory = new TweetFactory(); $instagramPostFactory = new InstagramPostFactory(); $fbClient = new FacebookApiClient('681945715271604', 'e6f5472a5f159d8f235d9cfc14084b36'); $twitterClient = new TwitterApiClient('HqSutv9oOk64BqyAn474g', 'EdAzOS0RTuMnIQgQPPIM4gv66fwRlyzx2yfqjz9nHtA'); $socialFeed ->addSource(new Source( new FacebookPagePostsProvider($fbClient, $facebookPostFactory), ['page_id' => '110483805633200'] )) ->addSource(new Source( new TwitterSearchApiProvider($twitterClient, $tweetFactory), ['query' => 'lanetscouade'] )); foreach(new \LimitIterator($socialFeed, 0, 10) as $item) { echo $item->getMessage() . PHP_EOL; }
Tests
php bin/phpspec run