You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've done a little research and came up with this pseudo(javascript)code to use with GitHub Webhooks. It only includes Twitter status updates because AFAIK Instagram does not have a public API to allow posting images. I can build a fully functional script to run on Amazon Lambda or similar if it is indeed what you guys need.
// const repo = magical GitHub API objectasyncfunctionhandleGithubPushEvent(pushEventData){// See [1] belowconstmasterWantsUsToShare=pushEventData.commits.some(commit=>commit.message.contains('!share'));if(!masterWantsUsToShare){return;}// See [2] belowconsttree=awaitrepo.getTree('/');constlatestCodeDirectory=tree.sortByNameDesc().find(directory=>directory.isCodeDirectory);// See [3] belowconstmeta=await.repo.getFile(latestCodeDirectory.path+'/meta.json');constimage=await.repo.getFile(latestCodeDirectory.path+'/screenshot.png');// See [4] belowconstmediaID=awaittwitterAPI.uploadMedia(image);// See [5] belowawaittwitterAPI.postTweet({tweet: meta.tweet,media: mediaID,});}
Note on Instagram: There are private API implementations around but I don't know what risks they might bring up. See for yourself and take your chances if you'd like 😛 https://github.com/huttarichard/instagram-private-api
Sharing a tip after it has been added should be automated.
The text was updated successfully, but these errors were encountered: