MediaUse Docs
Plugin Structure
Deep dive into the file structure and configuration of a MediaUse plugin.
Standard Directory Structure
A robust site plugin follows a strict directory convention to ensure compatibility across the platform.
<site>/ # Site folder (e.g., twitter/) manifest.yaml # Core metadata and command tree workflows/ # YAML-based process orchestration search.yaml # Search-related workflows post.yaml # Posting-related workflows scripts/ # Page-side JavaScript logic <site>.site.js # Extraction and helper functions tests/ # Local integration tests
Manifest & Workflow Example
A real-world example of how commands are mapped to workflows and actions.
# manifest.yaml name: "example_site" commands: search: list: workflow: workflows/search.yaml operation: list params: - name: keyword type: string required: true # workflows/search.yaml list: steps: - action: navigate url: "https://www.example.com/search?q={{keyword}}" - action: waitforfunction expression: "!!document.querySelector(".list_item")" - action: evaluate script: "() => window.__mediauseDytt.extractList()"
File Details
Detailed explanation of each file's role:
| File/Dir | Requirement | Description |
|---|---|---|
| manifest.yaml | Mandatory | Declares name, version, auth flow, and command category mapping. |
| workflows/ | Mandatory | Contains YAML files defining browser step sequences (navigate, click, upload). |
| scripts/ | Recommended | Contains JavaScript injected into the page for data extraction (site.js). |
| tests/ | Recommended | Local integration tests to verify plugin stability. |