Giter Site home page Giter Site logo

week5-asskitty's Introduction

week5-ASSKITTY

https://asskitty.herokuapp.com/

News: now and then

Compare today to 150 years ago

The modern world moves at a furious pace. It seems that day by day there are so many breaking news items, natural disasters, coup d'etats, revolutions, terrorist attacks, elections, crises...

... that it can feel totally overwhelming to keep up. When these seismic shifts happen in our hyper-connected world, the people on the front line are not journalists from mainstream media organisations. They are people like you and me. Consumers of the news have also become the creators, and they are able to react to things at a rate of pace that is impossible for most formal outlets.

Project Requirements

  • Must call an API and serve frequently changing content
  • Users must be able to search for an input
  • Host on Heroku
  • Employ code coverage and continous implementation

Architecture

Initial ideas File architecture and user flow File flow

Cool learnings

/* eslint-disable */

Resources

Today's Date

New York Times documentation

Set up Heroku in 6 steps

week5-asskitty's People

Contributors

maxgerber avatar ameliejyc avatar astroash avatar

Watchers

James Cloos avatar Jen Spencer avatar

week5-asskitty's Issues

create DOMError function

DOMError function will display a modal that warns the user the date they have selected isn't possible

Server side validation of your input

You need to check that the user is inputting correct info into the input box i.e. a certain number of years (so it should be a number, not a string, etc).

Cool concept!!

Could make a fun app for education purposes as well ๐Ÿ‘

Installation instructions in your README

It would be useful for people who want to run your project locally to have installation instructions, something like...

Installation instructions

  • Clone this repo and cd into it

  • git clone [email protected]:xxxx

  • Run npm install to install all dependencies

Run locally

Tests

  • Run npm test to run the tests

Create XHR request function

Function should make an xhr request to the server with 3 arguments (date, callback)
Date will be passed into the xhr request as a payload.

callback will be called when request is complete (this will be the dom creation)

create buildAPIURL function

buildAPIURL function takes the arguments url, api-key, begin-date, end-date, sort-query)

todays date will use url, api-key, begin-date, sort-query
past date will use url, api-key, begin-date, end-date

Function will return a string

Remove commented code

Remove any unnecessary commented code (useful comments are fine!) and console.logs from your code

create dateCheck function

This function will check the id key in object and call createDOM with the right arguments, either (now.object) or (then.object)

createDOM function

This function will take 2 arguments (sectionID, responseObject)
DOM function will populate the DOM with 5 articles.
These will be buttons with a heading/snippet wrapped in the link

Pass args in when you call the function not when you define it

In apiRequest.js, you pass your url and apiKey into buildAPIURL function when you define the function. I'd pass these in when you call the function, so that you keep buildAPIURL generic

e.g.

const buildAPIURL = ( date, apiURL, apiKey ) => {
  return `${apiURL}?api-key=${apiKey}&begin_date=${date}&end_date=${date}&sort=newest`;
}

Create readme

With comprehensive sections on why, what and how.

create extractData function

extractData will take (error,body) as arguments and if there is no error it will extract the following key/value from the JSON:

  • response.docs[0].headline.name
  • response.docs[0].snippet
  • response.docs[0].web_url

function will return 5 of these

will also add a key for id: now/then

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.