mediadesk/linkedin-manager
Composer 安装命令:
composer require mediadesk/linkedin-manager
包简介
LinkedIn API Wrapper for Laravel
README 文档
README
LinkedIn Integration Package for Laravel (Unofficial Package)
This package provides integration with the LinkedIn API for Laravel applications. It allows you to perform various LinkedIn-related tasks such as authenticating users, retrieving profiles, creating and deleting posts, and more.
Please Note: This package is currently in active development and should be used with caution. While we are working hard to ensure stability and functionality, there might be frequent updates and changes that could impact your usage.
Important: Business Developer Account Requirement
Creating and managing accounts on behalf of another user requires a Business Developer account on LinkedIn. Make sure you have the necessary permissions and access before using this feature.
Get Started
Requires PHP 8.1+
To get started with the LinkedinManager package, follow these steps:
Install the package using Composer:
composer require mediadesk/linkedin-manager
Publish Config File
To customize the configuration settings of the Mediadesk Linkedin Manager package, you can publish the config file using the following Artisan command:
php artisan vendor:publish --tag=mediadesk-linkedin
Configuration
Ensure the following environment variables are set in your .env file:
LINKEDIN_CLIENT_ID= LINKEDIN_CLIENT_SECRET= LINKEDIN_CALLBACK=
Usage
Creating Login URL
To create a login URL for LinkedIn authentication, make sure to add the callback URI to your LinkedIn Developer application. Then, use the following code:
$linkedin_agent = new LinkedinAgent(); $loginUrl = $linkedin_agent->getLoginUrl();
Generating Access Token
Generate an access token from the callback URL. You will receive the code and state in the URL parameters. Use the following code:
$linkedin_agent = new LinkedinAgent(); $access_token = $linkedin_agent->getAccessToken($code, $state);
Managing User Profiles
Retrieve user profile information, including member ID, name, and profile image, using the following code:
$linkedin_profile = $linkedin_agent->getProfile($access_token); $member_id = $linkedin_profile->getMemberId(); $name = $linkedin_profile->getName(); $profile_image = $linkedin_profile->getProfileImage();
Creating Text Posts
Create a text-only post on LinkedIn using the following code:
$linkedin_agent->createTextPost('Hello world!', $member_id, $access_token);
Creating Posts with Media
To create a post with media, you'll need to register the media and then upload it. Here's how:
$image_register = (new LinkedinMediaRegister($member_id))->register($access_token); $media_id = $linkedin_agent->uploadMedia($image_register, '/path/to/media/file', $access_token); $LinkedinMedia[] = $linkedin_agent->LinkedinMedia('Cat', 'Working on iOS', $media_id); $linkedin_agent->createPostWithMedia('Wow, a beautiful cat here!', $LinkedinMedia, $member_id, $access_token);
Deleting a Post
Delete a post using the following code:
$linkedin_agent->deletePost($post_id, $access_token);
Contributing
Contributions are welcome! If you encounter any issues or have suggestions, please open an issue.
License
Linkedin Manager is an open-sourced software licensed under the MIT license.
mediadesk/linkedin-manager 适用场景与选型建议
mediadesk/linkedin-manager 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 3, 最近一次更新时间为 2023 年 08 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「social」 「linkedin」 「laravel」 「social-media」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mediadesk/linkedin-manager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mediadesk/linkedin-manager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mediadesk/linkedin-manager 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Linkedin API integration for Laravel and Lumen 5
Simple Sharing generates social media share links within CP entry pages, allowing you to quickly & easily share entries.
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
LinkedIn integration for Social
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
Laravel package for the simplification and integration of many of your users most wanted login providers. Installation is a breeze. Never worry about OAuth again.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-29