#100DaysOfCode Day 70: Steady progress and Unix time

Progress screenshot of weather viewing program.

Progress screenshot of weather viewing program.

Day 70: December 21, 2017 – Time spent, 1 hour

Today’s Progress: Began writing weather data to my weather viewer. Learned about unix time. Committed my code to GitHub.

Thoughts: I felt like I made good progress today. I identified the fields I wished to display in my weather viewer and started coding their display. I have more fields and more formatting to do, but I’m confident I can get it done.

A trip to the Free Code Camp (FCC) Forum helped me decipher the odd sunrise and sunset times provided by the FCC weather API. For example for today 12/21/17 it provided:

*Sunrise: 1513806493 *Sunset: 1513841781

It turns out these values are “unix time”, or the number of seconds since midnight, 1/1/1970. Javascript has a “date” function that might turn these values into something human usable.

Links that helped me get stuff done

  1. Sunrise and sunset calculations for api weather machine – https://forum.freecodecamp.org/t/sunrise-and-sunset-calculations-for-api-weather-machine/151949/3

Link(s) to work

  1. Show the Local Weather – https://www.freecodecamp.org/challenges/show-the-local-weather
Advertisements
Posted in Technology | Tagged | Leave a comment

#100DaysOfCode Day 69 – Weather retrieved, to be formatted

Day 69: December 20, 2017 – Time spent, 1 hour

Today’s Progress: Successfully retrieved and addressed data from the Free Code Camp (FCC) weather API. Got it to work on the geolocation of my laptop.

Thoughts: The first part of the day was frustrating and reminded me of the need to track and triple check all punctuation. I also had to relearn that for the most part, what happens in the function stays in the function. Once I got these two truths out of the way, it was a simple matter to use geolocation to generate latitude and longitude to use in retrieving weather data via a $getJSON request. I’ve satisfied myself that I can reliable address sub-items within the weather data “blob” I get. Now I can move on to which data I want to use and how to display it. Because its an FCC project that directs us to CodePen, I’ll probably be setting one up in the next day or two.

While I’m definitely finding some of the details frustrating, my confidence level in working with APIs is increasing, for which I am grateful.

Link(s) to work

  1. Show the Local Weather – https://www.freecodecamp.org/challenges/show-the-local-weather
Posted in Technology | Tagged | Leave a comment

#100DaysOfCode Day 68: Wandering the coding maze

Day 68: December 19, 2017 – Time spent, 1 hour

Today’s Progress: Kept my patience as I tried different things.

Thoughts: Not much done today. Sort of like a rat in a maze. But better to explore the maze than lie down and give up, right?

First I tried separating out the javascript and css bits into their own files. I kept a copy of my original HTML file that had both elements in that. Then I constructed new files index.html, style.css and script.js. The separated Javascript file did not work, though I was prepared for that as Google called a script within a script. But I couldn’t make that call work within script.js and after Googling the possibilities, I settled on keeping the javascript inside my index.html file. What stumped me more is that although I triple checked my stylesheet link AND could apparently see it working in developer tools, the map would not unless the styles were inside index.html. I’m sure I’m missing something, but for the life of me can’t figure what.

Next I turned my attention to the Free Code Camp (FCC) weather API. It seemed straightforward, but my efforts to use Get JSON seem to break the map. Without the weather API code, it’s fine. Drop in the weather API code and all of a sudden “InitMap()” is no longer a function.

It may be that I bit off more than I can chew. So tomorrow I think I will go back to basics and drop the Google Map for now, even though I’d like to bring it back later.

Link(s) to work

  1. Show the Local Weather – https://www.freecodecamp.org/challenges/show-the-local-weather
Posted in Technology | Tagged | Leave a comment

#100DaysOfCode Day 67: Two Thirds Through and a Map

Day 67: December 18, 2017 – Time spent, 1 hour

Today’s Progress: Figured out how to get geolocation and Google Maps to work together. Started studying the Free Code Camp (FCC) weather API.

Thoughts: Today was mostly tweaking and poking once I found an example of getting Google to take my laptop’s location. Worked at getting the right sized map. Looking at the FCC weather API it looks like it’s got a lot of good fields to play with. I figure I’m going to try and use the sunrise and sunset data in addition to weather conditions. It would be nice to know what their original source is just because I like vetted resources for applications, but this will do for the exercise.

I also have some work to do because the examples I used to generate the Google Map based on geolocation ran script and style tags inside the HTML. I think it would be good practice to transfer these out to their own separate script.js and style.css

Link(s) to work

  1. Show the Local Weather – https://www.freecodecamp.org/challenges/show-the-local-weather
Posted in Technology | Tagged | Leave a comment

#100DaysOfCode Day 66 – Wikipedia done, weather considered.

Day 66: December 17, 2017 – Time spent, 1 hour

Today’s Progress:  Completed Free Code Camp (FCC) Wikipedia Viewer. Started planning for Show Local Weather. Obtained a developer key for the Google Maps API.

Thoughts: I spent about half my time this morning trying to wrap my brain around using autocomplete and how that would affect the code in my working project. I came to the conclusion that this is a “nice to have”, I don’t need it right now. So I submitted my Wikipedia Viewer as a completed project to FCC. I figured that the local weather viewer would be a nice way to continue working with different APIs.

As part of my customization of “Show your local weather”, I intend to display an embedded Google Map so people can tell at a glance if their geolocation has gone wonky. For example, while I live in Juneau Alaska, it is not uncommon for geolocation apps to put me in either Anchorage Alaska or even Seattle Washington. So far I have a basic Google Map, but I haven’t worked out how to pass the latitude and longitude I get from my laptop into Google’s script. But I’m guessing that just means I need a tutorial in HTML5 geolocation.

Links that helped me get stuff done
1. Adding a Google Map with a Marker to Your Website – https://developers.google.com/maps/documentation/javascript/adding-a-google-map

Link(s) to work
1. FCC Show the Local Weather – https://www.freecodecamp.org/challenges/show-the-local-weather

Posted in Technology | Tagged | Leave a comment

#100DaysOfCode Day 65 – More Wikipedia Viewer

Day 65: December 16, 2017 – Time spent, 1 hour

Today’s Progress: Made Wikipedia viewer more presentable. Researched ways to implement autocomplete.

Thoughts: Today was pretty fun. Mostly tweaking my Wikipedia Viewer that I put into a CodePen because that was the preferred format of Free Code Camp (FCC). I spend the last part of my coding time on reading how to get my search form to autocomplete with wikipedia titles. I feel close but not quite. This partly because finding alone focused time is harder to do at my families place than at home.

Links that helped me get stuff done

  1. usa.gov design components: Colors – https://standards.usa.gov/components/colors/
  2. Getting started with jQuery and jQuery UI – Back to Basics – http://www.dotnetcurry.com/jquery/1089/jquery-jqueryui-basic-beginner-tutorial
  3. jQuery UI TextBox AutoComplete with Remote Data Source (Back to Basics) – http://www.dotnetcurry.com/jquery/1129/jqueryui-autocomplete-using-remote-data

Link(s) to work

  1. FCC Wikipedia viewer – https://codepen.io/ddcornwall/pen/aEOwjj
Posted in Technology | Tagged | Leave a comment

#100DaysOfCode Day 64: More Wikipedia Goodness, More Work Ahead

Day 64: December 15, 2017 – Time spent, 1 hour

Today’s Progress: Built an unaesthetic working version of the Free Code Camp (FCC) Wikipedia Viewer.

Thoughts: After considering my coding options and how I’m still stuck on the random quotes machine, I decided to apply my new Wikipedia API skills I picked up on Udacity to the FCC’s Wikipedia Project. Thankfully the skills were transferrable and I have a very basic CodePen that meets the basic use cases. You can search for Wikipedia articles, see a list and get a random article if you want.

Call this version 0.9. It could look better. I’d also like to bring up suggested search terms. So tomorrow will be focused on aesthetics. Once done, improve the functionality a bit more.

Link(s) to work:

  1. FCC Wikipedia Viewer – https://codepen.io/ddcornwall/pen/aEOwjj
Posted in Technology | Tagged | Leave a comment