tristanbes/my-poseo-bundle

Access to MyPoseo API

Installs: 60 368

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 4

Open Issues: 1

Type:symfony-bundle

v6.1.0 2021-08-12 12:50 UTC

README

CI (master) Scrutinizer Code Quality

Description:

This bundle provides a way to communicate with MyPoseo webservices inside your Symfony4 application.

For now, only the Search API has been wired. If you need more, PR are welcome.

The Search API allows you to get the position of an URL by keyword(s) among other features.

Installation:

Add tristanbes/my-poseo-bundle to your composer.json:

php composer.phar require "tristanbes/my-poseo-bundle": "2.*"

Register the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Tristanbes\MyPoseoBundle\MyPoseoBundle()
    );
}

How to use it:

You can configure the bundle with:

my_poseo:
    api:
        key: "YOUR_API_KEY"
        cache_service_id: ~
        http_client: 'name_of_your_http_adapter'
        type:
            search:
                base_url: "http://api.myposeo.com/m/apiv2"

Your API key can be found on this page.

Be careful, the given API key is already url encoded ! You need to decode it since guzzle re-encode automatically all parameters

Choose HTTP client

MyPoseoBundle 2.0 is no longer coupled to Guzzle3. Thanks to Httplug you can now use any library to transport HTTP messages. You can rely on discovery to automatically find an installed client or you can provide a client service name to the configuration (see HttplugBundle).