Giter Club home page Giter Club logo

crakzor / linkedin-post-automator Goto Github PK

View Code? Open in Web Editor NEW
45.0 3.0 13.0 52 KB

Automatically curates and posts content to LinkedIn. It can optionally use web scraping to gather data, which is then fed to ChatGPT to craft engaging LinkedIn posts.

License: MIT License

Python 100.00%
chatgpt-api linkedin linkedin-bot linkedin-post linkedin-posts-automation linkedin-scraper openai-api post-scheduler post-scheduling website-scraper chatgpt-bot

linkedin-post-automator's Introduction

๐Ÿค– LinkedIn Post Automator

LinkedIn Post Automator is a versatile tool designed to generate content using OpenAI's GPT. It crafts compelling LinkedIn post content in response to user prompts and can optionally incorporate scraped data from designated websites. This tool ensures that fresh and captivating content is produced regularly without manual intervention.

๐Ÿ“ Project Structure

๐Ÿš€ Main Component:

  • main.py: This file is the central hub of the project. It seamlessly integrates web scraping, ChatGPT processing, and LinkedIn content generation. Once initiated, it operates in a continuous loop, relying on an internal scheduler to roll out content at user-defined intervals.

๐Ÿ›  Configuration:

User-specific settings are housed in the config.json file:

  • bio: Your professional biography.

  • gpt_preamble: Initial instructions for the ChatGPT model.

  • gpt_token_limit: The response token limit for GPT.

  • open_ai_api_key: Your personal API key to access OpenAI's services.

    • To obtain this:
      • Visit OpenAI's Platform.
      • Sign up for an account.
      • Once you are registered and logged in, navigate to the API section to get your API key.
  • cookies: LinkedIn cookies for authentication.

    • To get your logged-in cookies from the browser:
      • Login to LinkedIn.
      • Right-click on the page and select "Inspect" (or Ctrl+Shift+I).
      • Navigate to the "Application" tab.
      • In the left sidebar, find and expand the "Cookies" section.
      • Copy the relevant cookie values.
  • hour_interval: Interval (in hours) between each post.

  • random_hour_offset: Max random hour offset added to the interval.

  • random_min_offset: Max random minute offset added to the interval.

  • scrape_char_limit: Maximum character limit for web scraping (relevant if "websites" are provided).

  • websites: An optional array of URLs for news scraping. If not provided, the tool will lean on ChatGPT, for example, to generate daily jokes or insights based on the preamble.

๐Ÿš€ How to Run

  1. Install the required Python packages:
    pip install -r requirements.txt
  2. Rename example_config.json to config.json.
  3. Populate the config.json file with your details and preferences.
  4. Start the automation with:
    python main.py

โฐ Internal Scheduling

Equipped with an internal Python scheduler, the tool ensures automated content generation at user-defined intervals, enhanced by random offsets for variability. No external cron configurations are required.

๐Ÿค Contributing

Contributions are highly appreciated! If you see potential improvements or wish to introduce new functionalities, please fork the repository and submit your pull requests. Keep your documentation clear and concise.

๐Ÿ“œ License

This project is under the MIT License.

linkedin-post-automator's People

Contributors

crakzor avatar harmeetsingh-work avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

linkedin-post-automator's Issues

providing context

Option for including additional post context, for example, the last 4 posts made. This will prevent duplicate / similar consecutive posts.

core/chatgpt.py: continuation bug

When message requires a continuation, it posts twice, and the last message response includes something along the lines of "I appologize the previous message was cut off..."

Auth for Linkedin

Hi!

Linkedin shows a "CSRF check invalid". Seems that auth is not working here.
Are you still able to post without it?

Need cookie refresh

Bot stops working when session expires. Currently, cookie value is only valid for about a week. Need to implement refresh. When server responds with set cookie in header, update cookie in config.json.

error in running main.py

$ /bin/python /home/varun/auto/linkedin-post-automator/main.py
Traceback (most recent call last):
File "/home/varun/auto/linkedin-post-automator/main.py", line 2, in
from core.content_manager import ContentManager
File "/home/varun/auto/linkedin-post-automator/core/content_manager.py", line 2, in
from core.chatgpt import ChatGpt
File "/home/varun/auto/linkedin-post-automator/core/chatgpt.py", line 7, in
class IncompleteResponse(openai.error.OpenAIError):
^^^^^^^^^^^^
AttributeError: module 'openai' has no attribute 'error'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.