app icon
X (formerly Twitter)
0.0.1

Post, delete tweets and perform other operations via X API

stvlynn/x750 installs

X (formerly Twitter) Dify Plugin

Author: Steven Lynn
Version: 0.0.1
Type: tool

Description

This plugin allows you to interact with the X (formerly Twitter) platform through their official API.

It provides tools to send and delete tweets.

Features

  • Post Tweet: Send tweets to your X account and receive the tweet ID in response
  • Delete Tweet: Delete tweets by their ID
  • Post Media Tweet: Send tweets with media attachments (images or videos)

Setup

  1. Create a developer account at X Developer Portal
  2. Create a project and app to obtain your API keys:
    • Go to the Developer Portal Dashboard
    • Click "Create Project" and follow the steps
    • Within your project, create an app to get your API keys and tokens
    • Navigate to the "Keys and tokens" section to find your Consumer Keys (API Key and Secret)
  3. Set up authentication:
    • Clone this repository to your local machine:
    • Edit the file and fill in your Consumer Key and Secret
    • Run the authentication script:
    • The script will provide an authorization URL. Open it in your browser
    • Authorize your application and enter the verification code when prompted
    • The script will output your ACCESS_TOKEN and ACCESS_TOKEN_SECRET
  4. Configure the plugin in Dify:
    • Install the X Plugin from the Dify Marketplace
    • In the plugin settings, enter the following credentials:
      • API Key: Your X API Key (Consumer Key)
      • API Secret: Your X API Secret (Consumer Secret)
      • Access Token: OAuth 1.0a Access Token generated from auth.py
      • Access Token Secret: OAuth 1.0a Access Token Secret generated from auth.py

Authentication Notes

  • All credentials are stored securely and used only for authenticating with the X API
  • You need Read and Write permissions for your app to post and delete tweets
  • To verify your credentials are working, the plugin will make a test API call to the X API

Usage

Posting a Tweet

Response:

Deleting a Tweet

Response:

Posting a Media Tweet

This action allows you to upload and attach media (images or videos) to your tweets.

Parameters:

  • : The text content of your tweet (max 280 characters)
  • : The media file to attach (image or video)

Supported media formats:

  • Images: JPEG, PNG, GIF
  • Videos: MP4 (H.264 codec recommended)

Note: Videos may take longer to process on X platform before the tweet is published.

Response:

Feedback and Issues

If you encounter any problems or have suggestions for improvements:

  1. Please open an issue in the plugin's GitHub repository

  2. Provide details about your problem, including error messages and steps to reproduce

  3. Do not submit issues to the main Dify repository for plugin-specific problems

License

MIT

CATEGORY
Tool
VERSION
0.0.1
stvlynn·04/15/2025 11:28 AM
REQUIREMENTS
Maximum memory
256MB