Download the PHP package rezozero/mixedfeed without Composer

On this page you can find all versions of the php package rezozero/mixedfeed. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mixedfeed

mixedfeed

A PHP library to rule social-feeds, to entangle them with magic, a PHP library to gather them and bind them in darkness

SensioLabsInsight License Packagist Build Status

Use standalone Docker server

or use docker-compose: copy docker-compose.yml to docker-compose.test.yml and fill your provider credentials in it. Then execute docker-compose -f docker-compose.test.yml up -d --force-recreate, Mixedfeed will be available at http://localhost:8080

Available environment variables

Name Default value Multiple? (comma separated)
MF_CACHE_PROVIDER array
MF_FEED_LENGTH 12
MF_FACEBOOK_PAGE_ID
MF_FACEBOOK_ACCESS_TOKEN
MF_FACEBOOK_FIELDS from,link,picture,full_picture,message,story,type,created_time,source,status_type
MF_FACEBOOK_ENDPOINT https://graph.facebook.com/v2.12/
MF_GRAPH_INSTAGRAM_USER_ID
MF_GRAPH_INSTAGRAM_ACCESS_TOKEN
MF_GITHUB_RELEASES_REPOSITORY
MF_GITHUB_COMMITS_REPOSITORY
MF_GITHUB_ACCESS_TOKEN
MF_MEDIUM_USERNAME
MF_MEDIUM_USER_ID Use same order as in MF_MEDIUM_USERNAME
MF_PINTEREST_BOARD_ID
MF_PINTEREST_ACCESS_TOKEN
MF_INSTAGRAM_OEMBED_ID
MF_TWITTER_SEARCH_QUERY
MF_TWITTER_USER_ID
MF_TWITTER_ACCESS_TOKEN
MF_TWITTER_ACCESS_TOKEN_SECRET
MF_TWITTER_CONSUMER_KEY
MF_TWITTER_CONSUMER_SECRET
MF_TWITTER_EXTENDED_MODE 0
MF_YOUTUBE_PLAYLIST_ID
MF_YOUTUBE_API_KEY

Install as library

mixedfeed v3+ needs at least PHP 7.2, check your server configuration.

Combine feeds

mixedfeed can combine multiple social feeds so you can loop over them and use some common data fields such as feedItemPlatform, normalizedDate and canonicalMessage. mixedfeed will sort all your feed items by descending normalizedDate, but you can configure it to sort ascending:

Each feed provider must inject these three parameters in feed items:

For example, if you are using Twig, you will be able to include a sub-template for each social-platform.

Use FeedItem instead of raw feed

If you need to serialize your MixedFeed to JSON or XML again, you should not want all the raw data contained in each social feed item. So you can use the $feed->getAsyncCanonicalItems(12); method instead of getItems to get a more concise object with essential data: RZ\MixedFeed\Canonical\FeedItem. FeedItem will provide these fields:

When FeedItem has images, FeedItem::$images will hold an array of RZ\MixedFeed\Canonical\Image objects to have better access to its url, width and height if they're available.

Each feed provider must implement how to hydrate a FeedItem from the raw feed overriding createFeedItemFromObject() method.

Feed providers

