 Hello and welcome. So the other day I did a quick little overview of clipping coupons So here I am at Publix which grocery store here near where I live you live in the United States the South Eastern United States you probably are familiar with Publix a great great Grocery store and they have these coupons each digital coupons online You go you create an account and then you clip these coupons And then I guess when you get to the register you're supposed to type your phone number into the keypad It's something I never do. I will never remember to do that But it's a weird thing though because you have to come in here and you can clip as many of these ones You just you just click the little plus button and it adds it's your clip coupons And then when you get there you type in your phone number So it seems to me like why should I have to go through all these? Why can't I just clip them all that way if I buy any of these things? I'll get the discount on it. It just seems kind of it's not like they're limiting you It's just really weird that you got to go and clip them you would think that yeah, I get you want my information So you want my phone number? That's great Can't you just give me a discount on any of this stuff when I come in Why do I have to go through the process of clicking on each one of these? So let's look at clipping all of them. So Right now. There's the when you come here you go to the public calm log in click on coupons Click all load all coupons. You can see this the coupons for you know the next couple of weeks or even months in some cases They're available. There's a lot to go through when I did this the video yesterday was a 168 coupons So let's go ahead and work on that. So again, let me click the plus it adds it to your coupon Clipped right there. So I'm going to open up my developers console here under networks And when I click this plus button, you'll see a list of stuff we're looking for this one says clip as a coupon number here and and it responds with double quotation marks if it's successful and you notice that it has a coupon ID that's passed through it So we're going to do is here now this whole thing could be automated completely automated If you want using something like chrome headless or Firefox with some Python script, but I'm not looking to do it completely This is just for fun. Like I said, I'm not gonna do this all the time But I'm gonna copy this as curl As a curl command now I can go to my shell and I can paste that curl command and all I have to do is change So this has all the login information and cookies that are required I guess the cookies that are I've already logged in with to submit this and I'll have to just give it a new coupon key This is not really any account. This is the account I made for the tutorials So go ahead and if you want to try to type out all this and and get access to my account, that's great But anyway, so now that we do that, we just need to see the coupon code for one of these So I'm gonna select this element tool here. Click on one of these and right here. You can see Data coupon ID right there and when I do that, I'll paste that in. I got the double quotation marks Saying that successful and if I go into my clip coupons here, you'll see that it's there Go back to all coupons And let's once again scroll down in here and click load coupons Actually, I should have paid attention to What I just clip just to make sure that it actually clips, but I'm pretty sure it did three things, right? I don't know how many I've actually clicked on how many I Compared to the one that I just added here, but what we can do now again You can completely automate this but I'm just gonna scroll up in our elements here grab one of the higher elements up and say Copy copy elements, and I'm gonna put that into a file So I'm gonna say cats and then I'm gonna redirect into a file is called P I can paste it here and then hit control D when I'm done. Now I can cat out P and it's that code. I just paste it in there now. We're looking for we know we're looking for something It says data dash coupon ID. So let's just grab for data dash coupon ID And we'll grab that from the P and right there we can see that we have all these coupon codes here just to make sure we got them like I said, you can see right here all this is a 167 let's see what happens if we do a word count here or a line count with WC We got 167 perfect. So every coupon is listed here now We just need to cut that so we'll get rid of our WC command for counting and just say cut with a delimiter of Quotation mark field to there all our numbers and now we're going to take this and We'll go back up to our curl command here. I'll paste that in at the beginning here. Oops. I pasted the wrong thing Let's see Okay, there. We'll paste that line. Let's go ahead and make this full screen now So make it a little bit easier to read and we're gonna actually make a while loop out of this while read I'll just call it L. You can call it whatever you want. You can probably call coupon ID do and then at the end we're gonna say done So we're gonna cut through we're gonna grab through cut through pipe all that into a variable and then loop through to use the variable We're gonna change these single quotes on this first little section here to double quotes get rid of the coupon ID the other sign now now if you Aren't familiar with bash scripts. This might all seem very confusing I'm not going to a lot of detail this tutorial is just kind of for fun It's a fun tutorial and I assume that you you know how to use grep and cut and while loops if not I've done videos on all this stuff before But now so basically it's gonna loop through and for each one of those coupon codes It's gonna run this command where this says dollar sign L now It's actually gonna put in the next coupon code. So if we hit enter, it's gonna start going here and Every time we get that double quotation double double quotation marks We're going to you have a new coupon in there So now I come over here and this doesn't necessarily fresh right away But if I click on my coupons here, actually if I hit a five to refresh We now have 29 coupons clip, but it's still going we can refresh it again. And now we have 39 coupons clip Now just let that go and eventually we'll have all the coupons clipped and you can do this You know every so often then whenever you go to Publix You just type in your phone number and if you happen to buy anything on this list of coupons that are available That coupon should be applied. Anyway, so this is this quick overview again This tutorial isn't like an in-depth tutorial. It's just more fun Concept idea using some of the tools that we've gone over in the past again If you're not familiar with the cat command the grep command the cut command the while loops using variables or even the wc command for For counting stuff if you go to films by chris.com You can search through all my videos so you can type in something like grep and find a bunch of videos about grep If you want to know about curl, I'm sure I have a couple of videos on curl So go ahead check these things out check out my website I thank you for watching and I hope that you have a great day. How many coupons we have now? 145 almost done. You have a great day