Skip to content

derekhuynen/LinkedIn_AI_Auto_Poster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinkedIn AI Auto Poster

Overview

The LinkedIn AI Auto Poster is an intelligent, AI-driven solution designed to automate the creation and publishing of engaging LinkedIn content. Leveraging cutting-edge Azure OpenAI technology, this application streamlines content generation and ensures consistent, high-quality posting directly to LinkedIn. Ideal for professionals looking to enhance their digital presence effortlessly, this automated system saves significant time while maintaining active audience engagement.

Features

  • AI-Enhanced Daily Automation: Automatically executes daily at 9 AM, handling content creation and posting seamlessly.
  • Dynamic AI Topic Generation: Utilizes Azure OpenAI to craft unique and relevant topics, intelligently avoiding repetition.
  • Automated Content Creation: Produces captivating LinkedIn posts with advanced AI-generated insights.
  • DALL-E 3 Image Generation: Creates professional, engaging images for each post to boost engagement and visibility.
  • Direct LinkedIn Integration: Publishes AI-crafted content with images directly to your LinkedIn profile or page.
  • Efficient Data Storage: Archives generated posts, images, and metadata in Azure Cosmos DB for future reference and analysis.

Architecture

The solution leverages these Azure services:

  • Azure Functions: Scheduled timer-triggered functions manage daily automation.
  • Azure OpenAI: Provides generative AI capabilities for topic and content creation.
  • Azure Cosmos DB: Securely stores generated posts, ensuring data persistence and easy retrieval.
  • Azure Blob Storage: Stores generated images before posting.
  • Azure Key Vault: Securely manages API keys and connection strings.

Project Structure

linkedin_ai_auto_poster/
├── host.json
├── local.settings.json
├── package.json
├── tsconfig.json
├── src/
│   ├── index.ts
│   ├── constants/
│   ├── flow/
│   │   └── linkedin_post_flow.ts
│   ├── functions/
│   │   ├── auto_post.ts
│   │   ├── test_linkedin_post.ts
│   │   └── test_image_generation.ts
│   ├── prompts/
│   │   ├── generate_linkedin_post_derek_huynen.md
│   │   ├── generate_topic_derek_huynen.md
│   │   └── generate_linkedin_image_prompt.md
│   ├── service/
│   │   ├── CosmosService.ts
│   │   ├── LinkedinService.ts
│   │   ├── MdService.ts
│   │   └── OpenAiService.ts
│   └── types/
│       └── Post.ts
├── scripts/
│   ├── deploy-infra.sh
│   └── publishProfile.publishsettings
├── ReadMe.md

Key Components

  • linkedin_post_flow.ts: Coordinates the intelligent AI-driven workflow.
  • auto_post.ts: Azure Function scheduled trigger implementation.
  • CosmosService.ts: Manages database interactions.
  • LinkedinService.ts: Handles LinkedIn API interactions.
  • OpenAiService.ts: Facilitates content and topic generation using Azure OpenAI.

Getting Started

Quick Setup

  1. Clone & Navigate:

    git clone <repository-url>
    cd linkedin_ai_auto_poster
  2. Install Dependencies:

    npm install
  3. Configure Variables: Set your environment variables in local.settings.json.

  4. Local Execution: Run locally with Azure Functions Core Tools:

    func start
  5. Test Image Generation: Test the DALL-E 3 image generation feature:

    .\scripts\test_dalle3.ps1
  6. Deploy to Azure:

    func azure functionapp publish <function-app-name>

Documentation

Azure AI Setup

1. Azure AI Foundry & Hub

  • Create resources via Azure Portal to host and manage your AI models.

2. Model Deployment

  • Deploy your chosen OpenAI model and note endpoint and API details.

LinkedIn API Integration

  1. LinkedIn Developer Project:

  2. Generate OAuth Token:

    • Obtain access tokens via LinkedIn’s OAuth tools.
  3. Retrieve LinkedIn URN:

    • Use the LinkedIn API:
      GET https://api.linkedin.com/v2/userinfo
      • Pass the Authorization: Bearer <access_token> header to get your member URN.
  4. Secure Credentials:

    • Save tokens securely in your environment variables.

Cosmos DB Configuration

  1. Create Cosmos DB Instance:

    • Set up Cosmos DB on Azure Portal and define the data model (src/types/Post.ts).
  2. Configure Credentials:

    • Store DB credentials in environment variables.

Best Practices

  • Security: Utilize Azure Key Vault for managing sensitive credentials.
  • Robust Error Handling: Implement retries with exponential backoff.
  • Optimized Performance: Enhance query performance and use caching where feasible.
  • Comprehensive Logging: Enable detailed logs for monitoring and troubleshooting.

Future Roadmap

  • Multi-platform social media support
  • Web dashboard for managing content
  • Advanced analytics integration for detailed performance tracking

Additional Resources

About

Use Ai to Post to Linkedin at 9am every morning.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published