Skip to content

orbit-love/community-ruby-linkedin-orbit

Repository files navigation

Warning This repository is no longer recommended or maintained and has been archived. Huge thanks to the original authors and contributors for providing this Github Actions template to our community. To add LinkedIn interactions to your Orbit workspace, you can now request access to the Linkedin integration under Workspace Settings > Integrations. Should you wish to maintain your own version of this repository, you are welcome to fork this repository and continue developing it there.


Build Status Gem Version Contributor Covenant

Add your LinkedIn interactions into your Orbit workspace with this community-built integration.

New LinkedIn post comment in Orbit screenshot

This is a community project. The Orbit team does its best to maintain it and keep it up to date with any recent API changes.

We welcome community contributions to make sure that it stays current.

There are three ways to use this integration. Install package - build and run your own applications. Run the CLI - run on-demand directly from your terminal. Schedule an automation with GitHub - get started in minutes - no coding required

First Time Setup

To set up this integration you will need to follow some steps required by LinkedIn. Please follow the First Time Setup guide for step-by-step instructions.

Application Credentials

The application requires the following environment variables:

Variable Description More Info
LINKEDIN_TOKEN LinkedIn Token Follow the First Time Setup guide to obtain the token
LINKEDIN_ORGANIZATION LinkedIn Organization Page ID Format: urn:li:organization:#{id}, where id is the set of numbers in the LinkedIn page URL, i.e. https://www.linkedin.com/company/28866695, the id is 28866695.
ORBIT_API_KEY API key for Orbit Found in Account Settings in your Orbit workspace
ORBIT_WORKSPACE_ID ID for your Orbit workspace Last part of the Orbit workspace URL, i.e. https://app.orbit.love/my-workspace, the ID is my-workspace

Package Usage

To install this integration in a standalone app, add the gem to your Gemfile:

gem "linkedin_orbit"

Then, run bundle install from your terminal.

You can instantiate a client by either passing in the required credentials during instantiation or by providing them in your .env file.

Instantiation with credentials:

client = LinkedinOrbit::Client.new(
    orbit_api_key: YOUR_API_KEY,
    orbit_workspace_id: YOUR_ORBIT_WORKSPACE_ID,
    linkedin_token: YOUR_LINKEDIN_TOKEN,
    linkedin_organization: YOUR_LINKEDIN_ORGANIZATION_ID
)

Instantiation with credentials in dotenv file:

client = LinkedinOrbit::Client.new

Performing a Historical Import

You may want to perform a one-time historical import to fetch all your previous LinkedIn interactions and bring them into your Orbit workspace. To do so, instantiate your client with the historical_import flag:

client = LinkedinOrbit::Client.new(
  historical_import: true
)

Fetching LinkedIn Comments

The API token owner must be an admin on the LinkedIn organization's page in order to fetch comments. Please ask the manager of your LinkedIn page to grant admin status to your account before attempting to fetch comments.

Once, you have an instantiated client, you can fetch LinkedIn comments on your organization's posts and send them to Orbit by invoking the #comments instance method:

client.comments

CLI Usage

You can also use this package with the included CLI. To use the CLI pass in the required environment variables on the command line before invoking the CLI:

$ ORBIT_API_KEY=... ORBIT_WORKSPACE_ID=... LINKEDIN_TOKEN=... LINKEDIN_ORGANIZATION=... bundle exec linkedin_orbit --check_comments

Add the --historical-import flag to your CLI command to perform a historical import of all your LinkedIn interactions using the CLI.

GitHub Actions Automation Setup

⚡ You can set up this integration in a matter of minutes using our GitHub Actions template. It will run regularly to add new activities to your Orbit workspace. All you need is a GitHub account.

See our guide for setting up this automation.

Contributing

We 💜 contributions from everyone! Check out the Contributing Guidelines for more information.

License

This is available as open source under the terms of the MIT License.

Code of Conduct

This project uses the Contributor Code of Conduct. We ask everyone to please adhere by its guidelines.