Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Created September 25, 2022 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/ee5671f26177442df06852b452bab5e7 to your computer and use it in GitHub Desktop.
Save Shelob9/ee5671f26177442df06852b452bab5e7 to your computer and use it in GitHub Desktop.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
twitter: {
type: "app",
app: "twitter",
}
},
async run({steps, $}) {
let q = `${encodeURIComponent('from:@josh412 gm -filter:replies')}`;
if( steps.get_last_max_id ){
q = `${q}&max_id=${steps.get_last_max_id}`;
}
q = `${q}&count=100&result_type=mixed`;
//"gm"%20(from%3Ajosh412)%20min_replies%3A1%20min_faves%3A1%20min_retweets%3A1%20-filter%3Areplies
const url = `https://api.twitter.com/1.1/search/tweets.json?q=${q}`;
return await axios($, {
url,
}, {
token: {
key: this.twitter.$auth.oauth_access_token,
secret: this.twitter.$auth.oauth_refresh_token,
},
oauthSignerUri: this.twitter.$auth.oauth_signer_uri,
})
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment