Giter VIP home page Giter VIP logo

aggregate-exercice's Introduction

aggregate-exercice

Create an aggregation which represent the number of tweet for each minute

What!?

You will have to:

  • read a json file which contains 500 tweets
  • extract date from each tweet
  • Count the number of tweets for each minute
  • Write result in a separate file

Input file

sample/tweets.json

looks like

[
  {
    "id_str": "687345183503994880",
    "text": "We're #hiring! Read about our latest #job opening here: Key Holder - https://t.co/DJUvBlpK7b #ElPaso, TX #CareerArc",
    /* 
      ...
    */
    "timestamp_ms": "1452710836660",
    /* 
      ...
    */
    "created_at": "2016-01-13T18:47:16.660Z"
  },
  /* 
    ...
  */

Use one of the two fields timestamp_ms or created_at to aggregate tweets

Note: tweet with "created_at": "2016-01-13T18:47:16.660Z" Should be aggregate at the previous minute (18:47) Never to the next minute, even if seconds are closer to the next one

18h 46m 16s => 18h46
18h 46m 59s => 18h46
18h 47m 20s => 18h47

Output file

Write your result in result.json

Output file should look like this

[{
  "time": 1453199640000
  "count": 12
},{
  "time": 1453199700000
  "count": 12
}
/* ... */
]
  • time is the timestamp of the previous minute.
  • count is the number of tweet for this minute.

How to submit your solution?

Fork the project, code your solution, then create a Pull Request to provide your solution.

Feel free to code with your favorite language.

aggregate-exercice's People

Contributors

franckernewein avatar

Watchers

 avatar James Cloos avatar

Forkers

dandreit

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.