Skip to content

astavonin/news-bot

Repository files navigation

This is C++ News Bot which is able to collect news from multiple data sources like:

  • Best of day/week/month/year StackOverflow question;
  • ACCU Overload journals update;
  • BOOST library updates;
  • CMake releases.

News Bot will support some extra data sources soon:

  • OpenSSL updates;
  • libCURL updates;
  • Starred items from awesome-cpp.

Compiling

The News Bot is AWS Lambda hosted application and JVM 8 is mandatory for AWS execution. News Bot must be compiled with JVM 8, otherwise AWS Lambda will fail on startup inside nio.

Compile uberjar:

lein uberjar

Upload

Upload new version:

aws s3 cp .\target\uberjar\news-bot.jar s3://cpp-news-bot-singapore

Refresh AWS Lambda:

aws lambda update-function-code --function-name cpp-news-bot-ap-southeast-1 --region ap-southeast-1 --s3-bucket cpp-news-bot-singapore --s3-key news-bot.jar

Run AWS Lambda function once:

aws lambda invoke --invocation-type RequestResponse --function-name cpp-news-bot-ap-southeast-1 --region ap-southeast-1 --log-type Tail --payload '{}' outfile.txt

NOTE: Terraform support is under construction.

Testing

Some pre-configuration is required for local tests execution:

  • _twitter.edn file should contain Twitter credentials as EDN record:
{:AppKey "_APP_KEY_",
 :AppSecret "_APP_SECRET_",
 :UserToken "_USER_TOKEN_",
 :UserTokenSecret "_USER_TOKEN_SECRET_"}
  • LocalStack should be available as Docker image localstack/localstack.
docker-compose up
  • Use Cloverage tool for coverage report generation:
 lein cloverage