Use a Twitter developer app you've created to send API requests
module.exports = defineComponent({
props: {
twitter_developer_app: {
type: "app",
app: "twitter_developer_app",
}
},
async run({steps, $}) {
const Twit = require('twit')
const { api_key, api_secret_key, access_token, access_token_secret } = this.twitter_developer_app.$auth
const T = new Twit({
consumer_key: api_key,
consumer_secret: api_secret_key,
access_token,
access_token_secret,
timeout_ms: 60 * 1000, // optional HTTP request timeout to apply to all requests.
strictSSL: true, // optional - requires SSL certificates to be valid.
})
return await T.get('account/verify_credentials', { skip_status: true })
},
})
The Filter API is a great way to build powerful workflows that can manipulate
and transform data. Here are some examples of what you can build using the
Filter API:
export default defineComponent({
async run({ steps, $ }) {
let condition = false
if (condition == false) {
$.flow.exit("Ending workflow early because the condition is false")
} else {
$.export("$summary", "Continuing workflow, since condition for ending was not met.")
}
},
})