comtocode/ctc-socialnetworkimportbundle

There is no license information available for the latest version (v1.0.11) of this package.

This bundle is used to import social feeds (facebook, twitter, instagram, youtube,...) into Ibexa DXP content

Maintainers

Package info

gitlab.com/comtocode-dev/ctc-socialnetworkimportbundle

Issues

Type:ibexa-bundle

pkg:composer/comtocode/ctc-socialnetworkimportbundle

Statistics

Installs: 3 099

Dependents: 0

Suggesters: 0

Stars: 0

v1.0.11 2022-12-19 08:52 UTC

README

This bundle is used to import social feeds (Facebook, Twitter, Instagram, YouTube, ...) into Ibexa DXP 5 content.

Requirements

  • PHP >= 8.2
  • Ibexa DXP 5.x
  • Symfony 7.x

Installation

composer require comtocode/ctc-socialnetworkimportbundle

Register the bundle in config/bundles.php:

return [
    // ...
    CTC\SocialNetworkImportBundle\CTCSocialNetworkImportBundle::class => ['all' => true],
];

Configuration

Add your configuration in config/packages/ctc_social_network_import.yaml:

ctc_social_network_import:
    params:
        storageDir: "%kernel.project_dir%/var/import"
        limit: 10
        parentLocationId: 2
        contentType: "social_network"
        language: "fre-FR"
    services_enabled:
        - facebook
        - twitter
        - instagram
        - youtube
    services_list:
        facebook:
            # ...
        twitter:
            # ...
        instagram:
            # ...
        youtube:
            # ...

Usage

Import feeds

php bin/console ctc:sn:import

Available options:

  • --dry-run=true — test the app without writing anything
  • --social=NETWORK_NAME — import a specific social feed only
  • --import-only=true — get feeds but do not create Ibexa content

Delete imported content

php bin/console ctc:sn:delete_subtree

Twig functions

{# Get live feed with pagination #}
{% set feed = getLiveFeed(1, 10) %}

{# Get a specific social item #}
{% set item = getSocialItem('twitter') %}

Migration from eZ Platform 2.5

This version has been fully migrated to Ibexa DXP 5 / Symfony 7:

  • All eZ\Publish\* namespaces replaced with Ibexa\* equivalents
  • ContainerAwareCommand replaced with proper dependency injection
  • \Twig_Extension replaced with Twig\Extension\AbstractExtension
  • TreeBuilder API updated for Symfony 7 compatibility
  • Service definitions modernized (FQCN service IDs, no container parameters for classes)
  • PHP 8.2+ features (typed properties, constructor promotion, match expressions, static return types)
  • services.yml renamed to services.yaml
  • eZSNUtils renamed to IbexaSNUtils
  • All $container->get() / getContainer() calls removed in favor of constructor injection
  • execute() methods return int (Symfony Console requirement)
  • #[AsCommand] PHP attribute used for command registration