GithubHelp home page GithubHelp logo

udacity / ud811 Goto Github PK

View Code? Open in Web Editor NEW
178.0 26.0 437.0 147 KB

Course materials for Udacity's Intro to Progressive Web Apps course at https://www.udacity.com/course/intro-to-progressive-web-apps--ud811

License: MIT License

HTML 5.08% JavaScript 82.99% CSS 10.37% SCSS 1.56%

ud811's People

Contributors

sudkul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ud811's Issues

Weather API access solution

If you're having trouble setting up a proxy server because the firebase API doesn't work, here's another solution (you need chrome to make this work).

  1. Register on https://darksky.net/dev and get an API key
  2. Download the https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en extension to allow CORS requests (only turn it on for your project server - turn it off for other sites or it might cause problems loading content!)
  3. Edit the app.getForecast function in your app.js file as follows, inserting your API key from step 2:
app.getForecast = function(key, label) {
    var cityToLatLon = {
      'austin': '30.3079823,-97.8938293',
      'boston': '42.313479,-71.1273685',
      'chicago': '41.8339032,-87.8725822',
      'bangalore': '12.9539598,77.4905096',
      'buenosaires': '-34.6158036,-58.5035321',
      'capetown': '-33.9137107,18.0942365',
      'london': '51.5285578,-0.2420244',
      'mcmurdo': '-77.8401137,166.6441437',
      'newyork': '40.7128,-74.0059',
      'portland': '45.5425909,-122.7948484',
      'sanfrancisco': '37.7578149,-122.5078116',
      'seattle': '47.6149938,-122.4763319',
      'sydney': '-33.7966053,150.6415579',
      'tokyo': '35.6732615,139.5699601'
    };
    var cityCoords = cityToLatLon[key];
    var url = 'https://api.forecast.io/forecast/INSERT_YOUR_API_KEY_HERE/' + cityCoords;
    // Make the XHR to get the data, then update the card
    var request = new XMLHttpRequest();
    request.onreadystatechange = function() {
      if (request.readyState === XMLHttpRequest.DONE) {
        if (request.status === 200) {
          var response = JSON.parse(request.response);
          response.key = key;
          response.label = label;
          app.updateForecastCard(response);
        }
      }
    };
    request.open('GET', url);
    request.send();
  };


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.