Installation
dagger install github.com/levlaz/daggerverse/twitter@v0.1.1
Entrypoint
Return Type
Twitter !
Example
dagger -m github.com/levlaz/daggerverse/twitter@921dffc478b87a14690e647c73ae0c20fd9d0543 call \
func (m *myModule) example() *Twitter {
return dag.
Twitter()
}
@function
def example() -> dag.Twitter:
return (
dag.twitter()
)
@func()
example(): Twitter {
return dag
.twitter()
}
Types
Twitter 🔗
tweet() 🔗
Send Tweet
getting this to actually work with auth is a huge PITA, but this comment saves us:https://github.com/Significant-Gravitas/AutoGPT/issues/2194#issuecomment-1513626102
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
text | String ! | - | Tweet content |
consumerKey | Secret ! | - | Twitter Consumer Key |
consumerSecret | Secret ! | - | Twitter Consumer Secret |
authToken | Secret ! | - | Twitter API User Access Token |
authSecret | Secret ! | - | Twitter API User Access Secret |
bearerToken | Secret ! | - | Twitter API Bearer Token |
Example
dagger -m github.com/levlaz/daggerverse/twitter@921dffc478b87a14690e647c73ae0c20fd9d0543 call \
tweet --text string --consumer-key env:MYSECRET --consumer-secret env:MYSECRET --auth-token env:MYSECRET --auth-secret env:MYSECRET --bearer-token env:MYSECRET
func (m *myModule) example(ctx context.Context, text string, consumerKey *Secret, consumerSecret *Secret, authToken *Secret, authSecret *Secret, bearerToken *Secret) string {
return dag.
Twitter().
Tweet(ctx, text, consumerKey, consumerSecret, authToken, authSecret, bearerToken)
}
@function
async def example(text: str, consumer_key: dagger.Secret, consumer_secret: dagger.Secret, auth_token: dagger.Secret, auth_secret: dagger.Secret, bearer_token: dagger.Secret) -> str:
return await (
dag.twitter()
.tweet(text, consumer_key, consumer_secret, auth_token, auth_secret, bearer_token)
)
@func()
async example(text: string, consumerKey: Secret, consumerSecret: Secret, authToken: Secret, authSecret: Secret, bearerToken: Secret): Promise<string> {
return dag
.twitter()
.tweet(text, consumerKey, consumerSecret, authToken, authSecret, bearerToken)
}