Skip to content

Commit

Permalink
refactor code issue #77
Browse files Browse the repository at this point in the history
  • Loading branch information
greybax committed Jun 28, 2019
1 parent 7b78818 commit dc35b74
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 17 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

## Contents

- [Movies](movies.md)
- [Documentary](documentary.md)
- [TV Series](tv_series.md)
- [Movies](/build/movies.md)
- [Documentary](/build/documentary.md)
- [TV Series](/build/tv_series.md)

## Contributing
Your contributions are always welcome! Please take a look at the [contribution guidelines](CONTRIBUTING.md) first.
Expand All @@ -36,4 +36,4 @@ Your contributions are always welcome! Please take a look at the [contribution g
## License
[![CC0](https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/cc-zero.svg)](https://creativecommons.org/publicdomain/zero/1.0/)

To the extent possible under law, [Aleksandr Filatov](https://alfilatov.com) has waived all copyright and related or neighboring rights to this work.
To the extent possible under law, Aleksandr Filatov [https://alfilatov.com](https://alfilatov.com) has waived all copyright and related or neighboring rights to this work.
1 change: 0 additions & 1 deletion documentary.md → build/documentary.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,4 +413,3 @@ Your contributions are always welcome! Please take a look at the [contribution g
[![CC0](https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/cc-zero.svg)](https://creativecommons.org/publicdomain/zero/1.0/)

To the extent possible under law, [Aleksandr Filatov](https://alfilatov.com) has waived all copyright and related or neighboring rights to this work.
this work.
2 changes: 1 addition & 1 deletion movies.md → build/movies.md
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@
### 4.0-4.5

#### Startap
:star:S4.6
:star:4.6

![Startap](assets/startap.jpg)
* Year: 2014
Expand Down
3 changes: 1 addition & 2 deletions tv_series.md → build/tv_series.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@
* Country: USA
* [_IMDb_](https://www.imdb.com/title/tt2575988/)

#### Person of Interest
8.4 :star:
#### Pers8.4

> An ex-assassin and a wealthy programmer save lives via a surveillance AI that sends them the identities of civilians involved in impending crimes. However, the details of the crimes--including the civilians' roles--are left a mystery.
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions markdown_builder/documentary_markdown_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const keys = Object.keys(storage);
require('dotenv').load();

// update documentary_storage.js based on changes from documentary_prebuilt.md
fs.readFile('./prebuild/documentary_prebuilt.md', 'utf8', (err, data) => {
fs.readFile('./documentary_prebuilt.md', 'utf8', (err, data) => {
if (err) {
return console.log(err);
}
Expand All @@ -27,7 +27,7 @@ fs.readFile('./prebuild/documentary_prebuilt.md', 'utf8', (err, data) => {
});

// generate documentary.md
fs.readFile('./prebuild/documentary_prebuilt.md', 'utf8', (err, data) => {
fs.readFile('./documentary_prebuilt.md', 'utf8', (err, data) => {
if (err) {
return console.log(err);
}
Expand All @@ -36,7 +36,7 @@ fs.readFile('./prebuild/documentary_prebuilt.md', 'utf8', (err, data) => {
.get({ id: storage[key] }, { apiKey: process.env.api_key, timeout: 30000 })
.then(movie => {
data = data.toString().replace(key, movie.rating);
fs.writeFile('./documentary.md', data, 'utf8', (err) => {
fs.writeFile('./build/documentary.md', data, 'utf8', (err) => {
if (err) {
return console.log(err);
}
Expand Down
6 changes: 3 additions & 3 deletions markdown_builder/movie_markdown_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const keys = Object.keys(storage);
require('dotenv').load();

// update movies_storage.js based on changes from movies_prebuilt.md
fs.readFile('./prebuild/movies_prebuilt.md', 'utf8', (err, data) => {
fs.readFile('./movies_prebuilt.md', 'utf8', (err, data) => {
if (err) {
return console.log(err);
}
Expand All @@ -28,7 +28,7 @@ fs.readFile('./prebuild/movies_prebuilt.md', 'utf8', (err, data) => {


// generate movies.md
fs.readFile('./prebuild/movies_prebuilt.md', 'utf8', (err, data) => {
fs.readFile('./movies_prebuilt.md', 'utf8', (err, data) => {
if (err) {
return console.log(err);
}
Expand All @@ -38,7 +38,7 @@ fs.readFile('./prebuild/movies_prebuilt.md', 'utf8', (err, data) => {
.get({ id: storage[key] }, { apiKey: process.env.api_key, timeout: 30000 })
.then(movie => {
data = data.toString().replace(key, movie.rating);
fs.writeFile('./movies.md', data, 'utf8', (err) => {
fs.writeFile('./build/movies.md', data, 'utf8', (err) => {
if (err) {
return console.log(err);
}
Expand Down
6 changes: 3 additions & 3 deletions markdown_builder/shows_markdown_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const keys = Object.keys(storage);
require('dotenv').load();

// update shows_storage.js based on changes from tv_series_prebuilt.md
fs.readFile('./prebuild/tv_series_prebuilt.md', 'utf8', (err, data) => {
fs.readFile('./tv_series_prebuilt.md', 'utf8', (err, data) => {
if (err) {
return console.log(err);
}
Expand All @@ -27,7 +27,7 @@ fs.readFile('./prebuild/tv_series_prebuilt.md', 'utf8', (err, data) => {
});

// generate tv_series.md
fs.readFile('./prebuild/tv_series_prebuilt.md', 'utf8', (err, data) => {
fs.readFile('./tv_series_prebuilt.md', 'utf8', (err, data) => {
if (err) {
return console.log(err);
}
Expand All @@ -36,7 +36,7 @@ fs.readFile('./prebuild/tv_series_prebuilt.md', 'utf8', (err, data) => {
.get({ id: storage[key] }, { apiKey: process.env.api_key, timeout: 30000 })
.then(movie => {
data = data.toString().replace(key, movie.rating);
fs.writeFile('./tv_series.md', data, 'utf8', (err) => {
fs.writeFile('./build/tv_series.md', data, 'utf8', (err) => {
if (err) {
return console.log(err);
}
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit dc35b74

Please sign in to comment.