Skip to content

Releases: rezozero/mixedfeed

v4.0.0

21 Jan 17:36
Compare
Choose a tag to compare

Thank you @nlemoine for your hard work and refactoring on this new major version (#24):

  • Use a PSR16 cache provider
  • Update coding standards to PSR12
  • Update dependencies
  • Remove deprecated methods
  • Remove unused/deprecated classes
  • Add types
  • PHP 8 support
  • BC break: MixedFeed does not extend AbstractFeedProvider anymore
  • Add raw object in CanonicalItem:

    Canonical items are nice but sometimes, you might need the original response which contains some details that the standard FeeItem doesn't provide

Release v3.0.0

01 Aug 12:13
cbd69af
Compare
Choose a tag to compare

Standalone server

Mixedfeed v3 introduces big and useful changes, especially if you don’t want to include Mixedfeed in your existing code stack, because you’re not using PHP. For these use cases, we added a standalone HTTP server with a Serialization process to output JSON responses to your website. This allow you to get mixed social feeds, without the need to setup a PHP server, on a server-less app and non-web apps too.

Mixedfeed standalone server is a Docker image that you can execute in any Docker environment simply using env variables to configure your feed providers.

docker run -p 8080:80 \
    -e MF_FACEBOOK_PAGE_ID="xxx" \
    -e MF_FACEBOOK_ACCESS_TOKEN="xxxx" \
    -e MF_INSTAGRAM_USER_ID="xxx" \
    -e MF_INSTAGRAM_ACCESS_TOKEN="xxxx" \
    -e MF_CACHE_PROVIDER="apcu" \
    -e MF_FEED_LENGTH="30" \
    rezozero/mixedfeed;

A docker-compose sample is also available in our repository.

Standalone server takes benefit from the FeedItem object that makes social feeds agnostic and make it easier to serialize it… again 😁.

{
  "items": [
    {}
  ],
  "meta": {
    "time": 1,
    "count": 10
  }
}

But do not feel afraid, standalone server is optional, and you can still benefits from all new features with the PHP library using Composer.

Async requests

Mixedfeed v3 has been refactored to perform HTTP requests in parallel. All feeds parsing and items canonicalization has been moved to dedicated methods that will be executed once all HTTP requests have performed using Guzzle pool system. Almost all FeedProviders are compatible (no Twitter because it does not use Guzzle) and if you are mixing more than two providers, you will notice a great performance bump.

All you need to do it to switch from MixedFeed::getCanonicalItems to MixedFeed::getAsyncCanonicalItems method:

$feed = new MixedFeed([
    new InstagramFeed(
        'instagram_user_id',
        'instagram_access_token',
        null // you can add a doctrine cache provider
    ),
    // … 
]);
return $feed->getAsyncCanonicalItems(12);

MixedFeed::getItems is still available but it’s deprecated.

Even if Twitter providers are not async (PR are welcome if you want to rewrite them with Guzzle) but you still can use them along with async providers.

References

Release v2.0.0

13 Feb 16:01
9cb693d
Compare
Choose a tag to compare

2 new credential-free feed providers

  • New Medium feed
  • New InstagramOEmbed feed

API

A new way to organize data with:

  • RZ\MixedFeed\Canonical\FeedItem
  • RZ\MixedFeed\Canonical\Image

Using $feed->getCanonicalItems(12); instead of $feed->getItems(12); will allow you to fetch typed objects instead of \stdClass objects with raw data. FeedItem objects have normalized fields to ease up templating or even re-packing items into JSON with a coherent structure:

  • id
  • title
  • author
  • link
  • images
  • dateTime