eko/instagrambundle
Composer 安装命令:
composer require eko/instagrambundle
包简介
A Symfony Instagram bundle
关键字:
README 文档
README
/!\ Currently in development
Features
- Authenticate with Instagram API
- Retrieve instagram photos
Installation / Configuration
1) Add this in your app/routing.yml
eko_instagram: resource: "@EkoInstagramBundle/Resources/config/routing.xml"
2) Add your configuration in app/config.yml
eko_instagram: applications: yourapplication: application_id: 000000000000000000000 application_secret: 000000000000000000000 redirect_route: eko_instagram_default_redirect
Authenticate user
1) Create a first controller action to retrieve authentication code
<?php /** * Get Instagram authentication code API action * * @Route("/instagram/authenticate", name="_demo_instagram_authenticate") * @Template() */ public function authenticateAction() { $application = $this->get('eko_instagram.application.manager')->get('yourapplication'); return $this->redirect($application->getAuthenticationCodeUrl()); }
2) Create a second controller to use your API method
<?php /** * Most recent medias action * * @param \Symfony\Component\HttpFoundation\Request $request Request object * * @return \Symfony\Component\HttpFoundation\Response */ public function redirectAction(Request $request) { // Get returned code and obtain token access with it $code = $request->query->get('code'); $application = $this->get('eko_instagram.application.manager') ->get('vcomposieux') ->authenticate($code); // Initialize Users API endpoint and set authenticated application $users = $this->get('eko_instagram.api.endpoint.users') ->setApplication($application); $medias = $users->getRecentMedias(); }
More soon
Do not hesitate to contribute!
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-12-06