Code Monkey home page Code Monkey logo

lambda-ig-followers-chart's Introduction

Lambda Instagram Followers Chart

The Serverless Application contains two functions:

  • ScraperFunction (scrapes instagram profile page and saves followers count in DynamoDB table)
  • DrawingFunction (draws the line chart which displays information about followers count over time; saves it on S3 bucket as public available object)

Each of them is scheduled to run once a day and triggered by CloudWatch Event.

Requirements

Local development

You need to have DynamoDB local](https://hub.docker.com/r/amazon/dynamodb-local).

docker run -d -p 8000:8000 amazon/dynamodb-local

SAM local doesn't evaluate CloudFormation conditionals so you must create DynamoDB Tables by yourself:

aws dynamodb create-table \
  --endpoint-url http://localhost:8000 \
  --table-name logs-table \
  --attribute-definitions \
    AttributeName=time,AttributeType=S \
    AttributeName=username,AttributeType=S \
  --key-schema \
    AttributeName=username,KeyType=HASH \
    AttributeName=time,KeyType=RANGE \
  --provisioned-throughput \
    ReadCapacityUnits=1,WriteCapacityUnits=1
aws dynamodb list-tables --endpoint-url http://localhost:8000
make build && sam local invoke ScraperFunction --log-file ./out.log --env-vars env.json --no-event

Makefile

Project contains the Makefile which you could use for several common tasks after customisation.

Deployment

make deploy

Sample graph

Sample graph

lambda-ig-followers-chart's People

Contributors

tradziej avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.