Twitter AI Monitor: Automated Tweet Summaries and Chinese Translation

10月3日 Published inAI Tools

Twitter AI Monitor tracks tweets from the specific accounts you follow. By leveraging large language models, the tool translates posts into Chinese and generates a headline and a brief summary for each. It also performs automated content analysis. Users can observe the system in real time, manage the list of followed accounts, and configure the polling frequency for new updates. Integrated DingTalk bots deliver urgent updates directly to your team. The system is designed to store data, filter out duplicates, and manage storage through automated cleanup. It supports connections to various AI model APIs. For those who need to stay informed about Twitter activity within a specific industry without spending the day scrolling, this tool handles the heavy lifting.

What It Does

Smart Monitoring Select the Twitter handles you wish to track. The system captures new tweets as they are posted, eliminating the need for manual refreshes.

AI Processing The tool interfaces with a large language model to translate tweets into Chinese, generate relevant headlines, and distill the core message. This allows you to focus on the essential information rather than the raw feed.

DingTalk Alerts By connecting a DingTalk bot, important tweets are sent instantly to a designated group chat. This ensures you remain informed without having to open the Twitter app.

Web Dashboard A streamlined web interface displays the system status and all captured tweets. You can log in, review the feed at a glance, and prioritize the updates that matter.

Data Handling Tweets are saved automatically, while a filtering mechanism removes duplicate entries. The system also purges old data to maintain a lean storage footprint.

Adjustable Frequency You can define how often the system polls for new tweets. This allows for a balance between catching news quickly and staying within API rate limits.

Getting Started

Deployment requires Python 3.8 or newer and an internet connection capable of reaching both the Twitter API and your chosen LLM endpoint.

1. Clone the Repository

git clone https://github.com/your-username/twitter-ai-monitor.git
cd twitter-ai-monitor

2. Install Dependencies

pip3 install -r requirements.txt

3. Launch the Application

python3 start.py

First Login and Setup

The initial run generates a default administrator account. The username is admin. The password will be displayed in the console and saved to data/default_password.txt.

Once the Flask application is running, navigate to http://localhost:5000 and log in. Proceed to the settings page to complete the configuration:

Twitter API Key: Obtain a key from TwitterAPI.io and enter it into the settings.

LLM Configuration: Provide the base URL and API key for your chosen model. While the default is set to Alibaba's Qwen (https://dashscope.aliyuncs.com/compatible-mode/v1), any OpenAI-compatible endpoint is supported.

DingTalk Bot (Optional): Enable "DingTalk Bot Push" and provide the webhook URL and signing secret from your DingTalk group bot settings. Use the "Test DingTalk Push" button to verify the connection.

Monitored Accounts: List the Twitter handles you want to track, separated by commas (e.g., realDonaldTrump, trumpchinese1). Set the "Check Interval" in seconds; 300 seconds (5 minutes) is recommended to stay within API limits. Use "Initial Lookback Hours" to retrieve recent tweets upon startup.

Click "Start Monitoring" to begin the tracking process.

How Data Moves

The Twitter API retrieves raw tweets, which the AI Monitor module then passes to the LLM service for translation and summarization. The processed data is committed to storage. If configured, the DingTalk bot sends a notification, and the entire history is accessible via the web interface.

Supporting Components: The Data Cleaner manages duplicate removal, the Status Monitor tracks system health, and the Auth System secures logins. All user accounts and session data are stored in a SQLite database.

Advanced Controls

User Management The manage_users.py script allows for direct management of the SQLite database.

  • List all users: python manage_users.py list
  • Change admin password: python manage_users.py change-password admin newpassword123
  • Add a new user: python manage_users.py add user1 password123
  • Delete a user: python manage_users.py delete user1

Tuning the Monitor You can update monitored handles directly through the web UI without modifying code. Adjust the check interval for near-real-time updates, or increase the interval to conserve system resources.

Use Cases

AI Researchers Monitor official accounts from organizations like OpenAI, Google, and Meta to catch product announcements and research paper releases the moment they happen.

Tech Bloggers Follow industry influencers. The AI-generated translations and summaries provide ready-made material for Chinese-language tech reporting.

Investment Analysis Track financial news and corporate accounts to receive rapid summaries of earnings reports, product launches, and market trends.

Content Creators Focus on accounts dedicated to science, culture, or education. The system provides Chinese summaries, allowing you to spend less time on translation and more time on content production.