Skip to content

dontAskVI/ai-intern

Repository files navigation

AI Intern

This project, developed in collaboration with Galadriel, is designed to interact with the X API, fetching and processing tweets to store them locally in a structured format. It also includes functionality to update tweet descriptions and manage associated media links.

The ultimate goal of this project is to create a fully autonomous AI agent that can serve as an intern on X, offering a simple solution for automating tweeting on X.

This project is in its early stages, with continuous development planned. Upcoming updates will include custom Solidity agent contracts and configuration files. All automated tweets generated by this AI intern will be posted on X.

Version: 0.0.1

Prerequisites

Before you begin, ensure you have the following installed:

Setup

  1. Install Dependencies:

    Start by installing the necessary Node.js dependencies:

    npm install
  2. Environment Variables:

    Copy the template.env file to .env and fill in the necessary environment variables:

    cp template.env .env

    Then, open .env and replace the placeholders with your actual API keys and other necessary configurations:

    BEARER_TOKEN="your_bearer_token"
    CLIENT_ID="your_client_id"
    CLIENT_SECRET="your_client_secret"
    ACCOUNT_ID="your_twitter_account_id"
  3. Run the Main Script:

    After setting up your environment variables, run the main script to fetch and process tweets:

    npm run main

    This will:

    • Fetch tweets from the specified Twitter account.
    • Save the tweets and their associated media links to the output folder.
  4. Update Descriptions:

    To update tweet descriptions with the content from descriptions.txt, use the following command:

    npm run update
  5. Run the Custom Agent (Optional):

    (This step will be detailed later when the Galadriel custom agent contract is available.)

    You will need to use the Galadriel custom agent contract to run the agent as part of the process. More information will be provided once this step is ready.

Project Structure

  • src/: Contains the main TypeScript source files.

    • clients/: Holds the Twitter API client.
    • utils/: Utility functions for file operations.
    • main.ts: The entry point for fetching and processing tweets.
    • updateDescriptions.ts: Script to update tweet descriptions based on an external file.
  • output/: Stores the output files generated by the scripts.

    • intern-tweets.json: The structured JSON file of tweets.
    • links.txt: A file containing media links extracted from the tweets.
    • descriptions.txt: A file containing descriptions to update the tweets.
  • config/: Contains environment variable configurations.

    • .env: Your environment-specific variables.
    • template.env: Template for environment variables.

Important Notes

  • Make sure to keep your .env file secure as it contains sensitive information like API keys.
  • The project is designed to be run in a controlled environment with appropriate API rate limits considered.

About

AI Intern

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published