Sample application for Amazon Polly. Allows to convert any blog into an audio podcast.
This app allows you to easily convert any publicly available RSS content into audio Podcasts, so you can listen to your favorite blogs on mobile devices instead of reading them.
You will need an AWS account and an RSS feed. Some technical experience is required to setup your own instance of the app, but you don't have to write any code. Once setup, it can be used by anyone using a standard Podcast player.
Go to the bucket properties->Permissions->Add bucket policy and paste the following policy:
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*"
}]}
Make sure to substitute YOUR_BUCKET_NAME with an arbitrary name, keeping in mind that it has to be globally unique. Save the policy.
Expand the "Static Website Hosting" section in the bucket properties, choose "Enable website hosting", type "podcast.xml" in the "Index Document" field, and save the settings.
In the newly opened tab, change "IAM Role" to "Create a new IAM Role", and choose an arbitrary name for the role.
Expand "View Policy Document", click the "Edit" link, and paste the following content into the text area:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"polly:SynthesizeSpeech",
"s3:ListBucket",
"s3:PutObject"
],
"Resource": "*"
}
]
}
Click the "Allow" button at the bottom of the page, which will close the tab and get you back to the Lambda function settings.
Click "Test" at the top of the page.
Use the following JSON document as test even input:
{
"rss": "http://feeds.feedburner.com/AmazonWebServicesBlog",
"bucket": "YOUR_BUCKET_NAME"
}
Make sure to substitute YOUR_BUCKET_NAME, and feel free to change rss into any RSS URL.
Click "Save and test" and wait until the function is finished. Keep in mind that it may take a while to retrieve, convert and store the content.
Go back to your newly created S3 bucket to see if it contains any new content.
Go to "Events" and click "Create rule".
Select "Schedule" in "Event selector".
In the "Targets" section, choose "Lambda function", and then choose the newly created function. Expand "Configure input", choose "Constant (JSON text)", use the following JSON document:
{
"rss": "http://feeds.feedburner.com/AmazonWebServicesBlog",
"bucket": "YOUR_BUCKET_NAME"
}
That's the same JSON that you used before, to test your function (unless you were brave enough to skip that step). Again, make sure to substitute YOUR_BUCKET_NAME and choose your favorite RSS URL.
That's it! Your podcast is ready. Use it on your own, or share the URL with your friends. Optionally publish it as an audio version of your own blog (if you are the content owner).