yuseisui / twspaces

Fetch Twitter Spaces metadata without your tokens

Home Page:https://npm.im/twspaces

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

twspaces

Fetch Twitter Spaces metadata without your tokens

Warning This package no longer works due to changes in X (formerly Twitter) API.

Install

npm i twspaces

API

findSpaceById(spaceId: string): Promise<AudioSpace>

import { findSpaceById } from "twspaces";

const space = await findSpaceById("<spaceId>");

console.log(space.metadata);

findSpaceByTweetId(tweetId: string): Promise<AudioSpace>

import { findSpaceByTweetId } from "twspaces";

const space = await findSpaceByTweetId("<tweetId>");

console.log(space.metadata);

findSpaceByUrl(url: string): Promise<AudioSpace>

import { findSpaceByUrl } from "twspaces";

const spaceBySpaceUrl = await findSpaceByUrl(
  "https://twitter.com/i/spaces/<spaceId>"
);

const spaceByTweetUrl = await findSpaceByUrl(
  "https://twitter.com/<screenName>/status/<tweetId>"
);

getLiveStreamMetadata(mediaKey: string): Promise<LiveStreamMetadata>

import { findSpaceById, getLiveStreamMetadata } from "twspaces";

const space = await findSpaceById("<spaceId>");

const liveStreamMetadata = await getLiveStreamMetadata(
  space.metadata.media_key
);

console.log(liveStreamMetadata);

License

MIT License

Related

About

Fetch Twitter Spaces metadata without your tokens

https://npm.im/twspaces

License:MIT License


Languages

Language:TypeScript 97.6%Language:JavaScript 2.4%