Permalink
Browse files

initial dump, copying all files from nycurl

  • Loading branch information...
omgimanerd committed Jun 28, 2017
0 parents commit 5d2c4777d8182d8b8ee3bf10e10134130253fc15
Showing with 1,299 additions and 0 deletions.
  1. +3 −0 .bowerrc
  2. +4 −0 .gitignore
  3. +12 −0 BUILD.json
  4. +19 −0 LICENSE
  5. +63 −0 README.md
  6. +26 −0 bower.json
  7. +273 −0 gulpfile.js
  8. +71 −0 lib/Analytics.js
  9. +204 −0 lib/ApiAccessor.js
  10. +149 −0 lib/DataFormatter.js
  11. +1 −0 logs/README.md
  12. +35 −0 package.json
  13. +42 −0 public/css/analytics.css
  14. +106 −0 public/css/index.css
  15. BIN public/images/favicon.ico
  16. +34 −0 public/js/analytics.js
  17. +2 −0 robots.txt
  18. +172 −0 server.js
  19. +3 −0 todo
  20. +21 −0 views/analytics.pug
  21. +59 −0 views/index.pug
@@ -0,0 +1,3 @@
{
"directory": "public/bower"
}
@@ -0,0 +1,4 @@
/node_modules
/public/bower
*.log
setup
@@ -0,0 +1,12 @@
{
"GULPFILE_VERSION": "3.2.1",
"DEFAULT_TASKS": ["js-lint"],
"JS_LINT_RULES": [
{
"name": "server side javascript",
"sourceFiles": [
"./lib/**/*.js"
]
}
]
}
19 LICENSE
@@ -0,0 +1,19 @@
Copyright 2017 Alvin Lin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,63 @@
# getnews.tech
This is a web server that formats the latest news from various sources on
the web. A link to each article is included if the user wants to read the full
article.
## Usage
You can fetch the latest news simply by typing
```bash
curl getnews.tech
```
This application also accepts queries to the various sections of the NY Times.
```bash
curl getnews.tech/technology
curl getnews.tech/politics
```
Get a list of acceptable sections to query using:
```bash
curl getnews.tech/help
```
By default, getnews.tech will format the table to be a max of 72 characters
wide. If you would like to specify a custom width for your terminal, you do so
using:
```bash
curl getnews.tech?w=92
curl getnews.tech/technology?w=100
```
You can also limit the number of articles to display.
```bash
curl getnews.tech?n=10
curl getnews.tech?n=12\&w=95
```
Note that when combining the parameters on the command line as query parameters,
you must use `\&` to escape the ampersand character.
## Contributing
Fork this repository and send me a pull request with any suggestions and
changes. Use two-space indents and camel-cased variables.
You will need to acquire an API Key from the [News API](https://newsapi.org/)
and a URL Shortener API Key from
[Google Developers](https://console.developers.google.com).
Add them to your .bashrc or other environment variable configuration:
```bash
export NEWS_API_KEY=YOUR_KEY_HERE
export URL_SHORTENER_API_KEY=YOUR_KEY_HERE
```
Install the project dependencies:
```
npm install
bower install
```
Run the server in development node:
```
node server.js --dev
```
**IF YOU DON'T USE DEV MODE, YOU WON'T BE ABLE TO GET IT WORKING**
## License
[MIT](https://github.com/omgimanerd/getnews.tech/blob/master/LICENSE)
@@ -0,0 +1,26 @@
{
"name": "getnews.tech",
"description": "A web server that fetches data from the New York Times and formats it for display in the terminal.",
"main": "server.js",
"authors": [
"Alvin Lin (alvin@omgimanerd.tech)"
],
"license": "MIT",
"homepage": "https://github.com/omgimanerd/getnews.tech",
"moduleType": [],
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"public/bower",
"test",
"tests"
],
"dependencies": {
"ubuntu-font": "*",
"jquery": "^3.1.1",
"chartist": "^0.11.0",
"moment": "^2.18.1"
}
}
Oops, something went wrong.

0 comments on commit 5d2c477

Please sign in to comment.