Giter VIP home page Giter VIP logo

apiplayaround's Introduction

Task

Register a short-lived token on the fictional Supermetrics Social Network REST API

Fetch the posts of a fictional user on a fictional social platform and process their posts. You will have 1000 posts over a six month period. Show stats on the following: - Average character length of a post / month - Longest post by character length / month - Total posts split by week - Average number of posts per user / month

Design the above to be generic, extendable and easy to maintain by other staff members.

Requiments

  • Docker
  • Makefile support

Launching

To start the app, first go to Makefile and change `HTTP_PORT` to use free port on your machine. It uses `8080` port by default. After making sure, that the port is free, open terminal and CD into project root directory and launch `make init` command (docker is not launched in a background).

If everything went well, all composer dependencies should be downloaded and project should be running, open the browser ant enter http://localhost:8080/ (or any other port if you changed it) press enter and you should see solutions of the task.

Output Explanation

I used laravel framework's helper funcion `dd` for rendering output, since there was no requiment for fancy html. The output is intearctive so you can click on the elements to collapse/ellapse them :)

The initial arrays shows the stats grouped by months, it acts as and index, for example 2020-04 - will hold statistics posts that was created in april 2020. Values inside the array:

Average character length of a post / month - AvgPostLength, rounded to 2 decimal spaces
Longest post by character length / month - LongestPosts - array of longest posts (though there would be high chance that few post might have same length), each element of array is a sub array of the post info which contains Id receivev from api and original message text.
Total posts split by week - WeeklyPosts associative array, which hold data of how many posts was posted during certain week, WeekNumberOfYear => PostsReceived
Average number of posts per user / month - AvgPostsPerUser float rounded to two decimal spaces

apiplayaround's People

Contributors

zilius 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.