Dagger
Search

twitter

Post a Tweet from your Pipeline

Installation

dagger install github.com/NunoFrRibeiro/daggerverse/twitter@v0.1.1

Entrypoint

Return Type
Twitter !
Arguments
NameTypeDescription
consumerKeySecret !Twitter consumer key
consumerSecretSecret !Twitter consumer secret
oauthTokenSecret !Twitter Oauth token
oauthSecretSecret !Twitter Oauth secret
Example
dagger -m github.com/NunoFrRibeiro/daggerverse/twitter@4fa303bebcf3544dc2428f27141565230ca99885 call \
 --consumer-key env:MYSECRET --consumer-secret env:MYSECRET --oauth-token env:MYSECRET --oauth-secret env:MYSECRET
func (m *myModule) example(consumerKey *Secret, consumerSecret *Secret, oauthToken *Secret, oauthSecret *Secret) *Twitter  {
	return dag.
			Twitter(consumerKey, consumerSecret, oauthToken, oauthSecret)
}
@function
def example(consumer_key: dagger.Secret, consumer_secret: dagger.Secret, oauth_token: dagger.Secret, oauth_secret: dagger.Secret) -> dag.Twitter:
	return (
		dag.twitter(consumer_key, consumer_secret, oauth_token, oauth_secret)
	)
@func()
example(consumerKey: Secret, consumerSecret: Secret, oauthToken: Secret, oauthSecret: Secret): Twitter {
	return dag
		.twitter(consumerKey, consumerSecret, oauthToken, oauthSecret)
}

Types

Twitter 🔗

sendTweet() 🔗

Creates a post to Twitter/X

example usage from the CLI ex.: dagger call –oauth-token env: –oauth-secret env: send-tweet –text “Example text”

Return Type
String !
Arguments
NameTypeDefault ValueDescription
textString -Message you want to tweet
directMessageLinkString -Tweets a link directly to a Direct Message conversation with an account Example: "https://twitter.com/messages/compose?recipient_id=2244994945"
superUserOnlyBoolean -Allows you to Tweet exclusively for Super Followers
geoPlaceIdString -Place ID being attached to the Tweet for geo location
mediaIds[String ! ] -A list of Media IDs being attached to the Tweet
taggedUserIdString -A list of User IDs being tagged in the Tweet with Media. If the user you're tagging doesn't have photo-tagging enabled, their names won't show up in the list of tagged users even though the Tweet is successfully created
pollOptions[String ! ] -A list of poll options for a Tweet with a poll
pollDurationMinutesInteger -Duration of the poll in minutes for a Tweet with a poll
quotedTweetIdString -Link to the Tweet being quoted
excludedUsersIdsReply[String ! ] -A list of User IDs to be excluded from the reply Tweet thus removing a user from a thread
inReplytoTweetIdString -Tweet ID of the Tweet being replied to
repplySettingsString -Settings to indicate who can reply to the Tweet. Options include "mentionedUsers" and "following". If the field isn’t specified, it will default to everyone
Example
dagger -m github.com/NunoFrRibeiro/daggerverse/twitter@4fa303bebcf3544dc2428f27141565230ca99885 call \
 --consumer-key env:MYSECRET --consumer-secret env:MYSECRET --oauth-token env:MYSECRET --oauth-secret env:MYSECRET send-tweet
func (m *myModule) example(ctx context.Context, consumerKey *Secret, consumerSecret *Secret, oauthToken *Secret, oauthSecret *Secret) string  {
	return dag.
			Twitter(consumerKey, consumerSecret, oauthToken, oauthSecret).
			SendTweet(ctx)
}
@function
async def example(consumer_key: dagger.Secret, consumer_secret: dagger.Secret, oauth_token: dagger.Secret, oauth_secret: dagger.Secret) -> str:
	return await (
		dag.twitter(consumer_key, consumer_secret, oauth_token, oauth_secret)
		.send_tweet()
	)
@func()
async example(consumerKey: Secret, consumerSecret: Secret, oauthToken: Secret, oauthSecret: Secret): Promise<string> {
	return dag
		.twitter(consumerKey, consumerSecret, oauthToken, oauthSecret)
		.sendTweet()
}

deleteTweet() 🔗

Delete a Tweet with a tweetID

example usage from the CLI ex.: dagger call –oauth-token env: –oauth-secret env: delete-tweet –tweet-id “123456789”

Return Type
Boolean !
Arguments
NameTypeDefault ValueDescription
tweetIdString !-The Tweet ID you are deleting
Example
dagger -m github.com/NunoFrRibeiro/daggerverse/twitter@4fa303bebcf3544dc2428f27141565230ca99885 call \
 --consumer-key env:MYSECRET --consumer-secret env:MYSECRET --oauth-token env:MYSECRET --oauth-secret env:MYSECRET delete-tweet --tweet-id string
func (m *myModule) example(ctx context.Context, consumerKey *Secret, consumerSecret *Secret, oauthToken *Secret, oauthSecret *Secret, tweetId string) bool  {
	return dag.
			Twitter(consumerKey, consumerSecret, oauthToken, oauthSecret).
			DeleteTweet(ctx, tweetId)
}
@function
async def example(consumer_key: dagger.Secret, consumer_secret: dagger.Secret, oauth_token: dagger.Secret, oauth_secret: dagger.Secret, tweet_id: str) -> bool:
	return await (
		dag.twitter(consumer_key, consumer_secret, oauth_token, oauth_secret)
		.delete_tweet(tweet_id)
	)
@func()
async example(consumerKey: Secret, consumerSecret: Secret, oauthToken: Secret, oauthSecret: Secret, tweetId: string): Promise<boolean> {
	return dag
		.twitter(consumerKey, consumerSecret, oauthToken, oauthSecret)
		.deleteTweet(tweetId)
}