soroush / apply-with-linkedin-php
此包的最新版本(dev-master)没有提供许可信息。
一个LinkedIn包装器,可以从用户个人资料生成可以发送给顾问的简历
dev-master
2018-07-27 21:35 UTC
Requires
- php: >=5.4.0
- ensepar/html2pdf: dev-master
Requires (Dev)
- satooshi/php-coveralls: dev-master
This package is not auto-updated.
Last update: 2024-09-28 17:12:37 UTC
README
LinkedIn类,基于用户个人资料生成PDF
为什么我应该使用这个库?
- 您不需要编写长的API调用。所有API调用都由库处理
- IDE友好:该库是IDE友好的,您无需检查LinkedIn网站即可查看可用字段。您可以在实体文件夹中查看字段
- 从成员个人资料生成PDF
- 代码行数少。您可以从成员个人资料创建PDF,在浏览器中显示它
- 节省时间!
我之所以使用OAuth 1,是因为您可以清除令牌,并可以强制用户再次登录!
安装
Composer
如果您使用Composer,请将其添加到您的依赖项中: "soroush/apply-with-linkedin-php": "dev-master"
PHP OAUTH驱动程序
您需要安装PHP OAUTH驱动程序。在您的机器上执行以下命令: pecl install oauth
下载个人资料为PDF的示例代码
require_once 'vendor/autoload.php'; $consumerKey = ''; $consumerSecret = ''; $linkedin = new \Soroush\Linkedin\Linkedin($consumerKey, $consumerSecret); if ($linkedin->isLoggedIn()) { echo $linkedin->fetch()->downloadPdf(); } else { echo $linkedin->getLoginUrl(); }
获取用户详细信息示例代码
require_once 'vendor/autoload.php'; $consumerKey = ''; $consumerSecret = ''; $linkedin = new \Soroush\Linkedin\Linkedin($consumerKey, $consumerSecret); if ($linkedin->isLoggedIn()) { echo $linkedin->fetch()->profile()->getFirstName(); echo $linkedin->fetch()->profile()->getLastName(); } else { echo $linkedin->getLoginUrl(); }