Post a Tweet from your Pipeline
Installation
dagger install github.com/NunoFrRibeiro/daggerverse/twitter@v0.1.0
Entrypoint
Return Type
Twitter !
Arguments
Name | Type | Description |
---|---|---|
consumerKey | Secret ! | Twitter consumer key |
consumerSecret | Secret ! | Twitter consumer secret |
oauthToken | Secret ! | Twitter Oauth token |
oauthSecret | Secret ! | Twitter Oauth secret |
Example
dagger -m github.com/NunoFrRibeiro/daggerverse/twitter@f5eb1bc30c4e0bf22250ee1889944edbe7cf1b83 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
Name | Type | Default Value | Description |
---|---|---|---|
text | String | - | Message you want to tweet |
directMessageLink | String | - | Tweets a link directly to a Direct Message conversation with an account Example: "https://twitter.com/messages/compose?recipient_id=2244994945" |
superUserOnly | Boolean | - | Allows you to Tweet exclusively for Super Followers |
geoPlaceId | String | - | Place ID being attached to the Tweet for geo location |
mediaIds | [String ! ] | - | A list of Media IDs being attached to the Tweet |
taggedUserId | String | - | 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 |
pollDurationMinutes | Integer | - | Duration of the poll in minutes for a Tweet with a poll |
quotedTweetId | String | - | 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 |
inReplytoTweetId | String | - | Tweet ID of the Tweet being replied to |
repplySettings | String | - | 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@f5eb1bc30c4e0bf22250ee1889944edbe7cf1b83 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
Name | Type | Default Value | Description |
---|---|---|---|
tweetId | String ! | - | The Tweet ID you are deleting |
Example
dagger -m github.com/NunoFrRibeiro/daggerverse/twitter@f5eb1bc30c4e0bf22250ee1889944edbe7cf1b83 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)
}