Skip to content

Latest commit

 

History

History
65 lines (49 loc) · 2.14 KB

README.md

File metadata and controls

65 lines (49 loc) · 2.14 KB

MyPoseoBundle

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).