Skip to content

JimLiu/baoyu-skills / skills/baoyu-danger-x-to-markdown

baoyu-danger-x-to-markdown

Verified

Converts X (Twitter) tweets and articles to markdown with YAML front matter. Uses reverse-engineered API requiring user consent. Use when user mentions "X to markdown", "tweet to markdown", "save tweet", or provides x.com/twitter.com URLs for conversion.

scripts/types.ts

View on GitHub
export type CookieLike = {
  name?: string;
  value?: string;
  domain?: string;
  path?: string;
  url?: string;
};

export type ArticleQueryInfo = {
  queryId: string;
  featureSwitches: string[];
  fieldToggles: string[];
  html: string;
};

export type ArticleEntityRange = {
  key?: number;
  offset?: number;
  length?: number;
};

export type ArticleBlock = {
  type?: string;
  text?: string;
  entityRanges?: ArticleEntityRange[];
};

export type ArticleEntityMapMediaItem = {
  mediaId?: string;
  media_id?: string;
  localMediaId?: string;
};

export type ArticleEntityMapEntry = {
  key?: string;
  value?: {
    type?: string;
    mutability?: string;
    data?: {
      caption?: string;
      markdown?: string;
      mediaItems?: ArticleEntityMapMediaItem[];
      url?: string;
      tweetId?: string;
    };
  };
};

export type ArticleContentState = {
  blocks?: ArticleBlock[];
  entityMap?: Record<string, ArticleEntityMapEntry>;
};

export type ArticleMediaInfo = {
  __typename?: string;
  original_img_url?: string;
  preview_image?: {
    original_img_url?: string;
  };
  variants?: Array<{
    content_type?: string;
    url?: string;
    bit_rate?: number;
  }>;
};

export type ArticleMediaEntity = {
  media_id?: string;
  media_info?: ArticleMediaInfo;
};

export type ArticleEntity = {
  title?: string;
  plain_text?: string;
  preview_text?: string;
  content_state?: ArticleContentState;
  cover_media?: {
    media_info?: ArticleMediaInfo;
  };
  media_entities?: ArticleMediaEntity[];
};
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 323kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 323kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 323kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 323kUpdated Claude CodeCodexVerifiedInstall