eko / instagrambundle
Symfony Instagram 插件
dev-master
2013-06-27 20:37 UTC
Requires
- php: >=5.3.2
- guzzle/guzzle: 2.8.*
- symfony/framework-bundle: >=2.0,<2.2-dev
This package is auto-updated.
Last update: 2024-09-15 07:58:00 UTC
README
/!\ 目前处于开发中
特性
- 通过 Instagram API 进行身份验证
- 检索 Instagram 照片
安装 / 配置
1) 在您的 app/routing.yml
中添加以下内容
eko_instagram: resource: "@EkoInstagramBundle/Resources/config/routing.xml"
2) 在 app/config.yml
中添加您的配置
eko_instagram: applications: yourapplication: application_id: 000000000000000000000 application_secret: 000000000000000000000 redirect_route: eko_instagram_default_redirect
身份验证用户
1) 创建第一个控制器操作以获取身份验证代码
<?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) 创建第二个控制器以使用您的 API 方法
<?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(); }
更多即将推出
不要犹豫,贡献您的力量!