Skip to content

asimov-modules/asimov-x-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

ASIMOV X Module

Package on Crates.io Documentation

ASIMOV module for importing data from X (Twitter) lists and converting it to JSON-LD format.

✨ Features

  • 🐦 Import List Members: Fetch and convert X list members to JSON-LD
  • πŸ”„ User Profiles: Complete user data including metrics and profile information
  • πŸ”„ JSON-LD Output: Structured data compatible with KNOW ontology
  • ⚑ Fast & Reliable: Built with Rust for performance and safety
  • πŸ“Š Rate Limit Aware: Respects X API limits and provides clear error handling
  • πŸ“Š Flexible Output: Support for both JSON and JSONL formats
  • πŸ”’ Pagination Control: Limit results with --limit option

πŸ› οΈ Prerequisites

  • Rust 1.85+ (2024 edition) if building from source code
  • X (Twitter) developer account with API access
  • X_TOKEN environment variable

⬇️ Installation

Installation from Package Managers

# From Cargo (Rust)
cargo install asimov-x-module

πŸ‘‰ Examples

Import List Members

# Import all list members (default JSONL output)
asimov-x-cataloger "https://x.com/i/lists/1234567890"

# Import first 100 members only
asimov-x-cataloger "https://x.com/i/lists/1234567890" --limit 100

# Output in JSON format instead of JSONL
asimov-x-cataloger "https://x.com/i/lists/1234567890" --limit 100 --output json

Other Commands

# Show version information
asimov-x-cataloger --version

# Show license information
asimov-x-cataloger --license

# Show help
asimov-x-cataloger --help

βš™οΈ Configuration

API Token Setup

Set your X API token as an environment variable:

export X_TOKEN="your-x-api-token-here"

Or use a .env file:

X_TOKEN=your-x-api-token-here

Get your API token from: X Developer Portal

Rate Limiting

⚠️ IMPORTANT: X API has strict rate limits that vary by subscription plan.

Free Plan

  • Maximum users per request: 100 users only
  • Request frequency: 1 request every 15 minutes
  • Error: Returns HTTP 429 if you try within 15-minute window
  • Pagination: Limited to single page (100 users max)

Basic Plan

  • Maximum users per request: 100 users
  • Request frequency: 5 requests per 15 minutes (per user)
  • App-wide limits: 25 requests per 15 minutes (per app)
  • Pagination: Can handle multiple pages with delays

Pro Plan

  • Maximum users per request: 100 users
  • Request frequency: 900 requests per 15 minutes (per user)
  • App-wide limits: 900 requests per 15 minutes (per app)
  • Pagination: Can handle large lists efficiently

Free plan users: Use --limit=100 and wait 15 minutes between requests.

πŸ‘¨β€πŸ’» Development

git clone https://github.com/asimov-modules/asimov-x-module.git
cd asimov-x-module
cargo test
cargo build --bin asimov-x-cataloger

πŸ“Š Output Formats

JSONL (Default)

{"@type":"know:XUser","id":"123","name":"John Doe","username":"johndoe",...}
{"@type":"know:XUser","id":"456","name":"Jane Smith","username":"janesmith",...}

JSON (Structured)

{
  "@context": {...},
  "@id": "https://x.com/i/lists",
  "members": {
    "count": 2,
    "items": [...]
  }
}

πŸ“„ License

This project is licensed under the Unlicense - see the UNLICENSE file for details.

About

🚧 ASIMOV module for importing X (Twitter) list members and converting them to JSON-LD format.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors