1
00:00:00,120 --> 00:00:08,640
Hi and welcome to a new section on sending Smith with Python in the next video, we be writing the actual

2
00:00:08,700 --> 00:00:14,400
Python script, which sends an SMS to your mobile phone from another mobile phone.

3
00:00:14,700 --> 00:00:16,800
In this video, we will set up an account.

4
00:00:17,040 --> 00:00:18,570
Now what is this account?

5
00:00:18,930 --> 00:00:21,540
Well, to send assignments with Python.

6
00:00:21,810 --> 00:00:23,850
Unfortunately, it's not free.

7
00:00:24,090 --> 00:00:31,860
You have to use some third party services, but fortunately, there are services which give you some

8
00:00:31,860 --> 00:00:35,340
free credits, which you can use to send SMS.

9
00:00:35,350 --> 00:00:39,420
And then every SMS that you sends is being taken out from.

10
00:00:39,420 --> 00:00:40,080
That's created.

11
00:00:40,110 --> 00:00:47,850
It's about $0.01 or something like that, depending on where in the world you are sending SMS, and

12
00:00:47,850 --> 00:00:50,310
that's third party services to you.

13
00:00:50,910 --> 00:00:57,060
So you should go to 2U dot com and then sign up for an account filling those data.

14
00:00:58,080 --> 00:01:01,970
You should get an email that you need to go to that email and confirm it.

15
00:01:01,980 --> 00:01:02,400
And then.

16
00:01:04,000 --> 00:01:11,440
After you confirm it, you should be able to go to the page, visits Troy later, maybe go to the homepage.

17
00:01:11,830 --> 00:01:12,100
Yeah.

18
00:01:12,220 --> 00:01:12,910
So clever.

19
00:01:12,910 --> 00:01:20,980
And the next page is again a verification you need to enter your phone number here.

20
00:01:21,610 --> 00:01:27,780
So that's a condition that needs to be satisfied to be able to create an account and be able to send

21
00:01:27,860 --> 00:01:30,040
some as my python through Twilio.

22
00:01:30,640 --> 00:01:35,620
So fill in your number here and you'll get an SMS with a confirmation code.

23
00:01:36,400 --> 00:01:43,600
And once you verify your phone number using the code that will be essential, then you should fill in

24
00:01:43,600 --> 00:01:45,130
these data here.

25
00:01:46,390 --> 00:01:49,510
So we want to use the eSIM as products of Twilio.

26
00:01:49,540 --> 00:01:54,610
They have different products as well, which can be used in relation with Python.

27
00:01:55,060 --> 00:01:59,890
Let's say for alerts and notifications, it doesn't matter what you choose, they're out shoes with

28
00:01:59,890 --> 00:02:00,580
codes here.

29
00:02:00,790 --> 00:02:02,920
So we are using Twilio through Python.

30
00:02:03,370 --> 00:02:05,500
The preferred language is, of course, Python.

31
00:02:05,800 --> 00:02:08,470
And would you like to host your coding team?

32
00:02:08,699 --> 00:02:09,229
Yes.

33
00:02:09,850 --> 00:02:12,100
And click on Get Started with Twilio.

34
00:02:13,620 --> 00:02:15,210
Then on this page.

35
00:02:16,420 --> 00:02:24,040
You have some details, such as you have the account balance of fifteen point five dollars I have.

36
00:02:24,580 --> 00:02:27,080
And if you want more, you need to upgrade and pay.

37
00:02:27,100 --> 00:02:35,230
Of course, we have the account I.D. here, which we will use to connect with Python and also the authentication

38
00:02:35,230 --> 00:02:36,070
token in here.

39
00:02:36,550 --> 00:02:43,420
And you want to go to get trial phone number to get a number from which you're going to send estimates

40
00:02:43,630 --> 00:02:44,490
from.

41
00:02:44,920 --> 00:02:46,450
This will be my number.

42
00:02:46,450 --> 00:02:47,920
It's an American number.

43
00:02:48,640 --> 00:02:54,130
Choose this number and the number should be created for you.

44
00:02:54,250 --> 00:02:55,480
So that's the phone number.

45
00:02:55,930 --> 00:03:02,200
If you press on Don, you should also see the phone number down here in the main page.

46
00:03:02,770 --> 00:03:05,500
So in develop, this is my number.

47
00:03:06,250 --> 00:03:10,780
The next what we want to do is you want to go to the Read Quickstart doc.

48
00:03:11,850 --> 00:03:14,040
That should open these documentation.

49
00:03:14,370 --> 00:03:16,290
And you want to go down to Python.

50
00:03:18,170 --> 00:03:22,790
And let's now configure our environment to work with three new.

51
00:03:25,160 --> 00:03:34,970
So on Ripple, I will create a new report with Python and say, send asthma's, create a ripple, and

