├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── config
├── env.js
├── jest
│ ├── cssTransform.js
│ └── fileTransform.js
├── paths.js
├── polyfills.js
├── webpack.config.dev.js
├── webpack.config.prod.js
└── webpackDevServer.config.js
├── package-lock.json
├── package.json
├── public
├── favicon.ico
├── index.html
└── manifest.json
├── scripts
├── build.js
├── start.js
└── test.js
└── src
├── App.js
├── details
├── Details.js
├── video
│ └── Video.js
└── wiki
│ └── Wiki.js
├── header
└── Header.js
├── index.css
├── index.js
├── main
├── Main.js
├── input
│ └── Input.js
└── options
│ └── Options.js
├── registerServiceWorker.js
└── results
├── Results.js
└── item
└── ResultItem.js
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .vscode
14 | .DS_Store
15 | .env.local
16 | .env.development.local
17 | .env.test.local
18 | .env.production.local
19 |
20 | npm-debug.log*
21 | yarn-debug.log*
22 | yarn-error.log*
23 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "8"
4 | dist: trusty
5 | sudo: false
6 | git:
7 | depth: 1
8 | cache:
9 | directories:
10 | - "node_modules"
11 | - "$HOME/.npm"
12 | install:
13 | - npm install
14 | script:
15 | - npm run build
16 | notifications:
17 | email:
18 | recipients:
19 | - alexperezdev@gmail.com
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018-present Alex Perez (alxpez)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
WOYE
2 | What's On Your Ears
3 | > Insert plain-text, get information <
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | ## Why?
30 | During my trips, I tend to ask everyone I meet to share their favourite bands/artists... it happens that usually I don't have an Internet connection, and also happens that by the time I go to check out the list of suggestions, people had added stuff in their own way (aka. there's no one single format for the information gathered).
31 |
32 | After some years, I came across one of these lists with hundreds of items, so I decided to build something to help me with the task of sorting all of it.
33 |
34 | And here we are.
35 |
36 | ## What?
37 | Simple. Insert plain text (could be a list of items or a single one) and get information from Wikipedia and the most relevant video from Youtube from each item.
38 |
39 | Originally it was thought for music, but it's usefull for any other kind of information: Movies, plants, animals, places, TV-shows, games, products... even mixed lists of elements.
40 |
41 | ## Roadmap
42 |
43 | - [x] Parse plain text into an array of elements
44 | - [x] Display Wikipedia page (if available)
45 | - [x] Fetch most relevant video from Youtube (based on the searched item)
46 | - [x] Allow delimiters edition/customization (for parsing plain text input)
47 | - [ ] Implement locale selection (for more specific results by country/language)
48 | - [ ] Add category selection (more accurate search when input items from same category)
49 | - [x] Improve user interface and usability (provide more info about WOYE)
50 |
51 | ## Donate
52 |
53 | Do you like what I do?
54 |
55 | I develop projects like this one (checkout [@vuegg](https://github.com/vuegg/vuegg) my other child) on my spare time, after work hours, homie weekends... or during summer holidays like in this case.
56 |
57 | Contribution is the most desirable help always, but for those with no much time in hands that still want contribute somehow...
58 |
59 |
OR
60 |
61 | Your donation will help me to stay awake during those hours I should be sleeping. And make me really happy in general.
62 |
--------------------------------------------------------------------------------
/config/env.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 | const path = require('path');
3 | const paths = require('./paths');
4 |
5 | // Make sure that including paths.js after env.js will read .env variables.
6 | delete require.cache[require.resolve('./paths')];
7 |
8 | const NODE_ENV = process.env.NODE_ENV;
9 | if (!NODE_ENV) {
10 | throw new Error(
11 | 'The NODE_ENV environment variable is required but was not specified.'
12 | );
13 | }
14 |
15 | // https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
16 | var dotenvFiles = [
17 | `${paths.dotenv}.${NODE_ENV}.local`,
18 | `${paths.dotenv}.${NODE_ENV}`,
19 | // Don't include `.env.local` for `test` environment
20 | // since normally you expect tests to produce the same
21 | // results for everyone
22 | NODE_ENV !== 'test' && `${paths.dotenv}.local`,
23 | paths.dotenv,
24 | ].filter(Boolean);
25 |
26 | // Load environment variables from .env* files. Suppress warnings using silent
27 | // if this file is missing. dotenv will never modify any environment variables
28 | // that have already been set. Variable expansion is supported in .env files.
29 | // https://github.com/motdotla/dotenv
30 | // https://github.com/motdotla/dotenv-expand
31 | dotenvFiles.forEach(dotenvFile => {
32 | if (fs.existsSync(dotenvFile)) {
33 | require('dotenv-expand')(
34 | require('dotenv').config({
35 | path: dotenvFile,
36 | })
37 | );
38 | }
39 | });
40 |
41 | // We support resolving modules according to `NODE_PATH`.
42 | // This lets you use absolute paths in imports inside large monorepos:
43 | // https://github.com/facebookincubator/create-react-app/issues/253.
44 | // It works similar to `NODE_PATH` in Node itself:
45 | // https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
46 | // Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
47 | // Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
48 | // https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-265344421
49 | // We also resolve them to make sure all tools using them work consistently.
50 | const appDirectory = fs.realpathSync(process.cwd());
51 | process.env.NODE_PATH = (process.env.NODE_PATH || '')
52 | .split(path.delimiter)
53 | .filter(folder => folder && !path.isAbsolute(folder))
54 | .map(folder => path.resolve(appDirectory, folder))
55 | .join(path.delimiter);
56 |
57 | // Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
58 | // injected into the application via DefinePlugin in Webpack configuration.
59 | const REACT_APP = /^REACT_APP_/i;
60 |
61 | function getClientEnvironment(publicUrl) {
62 | const raw = Object.keys(process.env)
63 | .filter(key => REACT_APP.test(key))
64 | .reduce(
65 | (env, key) => {
66 | env[key] = process.env[key];
67 | return env;
68 | },
69 | {
70 | // Useful for determining whether we’re running in production mode.
71 | // Most importantly, it switches React into the correct mode.
72 | NODE_ENV: process.env.NODE_ENV || 'development',
73 | // Useful for resolving the correct path to static assets in `public`.
74 | // For example,
.
75 | // This should only be used as an escape hatch. Normally you would put
76 | // images into the `src` and `import` them in code to get their paths.
77 | PUBLIC_URL: publicUrl,
78 | }
79 | );
80 | // Stringify all values so we can feed into Webpack DefinePlugin
81 | const stringified = {
82 | 'process.env': Object.keys(raw).reduce((env, key) => {
83 | env[key] = JSON.stringify(raw[key]);
84 | return env;
85 | }, {}),
86 | };
87 |
88 | return { raw, stringified };
89 | }
90 |
91 | module.exports = getClientEnvironment;
92 |
--------------------------------------------------------------------------------
/config/jest/cssTransform.js:
--------------------------------------------------------------------------------
1 | // This is a custom Jest transformer turning style imports into empty objects.
2 | // http://facebook.github.io/jest/docs/en/webpack.html
3 |
4 | module.exports = {
5 | process() {
6 | return 'module.exports = {};';
7 | },
8 | getCacheKey() {
9 | // The output is always the same.
10 | return 'cssTransform';
11 | },
12 | };
13 |
--------------------------------------------------------------------------------
/config/jest/fileTransform.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | // This is a custom Jest transformer turning file imports into filenames.
4 | // http://facebook.github.io/jest/docs/en/webpack.html
5 |
6 | module.exports = {
7 | process(src, filename) {
8 | return `module.exports = ${JSON.stringify(path.basename(filename))};`;
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/config/paths.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const fs = require('fs');
3 | const url = require('url');
4 |
5 | // Make sure any symlinks in the project folder are resolved:
6 | // https://github.com/facebookincubator/create-react-app/issues/637
7 | const appDirectory = fs.realpathSync(process.cwd());
8 | const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
9 |
10 | const envPublicUrl = process.env.PUBLIC_URL;
11 |
12 | function ensureSlash(path, needsSlash) {
13 | const hasSlash = path.endsWith('/');
14 | if (hasSlash && !needsSlash) {
15 | return path.substr(path, path.length - 1);
16 | } else if (!hasSlash && needsSlash) {
17 | return `${path}/`;
18 | } else {
19 | return path;
20 | }
21 | }
22 |
23 | const getPublicUrl = appPackageJson =>
24 | envPublicUrl || require(appPackageJson).homepage;
25 |
26 | // We use `PUBLIC_URL` environment variable or "homepage" field to infer
27 | // "public path" at which the app is served.
28 | // Webpack needs to know it to put the right