Automating Boring Tasks Using ChatGPT and Python

In this video, we’re going to put ChatGPT to the test by automating tasks such as sending emails/messages, plotting graphs and web scraping. We’ll automate all of this using ChatGPT and Python.
⭐️ Get access to thousands of Python tutorials, data science guides and more on Medium for $5/month using this link:
😉 If you’d like to read a Medium guide, check this guide I made before publishing this YouTube video 👉

🔗 Link:
🔥 Join My Automation Course in Python:
🔥 Join My Python for Data Science Bootcamp:
🔥 8-hour Web Scraping Course in Python:
💰 Make money using your Programming & Data Science skills:
✅ Follow me on Medium:
0:00 Intro
0:49 Plotting a graph with chatGPT
4:00 Sending a WhatsApp message with chatGPT
5:59 Sending an email with chatGPT
9:33 Web scraping with chatGPT

Recently chat GPT was released this is An AI chatbot developed by open AI that Specializes in dialogue its goal is to Make AI systems more natural to interact With but it can also help you when Writing code you can make chat GPT your Coding assistant or even go beyond that And in this video I’m going to show you How to use chat GPT to write python code To solve some coding tasks such as Plotting graphs sending emails and Messages and doing web scraping in just A couple of seconds so let’s get started Before we start with this video I’d like To thank median for supporting me as a Content creator medium is a platform Where you can find python tutorials data Science guides and more you can get Unlimited access to every guide on Median for five dollars a month using The link in the description okay now We’re on the chat GPT website and as you Can see here chat GPT is optimized for Dialogue so you can ask something like Explain Quantum computing in simple Terms or you can ask chat GPT to write An essay for you but in this video we’re Going to test cap gbt solving some Coding tasks so for example we can ask Chat gbt to do things like send an email Using python or any other program Language you only have to go here to This box and write whatever you want so In this case just to start with

Something very simple I’m going to say Plot a linear regression And here you can be very specific and Say the programming language you want to Use I’m going to say with python And you can be more specific by writing The library if you don’t write the Library chat GPT is going to choose any Library but I’m going to specify this One so I’m going to say using matplotlip So I’m going to press enter and now chat Gbt is gonna read this and it’s going to Interpret what I’m requesting so it’s Going to plot a linear regression using Python and the library matplotlib and Now it takes a couple of seconds and Finally it understood so it says to plot A linear regression with python you can Use a scatter or you can use uh this uh This module and well now it’s doing all Of this it’s writing the code and it’s Even uh writing some comments so first It’s generating some fake data and then It’s fitting this a linear regression to The data I’m not doing anything and at The end of this uh when chat GPT Finishes doing this I’m going to copy This and I’m going to paste this on Jupiter notebook to test if everything Is correct so now we have uh some some Suggestions by chat gbt this will Generate a scatter plot but it’s giving An alternative so here we can have Another way to do this but I don’t I

Don’t care about that I’m gonna copy This Because I believe with this is enough so I’m gonna copy and as you can see it Gives you not only the code but some Nice comments here comments and hear Explanation about what it’s doing so It’s not only about the the code but it Also gives you some explanation so now I Copied this I’m gonna paste it and I’m Gonna check if this is correct so here It says that I don’t have the modules High Pi so I’m going to install it here Okay I’ve just installed sci-fi and now Let’s see if it does the job and now as We can see this gave an error so Fortunately chat GPT gave us an Alternative so here it says Alternatively you can use these other Option so I’m going to copy this and Actually when I tested this before this Was the only alternative so I’m going to Copy and paste this one and as you can See now we got this uh this linear Regression and well we generated this Using chat DBT so fortunately we have Here two options all right now let’s go Continue testing this and now let’s try Something else so let’s try sending a Message on WhatsApp using Python and to Do this we need a third-party Library Named Pi watt kit so I’m gonna say Something like this send a message On WhatsApp

Using Python and Pi watt kit so let’s See if this AI recognizes this pie what Kit it’s not so popular this Library so Let’s test this out so I’m saying send a Message on WhatsApp using Python and Pie What kit you can add more detail like uh Adding the your phone number but Obviously in this video I’m not gonna Show my phone number so you can test it Out on your own and now we see the trdbt Is writing the code to send a message Using part white Kit so we see all the Code this will cancel the message to be Sent at the specified time so we have to Specify here the hour and the minute we Have 12 30 by default but we can change It note that you need to install pivot Kit of course this is the module and Have a working internet connection you Also need to have the latest version of Chrome yeah uh install on your computer And I know all of this because I have a Tutorial on how to send a message on WhatsApp using Python and using this Library so I know that this is correct So you can copy this Actually and you can paste it on python For example here you can write your Number or the number of anybody you have To install this library right here the Message you want and that’s it you can Send the message on WhatsApp I’m gonna Show you here uh the example I did in The previous tutorial when I wrote the

