Queen Of Bot V2
@raymondcamden
code:
data:privatelast updated:1 year ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 200,000+ developers using the Pipedream platform
steps.
trigger
search-twitter
last updated:2 years ago
steps.
check_message
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across invocations with$checkpoint.
async (event, steps) => {
1
2
}
3
if(steps.trigger.event.full_text.indexOf('queen me') === -1) $end('queen me not in tweet');
steps.
gettext
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across invocations with$checkpoint.
async (event, steps) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
}
32
const tracery = require('tracery-grammar');

const grammar = tracery.createGrammar({
		"things":["Shadows","Night","the Sea","the Moon","Stars",
				  "the Sun","Kittens","Fear","Courage","Dancing",
				  "the Internet","Unicorns","Dolphins","Mermaids","Upstairs",
				  "Foxes","Puppies","Chairs","Trees","Plants",
				  "Flowers","Music","Singing","Painting","Song",
				  "Sparkles","Jewels","Intelligence","Smarts","Dragons",
				  "Wolves","Shoes","Bravery","Honesty","Empathy",
				  "Compassion","Wisdon","Knowledge","Cats","Storms",
				  "Lightning","Thunder","Rain","Snow","Clouds",
				  "Wind","the Earth","the Universe","the Galaxy","the Piano",
				  "the Sky","the Land","the Realm","the oceans","cookies",
				  "cakes","pies","macarons","pizza","parties"],
		"role":["Defender","Champion","Scion","Empress","Sorceress",
				"Master","Mistress","Boss","CEO","President",
				"Prime Minister","DJ","Knight","Dame","Duchess",
				"Baroness","Countess","Manager","Singer","Drummer",
				"Muse","Siren","Painter","Crafter","Creator",
				"Accountant","Chancellor","Jedi","Teacher","Jedi Master",
				"Tutor"],
		"origin":["the Queen of #things#, #role# of #things#, and #role# of #things#."]
});

grammar.addModifiers(tracery.baseEngModifiers); 

this.sender = steps.trigger.event.user.screen_name;
this.message = '@' + this.sender + ' You are ' + grammar.flatten('#origin#');
console.log(this.message);
steps.
post_tweet
Post a tweet using your Twitter developer app credentials
auth
(auths.twitter_developer_app)
params
Status

Text of the tweet you'd like to send

string ·params.status
in_reply_to_status_id

The ID of an existing status that the update is in reply to. Note: This parameter will be ignored unless the author of the Tweet this parameter references is mentioned within the status text. Therefore, you must include @username, where username is the author of the referenced Tweet, within the update.

string ·params.in_reply_to_status_id
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
}
16
const Twit = require('twit')

const { api_key, api_secret_key, access_token, access_token_secret } = auths.twitter_developer_app

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.post('statuses/update', { status: params.status, in_reply_to_status_id: params.in_reply_to_status_id })