Feed provider class Description feedItemPlatform
MediumFeed Call over https://medium.com/username/latest endpoint. It only needs a $username and an optional $userId for better consistency over requests (Medium seems to apply cache on their username requests even after changing a query parameter, i.e. post limit). Medium allows maximum 14 posts per requests. medium
InstagramOEmbedFeed Call over https://api.instagram.com/oembed/ endpoint. It only needs a $embedUrls array instagram_oembed
GraphInstagramFeed Call over graph.instagram.com/$userId/media endpoint with Basic Display API. It needs a $userId and an $accessToken. Warning: Access token must be refreshed every 60 days, use RefreshInstagramAccessToken instagram
InstagramFeed Deprecated: Call over /v1/users/$userId/media/recent/ endpoint. It needs a $userId and an $accessToken instagram
TwitterFeed Call over statuses/user_timeline endpoint. It requires a $userId, a $consumerKey, a $consumerSecret, an $accessToken and an $accessTokenSecret. Be careful, this endpoint can only return up to 3,200 of a user’s most recent Tweets, your item count could be lesser than expected. In the same way, Twitter removes retweets after retrieving the items count. twitter
TwitterSearchFeed Call over search/tweets endpoint. It requires a $queryParams array, a $consumerKey, a $consumerSecret, an $accessToken and an $accessTokenSecret. Be careful, Twitter API won’t retrieve tweets older than 7 days, your item count could be lesser than expected. $queryParams must be a key-valued array with query operators according to Twitter API documentation. twitter
FacebookPageFeed Call over https://graph.facebook.com/v3.3/$pageId/posts endpoint by default. Endpoint can be changed using $apiBaseUrl parameter. It requires a $pageId and an $accessToken. This feed provider only works for public Facebook pages. To get an access-token visit: https://developers.facebook.com/docs/facebook-login/access-tokens. By default, picture, message, story, created_time, status_type fields are queried, you can add your own by passing $field array as last parameter. You can add since and until query parameters using setSince(\Datetime) and setUntil(\Datetime) methods. You can overwrite the default facebook_page
PinterestBoardFeed Call over /v1/boards/$boardId/pins/ endpoint. It requires a $boardId and an $accessToken. To get an access-token visit: https://developers.pinterest.com/tools/access_token/ pinterest_board
GithubReleasesFeed Call over api.github.com/repos/:user/:repo/releases endpoint. It requires a $repository (user/repository) and an $accessToken. You can add a last $page parameter. To get an access-token visit: https://github.com/settings/tokens github_release
GithubCommitsFeed Call over api.github.com/repos/:user/:repo/commits endpoint. It requires a $repository (user/repository) and an $accessToken. You can add a last $page parameter. To get an access-token visit: https://github.com/settings/tokens github_commit
YoutubeMostPopularFeed Call over googleapis.com/youtube/v3/videos endpoint with mostPopular chart (It’s more kind of an example feed). It requires a $apiKey with a valid Google Cloud Console account (with not null quota) and Youtube Data API enabled. youtube_playlist_items
YoutubePlaylistItemFeed Call over googleapis.com/youtube/v3/playlistItems endpoint. It requires a $apiKey with a valid Google Cloud Console account (with not null quota) and Youtube Data API enabled. youtube_playlist_items

Modify cache TTL

Each feed-provider which inherits from AbstractFeedProvider has access to setTtl() method in order to modify the default cache time. By default it is set for 7200 seconds, so you can adjust it to invalidate doctrine cache more or less often.

Create your own feed provider

There are plenty of APIs on the internet, and this tool won’t be able to handle them all. But this is not a problem, you can easily create your own feed provider in mixedfeed. You just have to create a new class that will inherit from RZ\MixedFeed\AbstractFeedProvider. Then you will have to implement some methods from FeedProviderInterface:

Feel free to check our existing Feed providers to see how they work. And we strongly advise you to implement a caching system not to call your API endpoints at each request. By default, we use Doctrine’s caching system which has many storage options.

Create a feed provider from a Doctrine repository

If you need to merge social network feeds with your own website articles, you can create a custom FeedProvider which wraps your Doctrine objects into \stdClass items. You’ll need to implement your getFeed method using an EntityManager:

Then you can define your date-time and canonical message methods to look into this object:


All versions of mixedfeed with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-json Version *
abraham/twitteroauth Version ^3.0
guzzlehttp/guzzle Version ^7.0
guzzlehttp/promises Version ^1.5
guzzlehttp/psr7 Version ^2.1
psr/cache Version ^1.0 || ^2.0 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rezozero/mixedfeed contains the following files

Loading the files please wait ....