1
00:00:08,100 --> 00:00:09,900
Everybody this is Calleigh slopes.

2
00:00:09,910 --> 00:00:14,560
And in this video we're going to start downloading information from the flicker API.

3
00:00:14,770 --> 00:00:20,890
We just got our API key in the last video and we wrote a function that can build us a nice u r l that's

4
00:00:20,890 --> 00:00:23,410
perfect for accessing the API.

5
00:00:23,680 --> 00:00:28,930
But in this video we're going to go ahead and retrieve a list of you or else for all of the photos that

6
00:00:28,930 --> 00:00:30,250
we're going to download.

7
00:00:30,280 --> 00:00:34,710
Then in the next video we're going to write another function to retrieve all of the images.

8
00:00:34,840 --> 00:00:38,380
I want it to separate these two because they're a little beefy and we're going to be diving through

9
00:00:38,380 --> 00:00:43,570
some of the Jason parsing through it and it can get a little intense so I just wanted to separate these

10
00:00:43,570 --> 00:00:45,680
functions into two separate videos.

11
00:00:45,760 --> 00:00:46,970
Let's let's get started.

12
00:00:47,020 --> 00:00:54,400
Pull open that X code project and we're actually going to start by going to our map Visi and we're going

13
00:00:54,400 --> 00:00:58,850
to write two functions one for retrieving all the URLs.

14
00:00:58,850 --> 00:01:00,070
That'll be this video.

15
00:01:00,190 --> 00:01:04,180
And then in the next video we're going to write retrieve images which is going to download all the images

16
00:01:04,180 --> 00:01:06,100
using Alamo fire image.

17
00:01:06,100 --> 00:01:07,150
Very cool.

18
00:01:07,210 --> 00:01:14,020
Let's go ahead and at the very bottom of our class here let's go ahead and write phunk retrieve you

19
00:01:14,190 --> 00:01:19,590
ourselves and we're going to retrieve you or else for an annotation.

20
00:01:19,600 --> 00:01:26,470
Right because we drop an annotation on our map view and when we drop that annotation it has coordinates

21
00:01:26,470 --> 00:01:27,610
and we need to pass those in.

22
00:01:27,610 --> 00:01:31,240
So go ahead and type retrieve yourselves for annotation.

23
00:01:31,360 --> 00:01:37,990
Give it an internal parameter of annotation and that is of type drop a pin our custom annotation.

24
00:01:37,990 --> 00:01:42,910
Now we're also going to use a completion handler because we need to know when we're done loading all

25
00:01:42,910 --> 00:01:49,450
of these you are else to call retrieve images because once that's done once the Yarl's are done then

26
00:01:49,450 --> 00:01:54,500
we need to notify retrieve images that it should start downloading images from those you or else.

27
00:01:54,550 --> 00:01:55,180
OK.

28
00:01:55,270 --> 00:02:02,470
So to make a completion handler just go ahead and type handler and it's going to be of type escaping.

29
00:02:02,810 --> 00:02:07,510
OK that means that the values can escape the ones that we pass into this handler can escape out of this

30
00:02:07,510 --> 00:02:11,710
function and talk to another function in our circumstance.

31
00:02:11,710 --> 00:02:18,670
Now we need to put a function in here because that's how the completion handlers work is that we're

32
00:02:18,670 --> 00:02:24,550
basically going to pass in values to this function and then we can pass that down as soon as it's done

33
00:02:25,000 --> 00:02:27,220
to the next function or the next.

34
00:02:27,220 --> 00:02:28,470
The next thing that we need to do.

35
00:02:28,570 --> 00:02:36,540
So handler escaping and then inside of here we're going to put an underscore status of type bool OK

36
00:02:36,550 --> 00:02:37,680
that's the function.

37
00:02:38,050 --> 00:02:44,680
And then we're going to return an empty and empty parentheses.

38
00:02:44,710 --> 00:02:46,730
So we're not we're not returning anything.

39
00:02:46,870 --> 00:02:53,950
But you'll notice oh it's giving me an error we need to of course put curly brackets and that is our

40
00:02:53,950 --> 00:02:54,420
function.

41
00:02:54,430 --> 00:02:56,290
That's the base of our function.

42
00:02:56,290 --> 00:02:59,380
Now you're wondering why are we putting this underscore here.

43
00:02:59,380 --> 00:03:03,760
Watch what happens if I get rid of it if I try to build it it's going to give me an error and say function

44
00:03:03,760 --> 00:03:06,550
types cannot have argument labels.

45
00:03:06,550 --> 00:03:11,320
So we have to use an underscore because we're not allowed to use the name for whatever reason.

46
00:03:11,650 --> 00:03:14,800
So now here is what we are going to do.

47
00:03:14,800 --> 00:03:19,770
We're going to first set up an array that's going to hold all of the image you are else.

48
00:03:19,930 --> 00:03:24,740
So go up to the top and we are going to create an array.

49
00:03:24,880 --> 00:03:27,280
Let's see where should we put it.

50
00:03:27,340 --> 00:03:32,320
Let's put it down here below the collection 2 and we're going to call it image you Arel array.

51
00:03:32,320 --> 00:03:38,240
So go ahead and create an instance of it called var image you l array.

52
00:03:38,830 --> 00:03:47,080
And that's going to be of an array of type string and we're of course going to instantiate that as an

53
00:03:47,080 --> 00:03:48,760
array of type string.

54
00:03:48,970 --> 00:03:49,530
OK.

55
00:03:49,690 --> 00:03:50,770
Image you are LRA.

56
00:03:50,770 --> 00:03:52,000
Very cool.

57
00:03:52,000 --> 00:03:58,750
Now when we go back to our function here retrieve you or else when we first start we want to close that

58
00:03:58,750 --> 00:03:59,020
out.

59
00:03:59,050 --> 00:04:01,480
We want to clear it out so that it is empty.

60
00:04:01,480 --> 00:04:04,390
So go ahead and type image Oreille and make it empty.

61
00:04:04,390 --> 00:04:10,570
This is because if let's say we downloaded all the images downloaded all the files I mean and then we

62
00:04:10,600 --> 00:04:12,150
double tap to drop a new pin.

63
00:04:12,160 --> 00:04:16,270
Suddenly we would be adding a bunch of your L's on top of the ones we already have.

64
00:04:16,270 --> 00:04:19,000
So we should clear it out every time that we call this.

65
00:04:19,630 --> 00:04:20,220
OK.

66
00:04:20,410 --> 00:04:21,340
Are you ready.

67
00:04:21,340 --> 00:04:27,760
We are about to move on to use Alamo fire to L.A. Fire is how we're going to make a request and pull

68
00:04:27,760 --> 00:04:29,580
down data as Jason.

69
00:04:29,590 --> 00:04:30,960
So follow me here.

70
00:04:31,060 --> 00:04:33,360
We're going to type Alamo fire.

71
00:04:34,000 --> 00:04:36,370
Oh of course we need to import L.A. fire first.

72
00:04:36,370 --> 00:04:37,670
We haven't done that yet.

73
00:04:38,120 --> 00:04:44,430
Import the library Alamo fire in port Alamo fire.

74
00:04:44,440 --> 00:04:49,840
And you know while we're at it go ahead and import Alamo fire image and then scroll back down to where

75
00:04:49,840 --> 00:04:52,840
we were and retrieve you or else.

76
00:04:52,840 --> 00:04:53,280
OK.

77
00:04:53,500 --> 00:04:54,220
Go ahead and type.

78
00:04:54,220 --> 00:04:56,920
Alamo fire dot request.

79
00:04:57,220 --> 00:05:00,210
And we're going to choose the one with you Arel convertible.

80
00:05:00,310 --> 00:05:05,950
Now you are convertible allows us to pass in a string and this is where we're going to pass in our flicker

81
00:05:05,950 --> 00:05:06,810
you are el.

82
00:05:06,900 --> 00:05:13,010
So go ahead and call it flicker Jaro for API key we can pull API keys straight from our Constans file.

83
00:05:13,200 --> 00:05:19,620
The annotation here is going to be of course the annotation from our function and number of photos we're

84
00:05:19,620 --> 00:05:21,460
going to go ahead and let's just do 40.

85
00:05:21,710 --> 00:05:22,610
OK.

86
00:05:23,100 --> 00:05:24,490
So there's that.

87
00:05:24,690 --> 00:05:29,010
Our request has been made but we need to do something with this request.

88
00:05:29,010 --> 00:05:33,280
Now we need to go ahead and see what we're going to get as a response.

89
00:05:33,300 --> 00:05:37,050
So go ahead and type response Jason.

90
00:05:37,160 --> 00:05:37,780
Okay.

91
00:05:38,280 --> 00:05:44,790
And this means that we want the data to be pulled down as Jason data as we saw in the previous video

92
00:05:44,790 --> 00:05:48,680
that's totally possible with the flicker API and so we're going to do it.

93
00:05:48,810 --> 00:05:55,560
So for the completion hndler just press enter and we're basically going to be looking at the response.

94
00:05:55,590 --> 00:06:01,680
So go ahead and type response and this constant is going to hold the value of whatever Jaison we get

95
00:06:01,680 --> 00:06:02,650
back.

96
00:06:02,670 --> 00:06:08,340
So now we need to actually print the response just to see what we get.

97
00:06:08,340 --> 00:06:08,960
All right.

98
00:06:09,220 --> 00:06:12,660
That's that we're going to print the response we're going to see what we get and then we're going to

99
00:06:12,660 --> 00:06:17,280
parse through it so that we can get all of these nice image you are Elle's ready for us.

100
00:06:17,280 --> 00:06:22,310
So let's go ahead and let's call this function from somewhere.

101
00:06:22,380 --> 00:06:27,780
I think the best place we could call it would be from where we drop our pins so let's go to drop pan

102
00:06:28,350 --> 00:06:30,560
Let's go ahead and at the very bottom.

103
00:06:30,570 --> 00:06:36,660
Go ahead and call retrieve or else for annotation past the annotation that we make when we dropped the

104
00:06:36,690 --> 00:06:40,950
pin and for the handler we're going to go ahead and press enter.

105
00:06:40,950 --> 00:06:47,680
And if you saw the status here is a Boolean that means when it's finished we're going to call that.

106
00:06:47,760 --> 00:06:48,600
Okay.

107
00:06:48,600 --> 00:06:49,710
Easy peasy.

108
00:06:49,710 --> 00:06:50,500
And you know what.

109
00:06:50,550 --> 00:06:54,020
At the end why don't we call it so that it just knows that it's done.

110
00:06:54,240 --> 00:06:56,340
And that's when we'll know it's finished.

111
00:06:56,420 --> 00:06:56,980
OK.

112
00:06:57,330 --> 00:06:59,300
So we'll just say true.

113
00:06:59,880 --> 00:07:05,100
And in the code We'll just print or no you know we don't need to do anything actually when this runs

114
00:07:05,100 --> 00:07:07,290
it's just going to go ahead and print the response here.

115
00:07:07,290 --> 00:07:13,710
So let's go ahead and build and run this let's drop a pin and that will allow us to see what is getting

116
00:07:13,710 --> 00:07:18,760
downloaded from the Jason K we're zooming in.

117
00:07:18,890 --> 00:07:26,490
Here we go double click and it looks like hey hey we got a bunch of Jason here.

118
00:07:26,510 --> 00:07:26,870
All right.

119
00:07:26,870 --> 00:07:27,740
Look at that.

120
00:07:27,800 --> 00:07:31,730
We have the page the number of pages the items per page and then look at this.

121
00:07:31,730 --> 00:07:33,760
These are all of our photos here.

122
00:07:33,800 --> 00:07:36,030
There is lots of information here.

123
00:07:36,170 --> 00:07:44,960
So each photo has a farm an ID a property for is family is friend is public an owner a secret a server

124
00:07:44,990 --> 00:07:46,070
and a title.

125
00:07:46,070 --> 00:07:49,030
Lots of information for every single photo.

126
00:07:49,040 --> 00:07:50,640
Now I want to show you something.

127
00:07:50,870 --> 00:07:55,640
If you go to flicker dot com and you view any photo on the site you'll notice something interesting

128
00:07:55,640 --> 00:07:56,560
about the URL.

129
00:07:56,570 --> 00:08:02,750
So let's go ahead and let's go find a photo that we can look at.

130
00:08:02,750 --> 00:08:10,280
Maybe this one here and let's see if I open the link or you know what it's not going to let me access

131
00:08:10,280 --> 00:08:11,480
the photo I don't think.

132
00:08:11,480 --> 00:08:12,930
That's OK though.

133
00:08:13,070 --> 00:08:20,480
Yeah maybe download can download it here and let's download a large size image.

134
00:08:20,780 --> 00:08:24,980
I'm going to copy the link actually and then show you what the link looks like.

135
00:08:24,980 --> 00:08:30,250
Now I want you to notice one thing it says here farm 1.

136
00:08:30,410 --> 00:08:36,890
Do you see how in these photos it says farm five farm five farm five farm five they're all farm five.

137
00:08:36,890 --> 00:08:39,590
This one's farm six farm nine.

138
00:08:39,620 --> 00:08:45,720
That's the way the U R L is structured farm and a number of statics liquor dot com slash.

139
00:08:45,980 --> 00:08:50,260
And then it has a server value for 1 5 6 2 8 2 2.

140
00:08:50,270 --> 00:08:52,850
This one is from server 6 7 9.

141
00:08:52,850 --> 00:08:57,940
Then we have an owner the owner key is right here.

142
00:08:58,170 --> 00:08:58,500
OK.

143
00:08:58,520 --> 00:09:00,180
And that goes here.

144
00:09:00,610 --> 00:09:03,470
We can pass that right there or actually sorry.

145
00:09:03,500 --> 00:09:05,590
That's the idea the first one is the ID.

146
00:09:05,600 --> 00:09:08,340
The second is the secret.

147
00:09:08,540 --> 00:09:09,060
OK.

148
00:09:09,260 --> 00:09:16,960
And finally K. is for a large photo and D goes at the end just as a standard part of how the U R L is

149
00:09:16,970 --> 00:09:17,690
structured.

150
00:09:17,690 --> 00:09:23,930
So as you can see the R L is pretty complicated to parse and that's why I wanted to make this into a

151
00:09:23,930 --> 00:09:25,240
single video.

152
00:09:25,610 --> 00:09:27,020
I hope you can understand that.

153
00:09:27,130 --> 00:09:32,020
But thank you for being patient with it being just in a single video.

154
00:09:32,240 --> 00:09:36,270
So let's go ahead and let's actually look at what we're dealing with here.

155
00:09:36,290 --> 00:09:44,820
We have a dictionary first and foremost and inside that dictionary is another dictionary called photos.

156
00:09:44,840 --> 00:09:45,550
OK.

157
00:09:45,740 --> 00:09:52,180
Then inside of that dictionary there's an array which we can see here with that print to see parentheses.

158
00:09:52,190 --> 00:09:54,670
There's an array of more dictionaries.

159
00:09:54,670 --> 00:09:58,170
OK these are all individual dictionaries for each photo.

160
00:09:58,370 --> 00:10:04,040
So we're going to have to go ahead and parse down through a dictionary which is the Jaison we receive

161
00:10:04,040 --> 00:10:09,250
initially then we're going to cast it as a dictionary and we'll cast that as an array of dictionaries.

162
00:10:09,470 --> 00:10:14,550
OK so let's go do that inside of our Alamo fire function.

163
00:10:14,630 --> 00:10:15,800
We know what the response is.

164
00:10:15,800 --> 00:10:17,120
That is a dictionary.

165
00:10:17,120 --> 00:10:23,240
So let's create a constant called Jason and let's do this safely guard.

166
00:10:23,360 --> 00:10:28,010
Let Jaison equals response.

167
00:10:28,010 --> 00:10:37,810
And in order to get this Jaison information we can type response that result value response that result

168
00:10:39,100 --> 00:10:41,020
value.

169
00:10:41,140 --> 00:10:48,500
And we need to actually cast this as a dictionary of string and any object.

170
00:10:48,880 --> 00:10:54,670
And I can see that each of these values here is a string and the object that can be returned can be

171
00:10:55,270 --> 00:10:56,090
an integer.

172
00:10:56,100 --> 00:11:01,780
Sometimes it can be a string sometimes it could be maybe a decimal place if it had a coordinate.

173
00:11:01,780 --> 00:11:06,550
So we're going to do string and any object to make sure that it's safe at the end of our guard statement

174
00:11:06,550 --> 00:11:06,990
we'll type.

175
00:11:06,990 --> 00:11:07,620
Else.

176
00:11:07,630 --> 00:11:12,160
And then of course we will return if there is a problem.

177
00:11:12,160 --> 00:11:18,850
So now we're going to use this Jasen which is a dictionary of string and any object we're going to use

178
00:11:18,850 --> 00:11:23,160
that in order to get into the photos dictionary.

179
00:11:23,170 --> 00:11:32,690
So let's go ahead and let's type let photos dict for dictionary and make that equal to Jaison.

180
00:11:33,010 --> 00:11:37,770
And if you look the name of that element is called photos.

181
00:11:37,780 --> 00:11:42,870
So we're going to actually type photos and that's going to bring out that dictionary.

182
00:11:42,880 --> 00:11:46,260
Now of course we need to cast it as a dictionary of string

183
00:11:49,260 --> 00:11:51,050
and any object.

184
00:11:51,300 --> 00:11:52,790
And why are we doing that.

185
00:11:52,920 --> 00:11:59,760
Well if you look at the Jason here we can see that Fotos has a little bracket here and inside of this

186
00:11:59,760 --> 00:12:05,290
dictionary there are some keys right and some values.

187
00:12:05,860 --> 00:12:11,940
And for photo photo is the key and the value is an array of a bunch of dictionaries of photos.

188
00:12:11,940 --> 00:12:12,410
OK.

189
00:12:12,630 --> 00:12:15,470
And we're going to get into that in just a moment.

190
00:12:15,510 --> 00:12:22,740
So now we have accessed the photos dictionary and we need to go a little bit deeper it's kind of like

191
00:12:22,740 --> 00:12:29,680
going into different levels of Inception we're going down into the third level of sleep.

192
00:12:29,700 --> 00:12:32,370
Sort of but not nearly as cool.

193
00:12:32,670 --> 00:12:35,630
Actually more cool because it's code and codes cool.

194
00:12:35,670 --> 00:12:37,870
So let's go ahead and do that.

195
00:12:37,890 --> 00:12:44,610
Let Fotos dictionary array because it's an array of photo dictionaries.

196
00:12:44,670 --> 00:12:52,140
We're going to make that equal to photos dict and we're going to pull out the element called photo right

197
00:12:52,440 --> 00:12:55,890
because that's what we see photo is the key and we want the value.

198
00:12:56,100 --> 00:13:02,110
So let's go ahead and call photo from photos dictionary array.

199
00:13:02,520 --> 00:13:11,580
And we're going to cast this as an array of dictionaries that are of type string and any object.

200
00:13:11,580 --> 00:13:12,140
All right.

201
00:13:12,270 --> 00:13:13,520
Easy enough.

202
00:13:13,950 --> 00:13:18,540
Now of course it's telling us that we're not using it yet but we're going to go ahead and cycle through

203
00:13:18,990 --> 00:13:24,680
all of those photos and we're going to generate a u r l based on the information that we have here.

204
00:13:24,690 --> 00:13:32,360
So for photo in photos dict array we're going to use a for loop cycle through all of them.

205
00:13:32,430 --> 00:13:37,640
We're going to first create a post u r l and then we're going to append it to our image you are LRA.

206
00:13:37,950 --> 00:13:42,510
So go ahead and create a constant called Let post you r.

207
00:13:43,020 --> 00:13:46,690
And for this we're actually going to go ahead and use the string.

208
00:13:46,860 --> 00:13:49,140
We're going to look at the L from safari.

209
00:13:49,140 --> 00:13:53,630
We can see it starts with h t s colon backslash backslash.

210
00:13:53,850 --> 00:13:56,120
So let's go ahead and type that.

211
00:13:56,310 --> 00:13:57,270
Great.

212
00:13:57,270 --> 00:14:00,520
Next we have a farm and a number.

213
00:14:00,780 --> 00:14:03,410
So I know that farm can be typed.

214
00:14:03,630 --> 00:14:11,370
But you know what we're going to need to get out the value from photo for the farm so to do that we're

215
00:14:11,370 --> 00:14:13,830
going to use string concatenation.

216
00:14:13,830 --> 00:14:20,940
We're going to call photo because remember that's its own dictionary and we can pull out the value for

217
00:14:20,940 --> 00:14:28,300
one of the keys and the key is farm when we call farm for this one we get a farm of five.

218
00:14:28,590 --> 00:14:33,150
But you know what we actually need to force unwrap this or that we pull out the value successfully.

219
00:14:33,150 --> 00:14:39,480
So for this example we have to slash farm five k.

220
00:14:39,540 --> 00:14:44,200
And after that we can do dot static flicker dotcom.

221
00:14:44,400 --> 00:14:45,690
So let's type that at the end.

222
00:14:45,860 --> 00:14:49,930
Static flicker dot.com slash.

223
00:14:50,190 --> 00:14:53,240
And now what six seven nine.

224
00:14:53,250 --> 00:14:57,640
Now I'm going to give you a clue that is actually the server number.

225
00:14:57,750 --> 00:14:59,870
OK I told you that before but that is what it is.

226
00:14:59,910 --> 00:15:02,670
So to get that we're going to use string concatenation again.

227
00:15:02,760 --> 00:15:04,640
I'm sorry string encapsulation.

228
00:15:04,680 --> 00:15:09,900
I always flip those terms and we're going to go to the photo dictionary and we're going to pull out

229
00:15:09,900 --> 00:15:14,430
the value for server force and wrap it as well.

230
00:15:14,720 --> 00:15:18,920
OK so now we have the value for the server number.

231
00:15:18,960 --> 00:15:22,840
So for this example the server number would be 4 to 1 1.

232
00:15:22,900 --> 00:15:23,270
OK.

233
00:15:23,270 --> 00:15:26,280
Next up we're going to go ahead and pull out the photo ID.

234
00:15:26,280 --> 00:15:28,380
That's like the unique ID of the photo.

235
00:15:28,410 --> 00:15:34,440
So if you look at the you Aurel this last part starts with the ID right here.

236
00:15:34,830 --> 00:15:35,870
OK.

237
00:15:35,880 --> 00:15:43,950
So we're going to go ahead and use string encapsulation again to pull out photo and call the ID parameter

238
00:15:44,790 --> 00:15:46,050
and force unwrap it.

239
00:15:46,290 --> 00:15:47,510
Wonderful.

240
00:15:47,520 --> 00:15:50,720
But you'll notice that right after the ID there's an underscore.

241
00:15:50,890 --> 00:15:51,090
OK.

242
00:15:51,090 --> 00:15:58,290
So let's put that in R U R L and then after that we actually need the secret K and you can see the secret

243
00:15:58,290 --> 00:16:00,030
right there.

244
00:16:00,030 --> 00:16:05,100
So let's do what we've been doing string encapsulation photo whoopsies.

245
00:16:05,450 --> 00:16:11,530
Toe and we're going to pull out secret and force and wrap it.

246
00:16:11,700 --> 00:16:11,930
All right.

247
00:16:11,940 --> 00:16:16,080
After that we're going to go ahead and do underscore K.

248
00:16:16,410 --> 00:16:23,520
Let's do that underscore K underscore d dot jumping and you know what that is r u r l.

249
00:16:23,520 --> 00:16:27,620
That was really messy having to siphon through all of that Jason.

250
00:16:28,110 --> 00:16:34,650
But we now have a post u r l and we know exactly where we can append that image u r l array.

251
00:16:34,650 --> 00:16:35,790
So let's do that.

252
00:16:35,940 --> 00:16:45,060
Go ahead and type self image u r LRA append new element post u r l and that is that.

253
00:16:45,060 --> 00:16:51,190
So once we have cyclic all of this image you are all image you are LRA it will be nice and full.

254
00:16:51,410 --> 00:16:58,010
And at the end of that call we can use our handler to escape to notify us that we're done downloading

255
00:16:58,010 --> 00:16:59,200
all else.

256
00:16:59,270 --> 00:17:10,240
So go ahead and type handler whip's handler and pass in a boolean true so that is done make sure that

257
00:17:10,240 --> 00:17:11,740
you study this and go through it.

258
00:17:11,920 --> 00:17:16,840
If you already have experience with Jaison this might be quite easy for you but if not it might take

259
00:17:16,840 --> 00:17:19,180
a while to understand what's really going on here.

260
00:17:19,420 --> 00:17:23,500
But let's go back up to where we call this function in dropped.

261
00:17:23,830 --> 00:17:28,210
And I'm actually going to print out the image you are LRA so you can see all the imagery or else that

262
00:17:28,210 --> 00:17:29,410
we've just made.

263
00:17:29,410 --> 00:17:34,320
So go ahead and type print image you are LRA and let's build and run this app.

264
00:17:34,630 --> 00:17:41,050
Oh whoops of course we need to make a reference to self because we're inside of a closure here and retrieve

265
00:17:41,050 --> 00:17:48,280
you or else build and run and we're going to see if this worked if our your L's are being properly downloaded

266
00:17:48,280 --> 00:17:51,290
and pulled out from our Jason File.

267
00:17:51,310 --> 00:17:55,590
So go ahead and double click and look at that.

268
00:17:55,590 --> 00:17:56,720
That looks pretty good.

269
00:17:56,730 --> 00:18:01,740
Let's see farm five static flicker dot com slash for two on one.

270
00:18:01,740 --> 00:18:08,640
There's the secret Cady to double check that this worked and actually copy one of these into my browser

271
00:18:09,480 --> 00:18:10,940
and see if it worked.

272
00:18:12,590 --> 00:18:15,460
Kate says this photo is no longer available.

273
00:18:15,470 --> 00:18:17,410
So that means we did something wrong.

274
00:18:17,570 --> 00:18:20,960
Let's see if we can figure out what the issue was.

275
00:18:20,960 --> 00:18:27,540
Or alternatively that image may actually just be deleted or not available.

276
00:18:27,830 --> 00:18:28,850
OK so that's not good.

277
00:18:28,850 --> 00:18:38,190
It's telling us that there is a problem farm five static flicker dot com slash server slash ID secret.

278
00:18:38,200 --> 00:18:38,810
OK.

279
00:18:38,870 --> 00:18:47,030
So let's go back to that photo we had of our gorilla friend and let's see whoopsies Let's see what the

280
00:18:47,070 --> 00:18:52,420
your L was when we copied the link pasted it here.

281
00:18:52,640 --> 00:18:53,180
Let's take a look.

282
00:18:53,180 --> 00:18:54,260
What did we miss.

283
00:18:54,330 --> 00:19:03,560
Farm one static flicker dot com server ID secret lang.

284
00:19:03,950 --> 00:19:05,200
Mm hmm.

285
00:19:05,770 --> 00:19:06,580
Interesting.

286
00:19:06,580 --> 00:19:11,610
So we may have missed a slash here or there.

287
00:19:12,010 --> 00:19:14,030
Let's go ahead and let's head down.

288
00:19:14,230 --> 00:19:16,130
We have the farm number.

289
00:19:16,420 --> 00:19:19,550
We have static flicker dot com.

290
00:19:19,630 --> 00:19:25,580
All right static flicker dot com slash the server number.

291
00:19:26,410 --> 00:19:26,980
OK.

292
00:19:27,040 --> 00:19:36,840
And we have Yeff the farm the server number we have the ID underscore the secret Cady.

293
00:19:37,240 --> 00:19:37,660
You know what.

294
00:19:37,660 --> 00:19:39,610
Let's see there are some other letters.

295
00:19:39,640 --> 00:19:43,250
HD for instance downloads a medium sized image.

296
00:19:43,360 --> 00:19:50,440
So let's see if it's just an issue with using large images and you know what it looks like.

297
00:19:50,440 --> 00:19:56,080
That was the problem because it just downloaded the image here for me in medium sized So it looks like

298
00:19:56,080 --> 00:19:59,180
maybe large images are not accessible by the API.

299
00:19:59,290 --> 00:20:00,240
That's good to know.

300
00:20:00,400 --> 00:20:02,990
So let's go ahead and replace k with h.

301
00:20:03,010 --> 00:20:09,850
Let's build it one more time and you should be able to see a giant list of properly formatted you are

302
00:20:09,860 --> 00:20:13,230
Elle's show up right here in our console.

303
00:20:13,240 --> 00:20:14,620
Let's do that.

304
00:20:14,620 --> 00:20:17,970
Here we go double click downloads all those you are else.

305
00:20:18,220 --> 00:20:18,890
Lovely.

306
00:20:19,000 --> 00:20:22,710
And let's go ahead and let's paste this into safari.

307
00:20:23,230 --> 00:20:25,350
And here we go.

308
00:20:27,180 --> 00:20:27,520
All right.

309
00:20:27,520 --> 00:20:28,790
It downloaded.

310
00:20:29,440 --> 00:20:30,730
And here we are.

311
00:20:30,760 --> 00:20:33,380
There's somebody at Disneyland.

312
00:20:33,390 --> 00:20:33,830
Awesome.

313
00:20:33,830 --> 00:20:36,150
So it is properly downloading the images.

314
00:20:36,150 --> 00:20:40,950
We have lots of you or else in the next video we're going to use these you are else to download those

315
00:20:40,950 --> 00:20:45,230
images and save them into our application using Alamo fire image.

316
00:20:45,240 --> 00:20:46,150
Amazing job.

317
00:20:46,150 --> 00:20:47,400
And let's head over to the next one.

