Skip to content

Instantly share code, notes, and snippets.

@danmindru
Created July 18, 2023 14:47
Show Gist options
  • Save danmindru/a02fe040341a75e5c6d9b964b582227e to your computer and use it in GitHub Desktop.
Save danmindru/a02fe040341a75e5c6d9b964b582227e to your computer and use it in GitHub Desktop.
IFTTT Filter Code for Crontap & Posting tweets
// Parse the Webhook payload.
// NB: Crontap adds API response data under the `data` key.
let payload = JSON.parse(MakerWebhooks.jsonEvent.JsonPayload);
const post = payload.data.posts[0]; // Get the first post. The API returns top 10 posts in this case, and we want to only tweet about the top post.
const link = `https://hunted.space/dashboard/${post.slug}`;
const upvotes = post.votesCount;
const name = post.name;
const tagline = post.tagline;
let tweet = `Have you seen the top product today? 👀
🔥 ${name} (${upvotes} 🔼)
${tagline}
Check the link below for more stats!
${link}`;
Twitter.postNewTweet.setTweet(tweet);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment