Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linkedin for OMI Web Personas #1752 #1780

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

harshithsunku
Copy link

@harshithsunku harshithsunku commented Feb 9, 2025

Fixes #1752

Added LinkedIn Integration to OMI Personas

Overview

Added LinkedIn profile integration alongside existing Twitter support, enabling users to create AI personas from either platform.

Key Changes

  •  Added LinkedIn API integration
  • ️ Created new components for better code organization:
    • ChatbotList
    • Header
    • Footer
    • InputArea
    • `Profiles '
  •  Updated UI to support both Twitter and LinkedIn profiles
  •  Added LinkedIn-specific data handling:
    • Profile information
    • Connection & follower counts
    • Professional history
    • Skills and posts

Technical Implementation

// New LinkedIn profile fetching
const fetchLinkedinProfile = async (handle: string) => {
  const profileResponse = await fetch(`https://${process.env.NEXT_PUBLIC_LINKEDIN_API_HOST}/profile-data-connection-count-posts?username=${encodedHandle}`, {
  // Process LinkedIn profile data
}

Testing Coverage ✅

  • Twitter-only profiles
  • LinkedIn-only profiles
  • Dual-platform profiles

Environment Variables Added

NEXT_PUBLIC_LINKEDIN_API_HOST=
NEXT_PUBLIC_LINKEDIN_API_KEY=

image

image

Snip from firebase:
image

Pop Up if profile exists in both platforms

image

Flow Diagram for Profile selection and creation

graph TD
    A[User Enters Handle] --> B{Is Profile exist?}
    B -->|Not Found| C{Check Platform Availability?}
    B -->|Found| D{Where Does it Exist?}
    C -->|Twitter Only| E[Create Twitter Profile]
    C -->|LinkedIn Only| F[Create LinkedIn Profile]
    C -->|Both Available| G[fetch and create both]
    C -->|Not Available| H[Show Error: Profile Not Found]
    D -->|Twitter Only| I{Is Linkedin Available?}
    I -->|No, Route to twitter chat|R
    I -->|Yes|S
    D -->|Both| K{Select platform twitter/linkedin?}
    D -->|LinkedIn Only| J{Is Twitter Available?}
    S -->K
    J -->|Yes|T
    J -->|No, Route to Linkedin Chat|R
    T -->K
    K -->|Based on user selection linnked or twitter| R
    E --> L[Route to New Chat]
    F --> L
    G --> M{Selected Platform twitter/linkedin?}
    M -->|LinkedIn/Twitter based on selection| L
    R[Route to chat]
    S[Fetch and create Linkedin]
    T[Fetch and create Twitter]
Loading

Flow Diagram of Code for Profile selection

graph TD
    A[User enters Handle] -->B[Scrape handle ONLY if Not exists in DB,For both twitter and linkedin scrape and save in DB]
    B --> C{Check Platform Avalibality?}
    C -->|if hanle not found| E[toast error profile not exists]
    C -->|Only Twitter| D[Route to Chat]
    C -->|Only Linkedin| D
    C -->|Both platform for same handle| F{Popup to select twitter or linkedin}
    F -->|twitter or linkedin based on selection| D
Loading

@harshithsunku harshithsunku changed the title Initial commit For linkedin scrapping in OMI Personas linkedin scrapping for OMI Web Personas #1752 Feb 9, 2025
@harshithsunku harshithsunku changed the title linkedin scrapping for OMI Web Personas #1752 linkedin for OMI Web Personas #1752 Feb 9, 2025
@harshithsunku harshithsunku marked this pull request as ready for review February 9, 2025 16:47
@harshithsunku harshithsunku marked this pull request as draft February 9, 2025 17:27
@harshithsunku harshithsunku marked this pull request as ready for review February 9, 2025 17:54
@beastoin
Copy link
Collaborator

1/ how do you handle the profile creation / navigation when the user simply types @x then hit the create ai persona button ? consider 2 cases: one for the new user and for an existing user.

@harshithsunku

@harshithsunku
Copy link
Author

1/ how do you handle the profile creation / navigation when the user simply types @x then hit the create ai persona button ? consider 2 cases: one for the new user and for an existing user.

@harshithsunku

Hi @beastoin ,

Kindly refer to the "Flow Diagram for Profile Selection" and check the screenshot in the description above.

Thanks.

@beastoin
Copy link
Collaborator

1/ could you simplify the diagram? the complexity level of this simple task should not be that high.

man, if you are using an AI to generate the diagram for your code, you have to make sure your code is super good and backed by the diagram from your brain.

forgive me if you drew it yourself 🤯

@harshithsunku

@harshithsunku
Copy link
Author

1/ could you simplify the diagram? the complexity level of this simple task should not be that high.

man, if you are using an AI to generate the diagram for your code, you have to make sure your code is super good and backed by the diagram from your brain.

forgive me if you drew it yourself 🤯

@harshithsunku

Hi @beastoin ,

The diagram was created manually—yes, the old-fashioned way! ✍️

It was the initial design to ensure all scenarios were covered before diving into the actual code.

The final code is now sleek, simple, and handles all the scenarios from the previous flow diagram.

Kindly refer to the final code flow diagram. It’s as simple as it gets! 😃

Thanks!

@kodjima33
Copy link
Collaborator

kodjima33 commented Feb 12, 2025

@harshithsunku can you host it anywhere and give a link? i want to test scraping of posts

@harshithsunku
Copy link
Author

harshithsunku commented Feb 13, 2025

@harshithsunku can you host it anywhere and give a link? i want to test scraping of posts

Hi @kodjima33 ,

I've shared the link over a mail please check.

Thanks.

@beastoin
Copy link
Collaborator

1/ ✅ ok
2/ could you support the link as well, besides the handle. e.g https://x.com/_thinx -> X @_thinx, https://www.linkedin.com/in/thinx/ -> LinkedIn @THINX

@harshithsunku

@harshithsunku
Copy link
Author

harshithsunku commented Feb 15, 2025

1/ ✅ ok
2/ could you support the link as well, besides the handle. e.g https://x.com/_thinx -> X @_thinx, https://www.linkedin.com/in/thinx/ -> LinkedIn @THINX

@harshithsunku

Hi @beastoin , @kodjima33 .

Good suggestion! I had considered this during the initial design/implementation but didn’t add it since it wasn’t part of the original request.

I’ll include this support now.

I’m currently on a business travell and will be back on Saturday, February 22nd. I’ll get this done by February 23rd.

Thanks for your understanding!

Regards,
Harshith

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add linkedin for omi web personas
3 participants