African Objects is a bot on Twitter and Instagram that posts images of African Art. Currently being hosted as an Azure function on a timer trigger to send out a post.
Data is provided by the following API's :
Will look to expand this over time.
Schedule to send out posts are held in PublishSchedule using cron syntax
[FunctionName("PublishSchedule")]
public async Task Run([TimerTrigger("0 */3 * * *")]TimerInfo myTimer, ILogger log)
{
await _tweetservice.StartTweeting();
await _instagramservice.StartGramming();
}
It makes use of environmental variables to store API keys and tokens in Azure this will be stored in the function configuration, but locally it's stored in local.settings.json. You would need to register with these platforms and museums to get keys to use their service.
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"HARVARD_API_KEY": "",
"SMITHSONIAN_API_KEY":"",
"TWITTER_CONSUMER_KEY_SECRET":"",
"TWITTER_CONSUMER_API_KEY":"",
"TWITTER_ACCESS_TOKEN":"",
"TWITTER_ACCESS_TOKEN_SECRET":"",
"INSTAGRAM_USER_ID": "",
"INSTAGRAM_CLIENT_ID": "",
"INSTAGRAM_CLIENT_SECRET": "",
"INSTAGRAM_ACCESS_TOKEN": ""
}
}