Skip to content

V-chatgpt-social-status-feeds is a robust application designed to generate and manage automated social media status updates using the ChatGPT API. It facilitates user account creation, handles authentication, and enforces API usage limits.

License

Notifications You must be signed in to change notification settings

djav1985/v-chatgpt-social-status-feeds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

❯ v-chatgpt-social-status-feeds

Empowering Your API Experience, Effortlessly!

Built with the tools and technologies:

PHP


Table of Contents

πŸ“ Overview

The ChatGPT API Status Generator addresses the need for efficient social media management by automating status updates and user account management. Key features include user-friendly interfaces for account creation, status generation, and secure password management. Ideal for social media managers and developers, it streamlines content sharing and enhances user engagement.


πŸ‘Ύ Features

Feature Summary
βš™οΈ Architecture
  • Built primarily in <PHP> with a structured file organization for easy navigation.
  • Utilizes a modular approach with separate files for configuration, database management, and user interactions.
  • Incorporates a cron job for scheduled tasks, enhancing operational efficiency.
πŸ”© Code Quality
  • Follows best practices for code organization, ensuring maintainability and readability.
  • Includes CSRF protection and input validation to enhance security.
  • Utilizes structured queries for database interactions, minimizing the risk of SQL injection.
πŸ“„ Documentation
  • Documentation is primarily in <PHP> with clear comments explaining the functionality of each component.
  • Includes usage instructions and configuration settings for the ChatGPT API.
  • Provides detailed descriptions of file contents, enhancing developer understanding.
πŸ”Œ Integrations
  • Integrates with the OpenAI API for generating responses and managing user interactions.
  • Supports RSS feed generation for user status updates, enhancing content distribution.
  • Facilitates social media account management through API interactions.
🧩 Modularity
  • Modular design allows for easy updates and feature additions without affecting the entire codebase.
  • Components are organized into helpers, forms, and pages, promoting separation of concerns.
  • Encourages reusability of code through helper functions for common tasks.
πŸ§ͺ Testing
  • Includes mechanisms for validating user input and ensuring data integrity.
  • Automated tasks in the cron job enhance reliability and reduce manual errors.
  • Testing commands are not explicitly defined, but the structure supports unit testing practices.
⚑️ Performance
  • Utilizes caching strategies via .htaccess for improved load times and reduced server load.
  • Efficient database interactions through structured queries enhance response times.
  • Scheduled tasks optimize resource usage, ensuring smooth operation during peak times.
πŸ›‘οΈ Security
  • Implements CSRF protection and session management to secure user interactions.
  • Utilizes password hashing for secure user authentication.
  • Prevents unauthorized access to sensitive directories through script termination.
πŸ“¦ Dependencies
  • Relies on <PHP> as the primary programming language.
  • Utilizes .htaccess for URL rewriting and caching strategies.
  • Includes robots.txt for managing web crawling and optimizing server load.

πŸ“ Project Structure

└── /
    β”œβ”€β”€ CHANGELOG.md
    β”œβ”€β”€ LICENSE
    β”œβ”€β”€ README.md
    β”œβ”€β”€ root
    β”‚   β”œβ”€β”€ app
    β”‚   β”‚   β”œβ”€β”€ forms
    β”‚   β”‚   β”‚   β”œβ”€β”€ accounts-forms.php
    β”‚   β”‚   β”‚   β”œβ”€β”€ home-forms.php
    β”‚   β”‚   β”‚   β”œβ”€β”€ info-forms.php
    β”‚   β”‚   β”‚   └── users-forms.php
    β”‚   β”‚   β”œβ”€β”€ helpers
    β”‚   β”‚   β”‚   β”œβ”€β”€ accounts-helper.php
    β”‚   β”‚   β”‚   β”œβ”€β”€ home-helper.php
    β”‚   β”‚   β”‚   └── users-helper.php
    β”‚   β”‚   └── pages
    β”‚   β”‚       β”œβ”€β”€ accounts.php
    β”‚   β”‚       β”œβ”€β”€ home.php
    β”‚   β”‚       β”œβ”€β”€ info.php
    β”‚   β”‚       └── users.php
    β”‚   β”œβ”€β”€ config.php
    β”‚   β”œβ”€β”€ cron.php
    β”‚   β”œβ”€β”€ db.php
    β”‚   β”œβ”€β”€ lib
    β”‚   β”‚   β”œβ”€β”€ auth-lib.php
    β”‚   β”‚   β”œβ”€β”€ common-lib.php
    β”‚   β”‚   β”œβ”€β”€ load-lib.php
    β”‚   β”‚   β”œβ”€β”€ rss-lib.php
    β”‚   β”‚   └── status-lib.php
    β”‚   └── public
    β”‚       β”œβ”€β”€ .htaccess
    β”‚       β”œβ”€β”€ assets
    β”‚       β”‚   β”œβ”€β”€ css
    β”‚       β”‚   β”‚   β”œβ”€β”€ index.php
    β”‚       β”‚   β”‚   β”œβ”€β”€ login.css
    β”‚       β”‚   β”‚   β”œβ”€β”€ mobile.css
    β”‚       β”‚   β”‚   β”œβ”€β”€ pages.css
    β”‚       β”‚   β”‚   └── styles.css
    β”‚       β”‚   β”œβ”€β”€ images
    β”‚       β”‚   β”‚   β”œβ”€β”€ background-marble.png
    β”‚       β”‚   β”‚   β”œβ”€β”€ default.jpg
    β”‚       β”‚   β”‚   β”œβ”€β”€ default.png
    β”‚       β”‚   β”‚   β”œβ”€β”€ index.php
    β”‚       β”‚   β”‚   └── logo.png
    β”‚       β”‚   β”œβ”€β”€ index.php
    β”‚       β”‚   └── js
    β”‚       β”‚       β”œβ”€β”€ footer-scripts.js
    β”‚       β”‚       β”œβ”€β”€ header-scripts.js
    β”‚       β”‚       └── index.php
    β”‚       β”œβ”€β”€ favicon.ico
    β”‚       β”œβ”€β”€ feeds.php
    β”‚       β”œβ”€β”€ images
    β”‚       β”‚   β”œβ”€β”€ admin
    β”‚       β”‚   β”‚   β”œβ”€β”€ dasdasdas
    β”‚       β”‚   β”‚   β”‚   └── index.php
    β”‚       β”‚   β”‚   └── tesstfsdfsdf
    β”‚       β”‚   β”‚       β”œβ”€β”€ 6722a3c3c03ad.png
    β”‚       β”‚   β”‚       β”œβ”€β”€ 6722ab0482aca.png
    β”‚       β”‚   β”‚       β”œβ”€β”€ 6722ab723237e.png
    β”‚       β”‚   β”‚       β”œβ”€β”€ 6722abb9cb8c5.png
    β”‚       β”‚   β”‚       β”œβ”€β”€ 6722ac1d0b8c2.png
    β”‚       β”‚   β”‚       └── index.php
    β”‚       β”‚   └── index.php
    β”‚       β”œβ”€β”€ index.php
    β”‚       β”œβ”€β”€ login.php
    β”‚       └── robots.txt
    └── v-chatgpt-social-status-feeds.png

πŸ“‚ Project Index

/
__root__
root
config.php - Configuration settings establish essential parameters for the ChatGPT API Status Generator, including API keys, endpoints, model preferences, and database connection details
- These settings facilitate seamless interaction with the OpenAI API, guiding the AI's responses and managing system behavior
- By defining operational limits and system prompts, it ensures the application functions effectively within its intended scope, enhancing user experience and performance.
cron.php - Handles scheduled tasks for the ChatGPT API project, including resetting API usage, updating statuses, clearing the IP blacklist, and purging outdated images
- It ensures efficient management of user accounts by automating routine maintenance, thereby enhancing system performance and user experience
- This functionality is crucial for maintaining operational integrity and optimizing resource usage within the overall codebase architecture.
db.php - Database connection and initialization are established through a class that manages interactions with the database
- It ensures the creation of essential tables for user management, account details, and logging activities
- Additionally, it handles installation checks and updates, facilitating smooth transitions between application versions while maintaining data integrity and security through password hashing and structured queries.
app
forms
accounts-forms.php - Account management functionality is provided, enabling users to create, edit, and delete accounts within the ChatGPT API project
- It ensures data validation and security through CSRF token checks, while also managing associated status updates in the database
- Successful operations lead to user feedback and redirection, enhancing the overall user experience in managing their accounts effectively.
home-forms.php - Handles user interactions for generating and deleting status updates within the ChatGPT API project
- It validates CSRF tokens to ensure secure requests, manages API call limits for users, and facilitates the deletion of associated images when a status is removed
- This functionality is crucial for maintaining user-generated content and ensuring a seamless experience in the application’s status management system.
info-forms.php - Facilitates user password management within the ChatGPT API project by handling password change requests
- It ensures security through CSRF token validation and password strength checks, while also providing user feedback on errors
- Upon successful validation, it updates the user's password in the database, enhancing overall user account security and experience in the application.
users-forms.php - User management functionality is facilitated through this component, enabling the creation, modification, and deletion of user accounts within the ChatGPT API project
- It ensures secure handling of user data, including password validation and CSRF protection, while also managing user roles and associated resources
- This integration plays a crucial role in maintaining the integrity and security of user interactions within the overall application architecture.
helpers
accounts-helper.php - Account details generation facilitates the retrieval and display of user-specific information, including account limits and usage statistics, enhancing user experience within the ChatGPT API project
- It also supports the creation of dropdown options for scheduling tasks and managing user accounts, thereby streamlining account management and interaction
- This functionality is integral to the overall architecture, ensuring users can efficiently monitor and control their API usage.
home-helper.php - Generates a set of interactive share buttons for status updates within the ChatGPT API project
- It facilitates users in sharing status text and associated images, while also providing options to copy text, download images, and delete statuses
- This functionality enhances user engagement and streamlines the management of status updates, contributing to a more dynamic and user-friendly experience in the application.
users-helper.php - Generates a comprehensive user list for the ChatGPT API, displaying essential user data and providing interactive options for updating, deleting, and logging in as different users
- This functionality enhances user management within the application, facilitating administrative tasks and improving overall user experience by allowing seamless interaction with user accounts.
pages
accounts.php - Facilitates the management of social media accounts by providing a user-friendly interface for adding and updating account information
- It allows users to input account details, select platforms, schedule posts, and include multimedia instructions
- Additionally, it displays existing account information and error messages, enhancing the overall user experience within the ChatGPT API project.
home.php - Generates and displays the status of user accounts within the ChatGPT API project
- It retrieves account information and associated statuses, allowing users to view, generate, and share statuses seamlessly
- The interface supports account management by providing options to collapse or expand status details, enhancing user interaction while ensuring a streamlined experience in monitoring and sharing account activities.
info.php - Facilitates user password management within the ChatGPT API project by providing a secure interface for changing passwords
- It ensures user authentication through session management and CSRF protection, enhancing overall security
- This component plays a crucial role in maintaining user account integrity and contributes to the project's focus on user experience and security.
users.php - User management functionality is facilitated through a form that allows for the addition and updating of user details, including username, password, account limits, and expiration dates
- It integrates with the overall architecture by providing a user interface for managing API access, ensuring that administrators can efficiently handle user accounts while displaying current user data dynamically
- This enhances the project's capability to manage user interactions with the ChatGPT API effectively.
lib
auth-lib.php - Authentication logic facilitates user login and logout processes within the ChatGPT API project
- It manages session states, verifies user credentials, and ensures security through session regeneration and CSRF token generation
- Additionally, it handles failed login attempts by monitoring IP addresses, enhancing overall security
- This component is essential for maintaining user access control and protecting sensitive information throughout the application.
common-lib.php - Utility functions enhance the ChatGPT API by ensuring secure user input handling, managing session messages, and overseeing IP blacklist operations
- They facilitate user and account information retrieval, status update management, and API usage tracking
- Additionally, these functions support external API communication, contributing to the overall architecture's robustness and security, while enabling efficient interaction with user data and system resources.
load-lib.php - Facilitates user access control and page loading within the ChatGPT API project
- It verifies user authentication and checks for blacklisted IP addresses, ensuring secure access
- By dynamically including relevant helper and forms files based on user permissions, it streamlines the management of user-specific content while maintaining session integrity and preventing unauthorized access to sensitive areas of the application.
rss-lib.php - Generates an RSS feed for user status updates, allowing users to access and subscribe to updates from specific accounts or all accounts owned by a user
- By retrieving and organizing status information from the database, it constructs a well-formed RSS XML output, enhancing user engagement and providing a streamlined way to follow updates within the ChatGPT API project.
status-lib.php - Generate and manage social media statuses through the ChatGPT API by retrieving account information, creating compelling content, and generating associated images
- This functionality enhances user engagement by automating status updates tailored to specific platforms, while also incorporating relevant hashtags
- The process includes error handling and retries for image generation, ensuring a seamless experience for users in managing their social media presence.
public
.htaccess - Facilitates URL rewriting and caching for a web application, enhancing user experience and performance
- It serves a default image when specific PNG files are missing, redirects root and index requests to the home page, and internally rewrites certain paths to a central index file
- Additionally, it manages cache control for various file types, optimizing resource delivery and reducing server load.
feeds.php - Generates an RSS feed for user accounts within the ChatGPT API project, facilitating content distribution and updates
- By validating and sanitizing input parameters, it ensures secure access to user-specific data
- This functionality enhances user engagement by allowing seamless integration of personalized content into various feed readers, thereby enriching the overall user experience within the application ecosystem.
index.php - Serves as the main dashboard for the ChatGPT API Status Generator, acting as the entry point for the admin interface
- It facilitates user interaction by providing navigation tabs for various sections, including statuses, accounts, and user management, while dynamically loading content based on user roles
- Additionally, it incorporates session management and integrates essential scripts and styles for a cohesive user experience.
login.php - Facilitates user authentication for the ChatGPT API project by providing a login interface for administrators
- It establishes a session, integrates necessary configurations and libraries, and presents a form for username and password input
- Additionally, it handles error messages, ensuring a smooth user experience while managing access to the administrative features of the application.
robots.txt - Facilitates web crawling management by defining rules for search engine bots
- The robots.txt located in the public directory specifies a crawl delay, ensuring that bots access the site at a controlled pace
- This contributes to the overall architecture by optimizing server load and enhancing user experience, while also guiding search engines on how to interact with the site's content.
images
index.php - Prevents direct access to the images directory by terminating script execution
- This mechanism enhances security within the project structure, ensuring that sensitive files are not exposed to unauthorized users
- By controlling access at this level, the overall integrity of the application is maintained, contributing to a robust architecture that prioritizes data protection and user privacy.
admin
dasdasdas
index.php - Prevents direct access to the admin image directory by terminating execution when accessed
- This mechanism enhances security within the project structure, ensuring that sensitive files are protected from unauthorized viewing or manipulation
- By implementing this safeguard, the overall integrity of the application is maintained, contributing to a robust and secure codebase architecture.
tesstfsdfsdf
index.php - Prevents unauthorized access to the directory by terminating script execution
- Positioned within the public images folder for admin, it serves as a security measure to safeguard sensitive content from being directly accessed or executed
- This contributes to the overall architecture by enhancing the project's security posture, ensuring that only intended functionalities are accessible to users.

πŸš€ Getting Started

β˜‘οΈ Prerequisites

Before getting started with the installation, ensure your runtime environment meets the following requirements:

  • Web Server: Apache
  • Programming Language: PHP 7.4+
  • Database: MySQL

βš™οΈ Installation

Install the project using the following steps:

  1. Upload Files:

    • Upload all the project files to your hosting server.
  2. Set Webroot:

    • Set the public folder as the webroot directory on your hosting server.
  3. Update Configuration:

    • Open root/config.php and update the necessary variables, including MySQL database credentials.
  4. Install Database:

    • Load the application in your web browser. The application will automatically install the database.
  5. Default Login:

    • Use the default login credentials: admin for both username and password.
  6. Set Up Cron Jobs:

    • Add the following cron jobs to automate tasks:
       /usr/bin/php /PATH-TO-CRON.PHP/cron.php reset_usage 0 12 1 * *
       /usr/bin/php /PATH-TO-CRON.PHP/cron.php clear_list 0 12 * * *
       /usr/bin/php /PATH-TO-CRON.PHP/cron.php run_status 0 * * * *
       /usr/bin/php /PATH-TO-CRON.PHP/cron.php cleanup 0 12 * * *
    • Replace /PATH-TO-CRON.PHP/ with the actual path to your cron.php file.

πŸ€– Usage

Login as admin with the password admin. Follow these steps:

  1. Create or Change Users:

    • Navigate to the User tab.
    • Add or update user details as needed.
  2. Create Status Campaigns:

    • Go to the Account tab.
    • Click on Add/Update New Account.
    • Fill in the following details:
      • Account Name
      • Platform
      • Prompt
      • Link
      • Image Instructions
      • Days
      • Post Schedule
      • Include Hashtags
    • Click Add/Update.

Statuses are generated on schedule and added to the respective account feed and the user's collective omni feed. Use the feed with tools like IFTTT to update social media.


πŸŽ— License

This project is protected under the MIT License License.


About

V-chatgpt-social-status-feeds is a robust application designed to generate and manage automated social media status updates using the ChatGPT API. It facilitates user account creation, handles authentication, and enforces API usage limits.

Topics

Resources

License

Stars

Watchers

Forks