Public
Script
1
2
3
4
5
6
7
8
9
10
11
12
13
import { TwitterApi } from "npm:twitter-api-v2";
export async function tweet(text, appKey, appSecret, accessToken, accessSecret) {
const client = new TwitterApi({
appKey,
appSecret,
accessToken,
accessSecret,
});
const { data: createdTweet } = await client.v2.tweet(text);
console.log("Tweet", createdTweet.id, ":", createdTweet.text);
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
January 24, 2024