1 00:00:00,570 --> 00:00:06,570 So we're going to put to test what we have learned so far about lists how to iterate through and display 2 00:00:06,840 --> 00:00:13,280 things or display data into list or table views as they're called in UI kit. 3 00:00:13,290 --> 00:00:14,850 So this is what we the new building. 4 00:00:14,850 --> 00:00:17,030 It's what I call quakes app. 5 00:00:17,040 --> 00:00:23,850 So what this app does is goes and fetches a Jason API remotely somewhere else in the web. 6 00:00:23,850 --> 00:00:27,450 And then we display all this information inside of a list. 7 00:00:27,450 --> 00:00:34,370 So there's quite a few earthquakes that we are getting but you can see the user interface is very simple. 8 00:00:34,390 --> 00:00:38,950 It's a list and we have here a circle that contains a number. 9 00:00:38,950 --> 00:00:46,650 Now this is what a magnitude is which is the unit that is used to measure how severe a certain earthquake 10 00:00:46,650 --> 00:00:47,400 was or not. 11 00:00:47,610 --> 00:00:47,880 OK. 12 00:00:47,910 --> 00:00:50,070 So two point nine is not too bad. 13 00:00:50,070 --> 00:00:55,290 And I think the maximum is about seven point zero which is catastrophic. 14 00:00:55,290 --> 00:00:59,100 But you can see here we have one of five that zeros for a click. 15 00:00:59,280 --> 00:01:05,540 It goes ahead and shows in a map exactly where this quake happened. 16 00:01:05,540 --> 00:01:08,280 So in this case here it happened in Indonesia. 17 00:01:08,280 --> 00:01:10,250 It tells us that we have a view. 18 00:01:10,290 --> 00:01:15,540 First of all we have a map of view showing it very nice and we have in our rotation a marker there. 19 00:01:15,540 --> 00:01:22,650 So if you click and this marker notices gets bigger NSA is in a very small font magnitude 5. 20 00:01:23,010 --> 00:01:28,830 But we actually have the same information that top here for each item four for each quake that we click 21 00:01:28,830 --> 00:01:29,250 on. 22 00:01:29,250 --> 00:01:35,090 So this 1 6 5 0 in the information where this happened. 23 00:01:35,160 --> 00:01:35,420 Right. 24 00:01:35,420 --> 00:01:38,100 So go back there pick this one in Japan. 25 00:01:38,160 --> 00:01:41,340 Gonna go and fetch the map in Japan Japan. 26 00:01:41,340 --> 00:01:47,550 You can actually move it as you can see here very nicely and you can click it's hard to see but you 27 00:01:47,550 --> 00:01:50,440 can see there is magnitude magnitude four point seven. 28 00:01:50,450 --> 00:01:53,460 And there's information right there OK. 29 00:01:53,500 --> 00:01:54,880 So keep going back. 30 00:01:54,880 --> 00:01:57,310 We can go ahead and pick the first one again. 31 00:01:57,310 --> 00:02:00,250 I think that's going to be the same one but in a different area. 32 00:02:00,260 --> 00:02:02,690 As you can see so this data is pretty recent. 33 00:02:02,710 --> 00:02:06,630 We're getting this information from the USGS Earthquake USGS at golf. 34 00:02:06,640 --> 00:02:12,540 So this is the Web site a government Web site in United States that has a lot of information about the 35 00:02:12,550 --> 00:02:13,570 earthquake. 36 00:02:13,570 --> 00:02:14,830 So how do we get there. 37 00:02:14,830 --> 00:02:18,220 So if you go to earthquake that U.S. USGS and gov. 38 00:02:18,370 --> 00:02:22,630 Earthquakes and then you have these interfaces Web site here there's a lot of information you can look 39 00:02:22,660 --> 00:02:27,110 but what are you interested in is the data and products so click here. 40 00:02:27,280 --> 00:02:30,820 It's going to take you to this other page here where has real time earthquakes. 41 00:02:30,820 --> 00:02:33,440 Let's go ahead and click this one and see what happens. 42 00:02:33,460 --> 00:02:38,400 He's got all of this information but what we really want to go back is to go to Web services because 43 00:02:38,400 --> 00:02:43,650 a web server allows us to tap into it and get information from their databases. 44 00:02:43,800 --> 00:02:47,870 So click that and that we have here web API eyes. 45 00:02:47,920 --> 00:02:48,820 That's what we need. 46 00:02:48,850 --> 00:02:50,170 So earthquakes. 47 00:02:50,170 --> 00:02:50,830 That's what we want. 48 00:02:50,830 --> 00:02:54,530 There's also another API about geo service geo server. 49 00:02:54,730 --> 00:02:57,900 There's other API is here for geo serve us hazard. 50 00:02:58,030 --> 00:02:59,780 Let's click on the U.S. has or see. 51 00:02:59,900 --> 00:03:05,320 So U.S. hazard here it will give you all this information about the conditions in the regions where 52 00:03:05,320 --> 00:03:08,540 those conditions bad conditions are happening. 53 00:03:08,550 --> 00:03:08,800 All right. 54 00:03:08,830 --> 00:03:12,220 So you can explore all of these different other API. 55 00:03:12,250 --> 00:03:18,090 But what is interesting in the earthquakes it says here earthquakes and real time and catalog. 56 00:03:18,160 --> 00:03:25,690 If you click there we'll take you here and you can see exactly how to use the earthquake in this page 57 00:03:25,690 --> 00:03:31,490 here we'll give you the information that you need to understand how to get the data that you want. 58 00:03:31,510 --> 00:03:34,150 So ultimately I have another tab here. 59 00:03:34,150 --> 00:03:38,710 Ultimately what we need is to get information this information about earthquakes. 60 00:03:38,950 --> 00:03:39,190 OK. 61 00:03:39,220 --> 00:03:41,900 So let's go back here so I can show exactly together. 62 00:03:42,100 --> 00:03:47,380 Once you get there says Please note that automated application to use real time Jason feeds which is 63 00:03:47,380 --> 00:03:48,390 exactly what you want. 64 00:03:48,430 --> 00:03:51,450 Click there and there you go. 65 00:03:51,500 --> 00:03:57,560 This page here gives it another description of this Jason geo Jason and everything but what are we. 66 00:03:57,560 --> 00:04:00,240 You can go ahead and read all this information. 67 00:04:00,500 --> 00:04:03,450 But most importantly it gives us the output of our Jason. 68 00:04:03,470 --> 00:04:05,380 Essentially it's this. 69 00:04:05,390 --> 00:04:05,720 OK. 70 00:04:05,750 --> 00:04:13,070 So it gives us exactly what we expecting a dictionary which all these fields and they're all their types. 71 00:04:13,070 --> 00:04:13,310 All right. 72 00:04:13,310 --> 00:04:21,290 So to do right here there is our feed tab so we have the past hour or so every updated every minute. 73 00:04:21,290 --> 00:04:24,850 So if we go to click here 4.5 or over. 74 00:04:25,010 --> 00:04:27,550 Notice that there is this one in Indonesia. 75 00:04:27,560 --> 00:04:30,840 In fact probably that's the one I just showed you. 76 00:04:30,920 --> 00:04:34,960 It is indeed of 4.5 magnitude. 77 00:04:34,960 --> 00:04:38,630 This has the time which the time when that occurred. 78 00:04:38,630 --> 00:04:41,990 So this time is what we call the UNIX timestamp. 79 00:04:41,990 --> 00:04:43,180 We'll talk about that later. 80 00:04:43,190 --> 00:04:43,390 OK. 81 00:04:43,430 --> 00:04:48,950 We'll have to convert that to a time or a data that we can't actually read and it makes sense and there's 82 00:04:48,950 --> 00:04:51,280 a lot of information here that we can actually get. 83 00:04:51,290 --> 00:04:53,020 But we're interested in the magnitude. 84 00:04:53,020 --> 00:05:00,560 Place the time and maybe the updated time and also the type or also the title but also we're interested 85 00:05:00,650 --> 00:05:01,770 in the coordinates. 86 00:05:01,770 --> 00:05:08,780 So these are the coordinates that we need to actually point on the map where this occurred. 87 00:05:08,780 --> 00:05:09,050 OK. 88 00:05:09,080 --> 00:05:11,470 So this is what we're gonna be using. 89 00:05:11,720 --> 00:05:12,740 Let's go back here. 90 00:05:12,770 --> 00:05:20,860 So depending on what do you want to get you can get the magnitude for that plus every hour per say as 91 00:05:20,860 --> 00:05:22,960 you see there and it's updated every minute. 92 00:05:23,500 --> 00:05:30,620 If you go to at least less than four point four you notice now we have more earthquakes right. 93 00:05:30,700 --> 00:05:38,470 Thank goodness and that just means that earthquakes are happening as not as bad as four or five or seven 94 00:05:38,500 --> 00:05:38,850 even. 95 00:05:39,320 --> 00:05:39,860 OK. 96 00:05:39,970 --> 00:05:47,370 So depending on what you want to do you can go and fetch whichever frequency you want and go back down 97 00:05:47,370 --> 00:05:48,000 here. 98 00:05:48,180 --> 00:05:50,060 You can go and get all earthquakes. 99 00:05:50,100 --> 00:05:54,150 Obviously is going to go getting all earthquakes that have happened in the past hour or so. 100 00:05:54,550 --> 00:05:55,020 OK. 101 00:05:55,110 --> 00:06:02,520 If you want to get the past information you can also go past day past seven days or past 30 days and 102 00:06:02,520 --> 00:06:02,910 so forth. 103 00:06:02,910 --> 00:06:08,550 But what I kind of like this is my preference at this point can change if you need to do so. 104 00:06:08,640 --> 00:06:14,820 I like to get this past hour and this 2.5 OK which is exactly I think is exactly what I have here on 105 00:06:14,820 --> 00:06:15,680 this other side here. 106 00:06:16,230 --> 00:06:18,590 I had this one open here so that I can show you later. 107 00:06:18,600 --> 00:06:19,980 But it's the same thing. 108 00:06:20,010 --> 00:06:26,390 OK nice if you refresh this you will notice that all the information is there. 109 00:06:26,400 --> 00:06:29,750 So every minute this has been refreshed and is showing. 110 00:06:29,750 --> 00:06:35,670 So this API is what is being fetched to populate our application here with all these data. 111 00:06:36,000 --> 00:06:39,200 And you can see here we have the time like I told you. 112 00:06:39,200 --> 00:06:45,600 This is the feel that we're getting the time from and we converting it into something that you can read. 113 00:06:45,630 --> 00:06:47,070 OK all right. 114 00:06:47,090 --> 00:06:49,030 So let's go ahead and get started.