Code on my own but of course here it’s With this uh AI chat GPT okay now let’s Go back here and let’s continue testing Before here I wrote send a message on WhatsApp using Python and piwotkit but What if now we want to be more specific Let’s try sending an email and now I’m Going to specify that email that is Going to be the sender and the email That is going to be the receiver also The subject for the email and the Content that the email has so that’s a Lot of details let’s see if chat GPT can Handle this so here I’m going to paste This command that I had before and this Is going to help us see if chat GPT can Handle so many details so here it says Send an email from email1 for example Here I’m gonna write my my own email This is the email that I’m going to use And then for the receiver I’m gonna Write another email that I have that Actually I don’t use so often but I’m Gonna use for this test here I have send An email from my first email that I’m Using for this example to my second Email with the subject email sent by cat Gbt and the content chat GPT rocks using Python so let’s press enter and let’s Test this out so this is a very uh I’m Not gonna say complex but I would say it Is challenging to understand all of this And to execute that without any mistake So let’s see if this AI can handle all

Of this so first it’s trying to Understand all of the the request with This explanation so it says to send an Email with the subject we have to use a SMTP leap and yeah that’s the library uh That we used to send emails with python So now it’s writing the code it’s Writing comments the sender the repeat P There recipient sorry then it’s uh Connecting to SMTP server yeah we need To do something like that It’s telling us uh some details and is Adding a note so note that you need to Have a working internet of course in a Valid email account uh you also need to Allow yeah this is that note so you also Need to allow less secure apps to access Your email account but it doesn’t say Anything about that 16 character Password so in the past you could send Emails just allowing less secure apps But nowadays or recently you have to add Two S10 verification and also create a 16 character password so GPT doesn’t Know about that but how you know about That because I have a tutorial on that But Ignoring that let’s see if that works so Here I have the code and so far I have To say that this looks good we have the Sender we have the recipient the subject And the content so it seems everything Is perfect just one thing that we have To keep in mind is the password so here

For the sake of this video I’m gonna Hide my password in this email Underscore password variable I’m gonna Uh delete my password that was in quotes And I’m gonna write this variable so now Let’s test this out I’m gonna run this And see what happens so we have process Finish with x equals zero so apparently Everything was successful and now I’m Gonna check my email okay I log into my Email and as you can see here I have a New email that says email sent by chat GPT and the content is chat DBT rocks And well as you can see I also did a Test uh like three hours before this one And we can see that everything works Successfully and we didn’t have to write All of this code but chat GPT did it for Us and this is just awesome so now let’s Do something more challenging now let’s Try to scrape our website with tab gbt So I’m gonna give a task to chat GPT Something like this so web scrape And then I’m going to write the link of A website so I’m going to use this Website here books to and Then I’m gonna set using python force And here we can specify the library or You can leave it as is in this case I’m Going to say and beautiful too so Beautiful soup is a python library that Allows us to scrape websites I’m going To describe this website and before I Press enter let’s have a look to this

Website so this is the and we’re going To scrape maybe the title or the prices I’m not going to specify what data I Want from this website but I’m gonna let Chat DBT figure this out on its own so I’m going to press enter and let’s see What this AI does so sometimes it takes More than a couple of seconds but you Have to be patient because some tasks Are very challenging So this is very good uh I think it Successfully extracted the price we can See here that we have the price and also The title so it’s printing that title And also the price So here it didn’t export the data I know That because it’s not exporting that txt File or a CSV file but only printing but In the previous test I did it exported a File with all the data in this case I’m Going to leave it as is so I’m going Back here The pie charm copy and paste it and Let’s see if this works smoothly so here I run this and here we have the price Sorry the title first and then the price So let’s verify if this is correct so Here we have a light in the attic 51.77 I think this is this is the symbol Of pounds and yeah we have this and then Tipping the Velvet 53.74 And yeah so we successfully scrape all Of this data using uh actually chat GPT

I mean we can say we used we took but we Didn’t write the code chat gbt did all On its own and this is awesome so as I Said before you can give more Instructions to this AI so you can tell This AI to To export this in a txt file in a CSV File or maybe to scrape more websites Because this is a very simple website Maybe you can tell chatgpt to scrape Amazon or any other website I don’t know How it will go because I didn’t test That out I just did some simple tests But you can test that on your own and Write what you think about this AI on The comment section below hey thanks for Watching this video don’t forget to give It a like And subscribe to this channel For more content like this that’s it for This video I’ll see you on the next one

You May Also Like

About the Author: admin

Leave a Reply

Your email address will not be published. Required fields are marked *