52
00:03:34,970 --> 00:03:37,940
let's see now what we have to do.

53
00:03:39,280 --> 00:03:41,440
So click on that button to start.

54
00:03:42,040 --> 00:03:44,960
You can sign up for a free trial accounts here.

55
00:03:44,980 --> 00:03:47,560
We did that already so we can press on.

56
00:03:47,590 --> 00:03:48,720
I've got an account.

57
00:03:48,730 --> 00:03:49,540
What's next?

58
00:03:50,150 --> 00:03:52,270
Yeah, so we have three operating systems here.

59
00:03:52,570 --> 00:04:00,010
The one I will be using is Linux because Apple is based on Linux, so we are basically in a Linux operating

60
00:04:00,010 --> 00:04:00,730
system in here.

61
00:04:01,090 --> 00:04:06,790
So we have to run this command so selected and copy it or just press this button here.

62
00:04:06,970 --> 00:04:07,810
Click to copy.

63
00:04:08,110 --> 00:04:10,960
Go to Ripple and go to Shell.

64
00:04:11,230 --> 00:04:12,310
Not to the console.

65
00:04:12,460 --> 00:04:14,170
Go to shell and paste that.

66
00:04:15,380 --> 00:04:22,160
So that commands East to install, not to yes, then we have some other commands here, but first,

67
00:04:22,370 --> 00:04:28,030
you want to go to this link and we have these commands that we need to run.

68
00:04:28,100 --> 00:04:29,290
So that's installed.

69
00:04:29,300 --> 00:04:32,630
No dodging us, but we need to configure it with these commands.

70
00:04:33,320 --> 00:04:34,220
So go to Raffel.

71
00:04:34,220 --> 00:04:35,540
Make sure this has finished.

72
00:04:35,780 --> 00:04:40,550
It's finished in my case and paste that other commands execute.

73
00:04:41,270 --> 00:04:42,200
Yeah, nothing happens.

74
00:04:42,200 --> 00:04:42,740
That's OK.

75
00:04:43,640 --> 00:04:45,170
Go back to here.

76
00:04:45,350 --> 00:04:47,420
That's all we have to do on this page.

77
00:04:47,430 --> 00:04:51,540
Close that this is again, our Tullio guide.

78
00:04:52,340 --> 00:04:55,880
You want to copy that commands the first one.

79
00:04:56,540 --> 00:04:58,830
Go to Ripple Paste.

80
00:04:58,850 --> 00:04:59,090
It's.

81
00:05:00,580 --> 00:05:04,270
Executes successful go again to the guides.

82
00:05:04,870 --> 00:05:07,370
Get the other commands, but be careful here.

83
00:05:07,630 --> 00:05:15,430
You don't want to paste this thing, so you want to do envy and use envy em use of then the version,

84
00:05:15,790 --> 00:05:22,750
so envy em use the version in my case is that this one in here you see v sixteen point thirteen point

85
00:05:22,750 --> 00:05:26,260
zero, so you should write your own version as well.

86
00:05:26,530 --> 00:05:29,120
That was installed with the previous commands.

87
00:05:29,140 --> 00:05:34,150
So v sixteen points, thirteen point zero and executes.

88
00:05:34,870 --> 00:05:36,400
Yeah, we got this message.

89
00:05:38,110 --> 00:05:42,400
That's notes version sixteen point thirteen is being used now.

90
00:05:43,450 --> 00:05:53,130
Everything is going well up to this point, then you want to install this package on Linux now on the

91
00:05:53,170 --> 00:05:53,800
Ripple.

92
00:05:54,070 --> 00:05:55,770
The command is slightly different.

93
00:05:55,780 --> 00:05:57,220
You shouldn't do sudo apt.

94
00:05:57,220 --> 00:05:58,650
Get install both.

95
00:05:58,660 --> 00:05:59,870
You can do it.

96
00:05:59,920 --> 00:06:03,670
Install Dash P K G.

97
00:06:04,660 --> 00:06:07,750
A space and then this package.

98
00:06:08,080 --> 00:06:08,680
Copy that.

99
00:06:09,940 --> 00:06:13,960
Pasted there, so that's a complete comment executes.

100
00:06:20,520 --> 00:06:22,140
Have insulation went fine.

101
00:06:22,290 --> 00:06:24,240
So I'll go back to the guides.

102
00:06:24,930 --> 00:06:29,110
And lastly, we want to install to you your command line.

103
00:06:29,200 --> 00:06:30,450
So copy that codes.

104
00:06:32,730 --> 00:06:33,420
We're on it again.

105
00:06:36,640 --> 00:06:37,690
Yeah, successful.

106
00:06:38,620 --> 00:06:43,930
And lastly, this command should update the latest version of Twilio.

107
00:06:44,380 --> 00:06:46,000
So wrong, that's also.

108
00:06:48,630 --> 00:06:50,250
Done next.

109
00:06:51,670 --> 00:06:57,840
Yeah, so it seems wrong to illegal logging, but that's not necessary in our case, so we can skip

110
00:06:57,840 --> 00:07:00,240
that because we were using Python to login.

111
00:07:00,420 --> 00:07:08,610
And yeah, also this one, if you don't currently own a tool, your phone number, we already got a

112
00:07:08,610 --> 00:07:13,370
phone number from the web interface, so you can skip that too.

113
00:07:14,370 --> 00:07:16,230
And then we need to install Python.

114
00:07:16,230 --> 00:07:19,860
Python is already installed on a reptile, so no need for that either.

115
00:07:20,010 --> 00:07:29,100
But we need to install Twilio, so just go to rappel to the packages menu and search for to you with

116
00:07:29,100 --> 00:07:29,460
you.

117
00:07:31,130 --> 00:07:39,770
That's one click the plus icon, and my package was told to India racist thoughts next.

118
00:07:40,250 --> 00:07:45,830
So we stood with the triple package manager so you can keep these commands.

119
00:07:46,220 --> 00:07:48,830
And lastly, we are ready to sense an.

120
00:07:49,820 --> 00:07:51,200
And that is the codes.

121
00:07:52,040 --> 00:07:52,600
This one here.

122
00:07:52,610 --> 00:07:53,690
So just copy it.

123
00:07:54,320 --> 00:07:58,550
Go to revel in your main profile piece that's called.

124
00:08:01,820 --> 00:08:02,140
Right.

125
00:08:02,680 --> 00:08:09,280
There are a few things we need to change here, so we import OS and then we import the Kleins class

126
00:08:09,280 --> 00:08:15,460
from Twilio, and then we need to change the account I.D. to reflect our accounts.

127
00:08:15,700 --> 00:08:18,910
The way this is working is through environment variables.

128
00:08:19,090 --> 00:08:23,560
So these should be an environment variable registered in our report.

129
00:08:23,830 --> 00:08:29,950
Therefore, you need to copy that key and go to secrets and paste.

130
00:08:29,950 --> 00:08:30,700
That's key here.

131
00:08:30,700 --> 00:08:37,940
So we are creating a key with a value and the value should be your account I.D..

132
00:08:38,860 --> 00:08:43,330
So here on Twilio, my account, this idea is this one here so I can copy that.

133
00:08:44,650 --> 00:08:47,040
Go to Ripple and create this value.

134
00:08:47,340 --> 00:08:52,950
Press on adds new secrets you'll see up here that this has been added.

135
00:08:53,520 --> 00:08:59,280
Now we also need to create another key, which is this tullio of token, the authentication token.

136
00:08:59,730 --> 00:09:09,630
The key is that the value is again on the websites here under the account as I.D. D, that was the account.

137
00:09:09,630 --> 00:09:11,610
This idea, this is a token.

138
00:09:12,240 --> 00:09:19,530
So you want to copy that and paste it in here and press on at new secrets.

139
00:09:20,190 --> 00:09:25,500
And now we should have those two registered in our environment, Linux environments.

140
00:09:25,680 --> 00:09:32,220
Next, we created this Kline's instance, using those to call this idea and authentication token variables.

141
00:09:32,700 --> 00:09:42,120
And the message is this one so body of the message this one in here from now, this should be your Twilio

142
00:09:42,130 --> 00:09:48,330
number, the number you got from Twilio, which in my case, is this one in here.

143
00:09:49,260 --> 00:09:55,200
So phone number, the US phone number you want to paste, it's in here.

144
00:09:56,930 --> 00:10:05,450
And then to this is a number you wants to send an SMS to now, as far as I know, for free to Twilio

145
00:10:05,450 --> 00:10:12,560
accounts as we have now, you should use your own number, the number that you use to verify your to

146
00:10:12,690 --> 00:10:13,400
your account.

147
00:10:13,670 --> 00:10:16,670
Otherwise, the SMS will not go through.

148
00:10:16,880 --> 00:10:18,500
So use your own number here.

149
00:10:21,410 --> 00:10:25,160
So I entered my number here and now I can run this script.

150
00:10:31,640 --> 00:10:38,720
And I hope you heard the ring that my eSIMs is already here in the summers that I received.

151
00:10:38,750 --> 00:10:46,160
I can see that this body of the message is there, and Twingo is also adding some other texts because

152
00:10:46,160 --> 00:10:47,930
we are using a trial plan.

153
00:10:47,930 --> 00:10:52,520
So that's fair, and that's how you can send an SMS via Python.

154
00:10:52,850 --> 00:10:53,870
I'll talk to you later.

