Skip to content

Instantly share code, notes, and snippets.

@solace
Last active March 4, 2019 04:22
Show Gist options
  • Save solace/a06b73e350aa056471aa6c6b1a192ae6 to your computer and use it in GitHub Desktop.
Save solace/a06b73e350aa056471aa6c6b1a192ae6 to your computer and use it in GitHub Desktop.
Wordpress to Social Media via IFTTT - Messages with Hashtags
type Dict = { [key: string]: number };
const hashtags: Dict = {};
Wordpress.anyNewPostWp.TagsAndCategories.split(',').map(
s => hashtags['#' + s.toLowerCase().replace(/[\s-]+/g, '')] = 1
);
Buffer.addToBuffer.setMessage(
Wordpress.anyNewPostWp.PostTitle + "\n" +
Object.keys(hashtags).join(' ') + "\n" +
Wordpress.anyNewPostWp.PostUrl
);
type Dict = { [key: string]: number };
const hashtags: Dict = {};
Wordpress.anyNewPostWp.TagsAndCategories.split(',').map(
s => hashtags['#' + s.toLowerCase().replace(/[\s-]+/g, '')] = 1
);
FacebookPages.createLinkPage.setLinkUrl(Wordpress.anyNewPostWp.PostUrl);
FacebookPages.createLinkPage.setMessage(
Wordpress.anyNewPostWp.PostTitle + "<br>&nbsp;<br>" +
Object.keys(hashtags).join(' ')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment