WEBVTT

0
00:00.150 --> 00:04.500
Hey there. Welcome to day 39 of 100 Days of Code.

1
00:04.980 --> 00:05.400
Now,

2
00:05.400 --> 00:10.260
today we've got a two part series and this is the part

3
00:10.260 --> 00:12.360
one of your capstone project.

4
00:12.840 --> 00:15.450
So we've been learning about APIs for quite a while now,

5
00:15.660 --> 00:20.660
and we're going to be using a combination of different APIs to create a cheap

6
00:21.780 --> 00:24.720
flight finder. Part one,

7
00:25.020 --> 00:29.610
our program is going to find amazing flight deals just for ourselves.

8
00:29.910 --> 00:30.930
And in part two,

9
00:31.200 --> 00:36.200
we turn this project into a fully-fledged product where we can start signing up

10
00:36.780 --> 00:41.190
users to use our service. So I don't know about you,

11
00:41.220 --> 00:44.400
but I am a travel aficionado.

12
00:44.430 --> 00:46.890
I absolutely love to travel.

13
00:47.400 --> 00:51.030
I'm the sort of person who can't stay stationary in one location.

14
00:51.510 --> 00:56.190
And one of the reasons why I teach Programming online is to be able to travel

15
00:56.250 --> 00:58.020
and work from different places.

16
00:58.500 --> 01:02.910
Now I'm not that picky about where I go. I think everywhere I go,

17
01:02.910 --> 01:06.690
there's beautiful people who can teach me a lot of things.

18
01:07.290 --> 01:12.290
So instead of planning a trip where I have one destination and I plan out the

19
01:12.570 --> 01:16.350
time and date, I actually just look for a good deal.

20
01:16.710 --> 01:18.660
So when I can get a flight

21
01:18.660 --> 01:22.830
that's really cheap and it's to a location that I want to visit,

22
01:23.190 --> 01:27.930
then I pretty much just go for it. So for example,

23
01:28.440 --> 01:32.820
whereas a flight to New Zealand normally costs something like 800 pounds,

24
01:33.240 --> 01:36.900
I managed to get a flight for just a 350 pounds,

25
01:37.170 --> 01:39.030
and it was such a good deal.

26
01:39.060 --> 01:43.170
It even included a stopover in Beijing where I was able to get some tasty duck

27
01:43.710 --> 01:48.210
before I went onto the next 12-hour flight. Another case, um,

28
01:48.240 --> 01:52.950
was Japan where the flight normally costs around 500,

29
01:53.160 --> 01:58.140
550. And I managed to find a flight that was just a 250 pounds return.

30
01:58.680 --> 02:02.880
And the savings on the flight meant that I got to eat some extra tasty sushi.

31
02:03.420 --> 02:07.860
The way that these deals come about is imagine if you go onto a flight search

32
02:07.860 --> 02:11.100
website and you look for flights,

33
02:11.160 --> 02:12.990
anytime in the next six months,

34
02:13.290 --> 02:16.590
every day for lots of different locations.

35
02:16.980 --> 02:19.230
Then you will see that at some point,

36
02:19.230 --> 02:23.490
one of the flight prices will come up and it's much lower than what you expect

37
02:23.490 --> 02:27.600
it to be. And that's how you get a good deal. But of course,

38
02:27.750 --> 02:30.420
we're too busy to do that every single day manually.

39
02:30.810 --> 02:34.320
So here's how my program works. First,

40
02:34.350 --> 02:39.350
we have a Google sheet which keeps track of the locations that we want to visit

41
02:39.750 --> 02:44.520
and a price cutoff. So a historical low price.

42
02:44.850 --> 02:45.683
For example,

43
02:45.690 --> 02:50.690
maybe I want to go to Kerala and visit Kotchi and eat some tasty South Indian

44
02:51.390 --> 02:52.470
food. Well,

45
02:52.500 --> 02:57.060
maybe I would set the price at 350 pounds return from London.

46
02:57.750 --> 03:02.560
So we take this data from our Google sheet with lots of different locations

47
03:02.620 --> 03:07.180
and their lowest prices and we feed that into a flight search API,

48
03:07.570 --> 03:11.260
which is going to run every day, searching through all of the locations

49
03:11.530 --> 03:14.080
looking for the cheapest flight in the next six months.

50
03:14.650 --> 03:19.420
When it comes up with a hit and it finds a flight that's actually cheaper than

51
03:19.420 --> 03:20.800
our predefined price,

52
03:21.100 --> 03:26.100
then it's going to send that date and price via our Twilio SMS module to our

53
03:26.320 --> 03:29.110
mobile phone so that we can book it right there

54
03:29.110 --> 03:33.160
and then. That's the theory of it, but let's see it in action.

55
03:33.700 --> 03:38.700
So here I've got the code for my personal flight club and I'm going to run it

56
03:39.490 --> 03:44.490
and we're going to watch my phone and wait to see if there were any good deals

57
03:45.730 --> 03:46.900
that they found today.

58
03:47.800 --> 03:52.800
And we get a text message from our Twilio account and there we have it. Today's

59
03:54.580 --> 03:56.800
message says low price alert,

60
03:57.010 --> 04:02.010
only 41 pounds to fly from London Stansted to Berlin from the 25th of August to

61
04:03.970 --> 04:06.040
the 10th of September.

62
04:06.670 --> 04:11.670
That was triggered because it looked at my spreadsheet of flight prices and it

63
04:11.860 --> 04:14.770
found that out of all of these locations,

64
04:15.220 --> 04:20.140
the only flight that it found which was cheaper than my lowest price was

65
04:20.170 --> 04:22.600
for Berlin. It was actually only one pound cheaper.

66
04:23.440 --> 04:27.190
So now that I've got my message, I can go ahead and book my trip to Berlin.

67
04:28.720 --> 04:31.990
But before I do that, we're going to complete this capstone project.

68
04:32.410 --> 04:36.670
So head over to the next lesson and let's get started building this project.