Skip to content

jsstrn/bbc-earth-daily

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BBC Earth Daily

BBCEarthDailyBot is a Telegram bot that posts a daily video to the BBCEarthDaily channel on Telegram. The videos are sourced from the BBC Earth YouTube channel.

It uses AWS Lambda to execute the functions and AWS CloudWatch Events for scheduling the events.

Subscribe to the channel to get your daily dose of BBC Earth.

Development

Install all dependencies:

npm install

Tests

Run tests

npm test

Run all tests in watch mode

npm run test:watch

View test coverage report

npm run test:coverage

Deployment

We will bundle all files in the project into bundle.js and then create a zip file app.zip.

Next, we will use AWS CLI to deploy our app.

Build the app

npm run build

Install AWS CLI

brew install aws-cli

Configure AWS CLI

aws configure
AWS Access Key ID [None]: YOURKEYHERE
AWS Secret Access Key [None]: YOURSECRETKEYHERE
Default region name [None]: ap-southeast-1
Default output format [None]: json

You can get your AWS user credentials from the IAM management console.

Learn more about configuring the AWS CLI.

List existing lambda functions

npm run list

Retrieve a specific lambda function

npm run info

Deploy updated code to your lambda function

npm run deploy

Update alias

Get list of versions of a lambda function

npm run versions

Update alias to latest version number

npm run update-alias -- <version-number>

For example, if the latest version is 10, you would execute

npm run update-alias -- 10

Getting help with AWS CLI

aws lambda help

You can read more about using AWS Lambda with AWS CLI.