News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso:
How to configure Symfony's Service Container to use Twitter API
February 05, 2013 @ 10:53:19

In this recent post to his site Gonzalo Ayuso shows how to use the Symfony2 service container to interact directly with the Twitter API via an OAuth plugin.

If we are working within a Symfony2 application or a PHP application that uses the Symfony's Dependency injection container component you can easily integrate this simple script in the service container. I will show you the way that I use to do it.

His sample code uses the Guzzle HTTP library and some configuration options from a YAML file to create a new service hooked into the Twitter API with his credentials. He then imports it via his services configuration and shows an example of it in action - getting the latest contents of his timeline.

0 comments voice your opinion now!
symfony2 service container guzzle twitter api


blog comments powered by Disqus

Similar Posts

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 12)

WaxJelly Blog: Simple PHP script using the YouTube API (with pagination)

Community News: SourceForge.net 2006 Community Choice Awards

Jakub Zalas' Blog: Managing object creation in PHP with the Symfony2 Dependency Injection component

Phil Bennett: Revisiting: Benchmarking Dependency Injection Containers


Community Events

Don't see your event here?
Let us know!


language yii2 introduction composer opinion community application project symfony api series podcast laravel configure list framework example part2 php7 interview

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework