2017 © Pedro Peláez
 

symfony-bundle my-poseo-bundle

Access to MyPoseo API

image

tristanbes/my-poseo-bundle

Access to MyPoseo API

  • Tuesday, November 21, 2017
  • by sf_tristanb
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10,946 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 14 Versions
  • 14 % Grown

The README.md

MyPoseoBundle

CI (master) Scrutinizer Code Quality, (*1)

Description:

This bundle provides a way to communicate with MyPoseo webservices inside your Symfony4 application., (*2)

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

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

Installation:

Add tristanbes/my-poseo-bundle to your composer.json: ``` bash php composer.phar require "tristanbes/my-poseo-bundle": "2.*", (*5)


Register the bundle in the kernel: ``` php <?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Tristanbes\MyPoseoBundle\MyPoseoBundle() ); }

How to use it:

You can configure the bundle with:, (*6)

yml 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", (*7)

Your API key can be found on this page., (*8)

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

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)., (*10)

The Versions