X Scraper by Lab3 icon

X Scraper by Lab3

Scrape X Data with Lab3

Overview

This node, named "X Scraper by Lab3," allows users to interact with the social media platform X (formerly Twitter) by performing various operations on tweets and users. Specifically for the Tweet - Create operation, it enables posting new tweets with optional media attachments or replying to existing tweets.

Common scenarios where this node is beneficial include:

  • Automating social media posting workflows.
  • Scheduling tweets with media content.
  • Replying programmatically to specific tweets as part of customer engagement or support automation.

Practical example:

  • A marketing team can use this node to automatically post promotional tweets with images.
  • A bot can reply to user tweets based on certain triggers or events.

Properties

Name Meaning
Text The text content of the tweet to be posted. URLs must be URL-encoded. Links shortened with t.co affect character count.
Options Additional optional fields:
- Media URL URL of media to attach to the tweet (e.g., image or video uploaded previously via a media upload operation).
- Reply to Tweet The tweet to which this new tweet is a reply. Can be specified either by tweet ID or by full tweet URL.

Output

The node outputs an array of JSON objects representing the result of the tweet creation operation. Each output item corresponds to one input item processed.

  • The json field contains the response data from the platform after posting the tweet, typically including details such as tweet ID, text, timestamps, and metadata.
  • If media is attached, the node handles converting the media URL into a buffer internally before posting, but the output remains JSON describing the created tweet.
  • No binary data is output by this node.

Dependencies

  • Requires an API key credential with appropriate authentication tokens and cookies for accessing the X platform.
  • The node depends on an internal scraper library ("Eliza") that manages session cookies and performs actions like posting tweets, liking, retweeting, etc.
  • Proper configuration of credentials with required tokens (guest_id, kdt, twid, ct0, auth_token) is mandatory.
  • No external environment variables are explicitly required beyond the configured credentials.

Troubleshooting

  • Missing Credentials Error: If any required authentication tokens are missing in the credentials, the node will throw an error listing which tokens are absent. Ensure all required tokens are provided.
  • Failed to Initialize Scraper: This error indicates issues creating the internal scraper session, possibly due to invalid or expired credentials.
  • Media URL Issues: If the media URL is invalid or inaccessible, the media attachment may fail silently or cause the tweet post to fail.
  • Reply Tweet ID/URL Parsing: The node extracts the tweet ID from either a direct ID or a URL. Incorrect formats may cause errors.
  • Continue On Fail: If enabled, the node will continue processing subsequent items even if one fails, returning error messages in the output JSON.

Links and References

Discussion