REQUIREMENT:
(code test requirement hide for privacy protection)
DESCRIPTION:
- Output format is configurable inside config.php (output_format)
- Formattable JSONFormatter needs to be created in order to support json export
- Class SimplePostExporter is in charge of export Posts with id only.
- In order to support detail output, new class with Exportable interface needs to be created.
USAGE:
[]$ php main.php data/posts.csv
FILES:
.
βββ config.php
βββ data
βΒ Β βββ posts.csv
βββ init.php
βββ main.php
βββ model
βΒ Β βββ CSVFormatter.class.php
βΒ Β βββ Exportable.interface.php
βΒ Β βββ Formattable.interface.php
βΒ Β βββ Post.class.php
βΒ Β βββ PostProcesser.class.php
βΒ Β βββ PostWriter.class.php
βΒ Β βββ SimplePostExporter.class.php
βββ output
βΒ Β βββ daily_top_posts.csv
βΒ Β βββ other_posts.csv
βΒ Β βββ top_posts.csv
βββ README.md
βββ script
βββ test
βββ GeneralTest.php