 Hello and welcome. I just want to talk a little bit about this website and I'm not you know endorsing This is just the website that I've been using recently for sharing images That quick and easy where you have a direct URL to an image, you know, there are a lot of things like Flickr and Google photos and Well, it's the Instagram where you can upload photos and share them But usually to give a direct link to the image. They make it difficult If not darn near impossible But if you want to upload an image and get a URL that goes directly to that This website, let's do that Maga image a maga image. Yeah net that's ma ga. I am G net And not only that but they also it's also very easy to upload to this site with a shell script, which makes it super simple to write a script that uploads an image and Returns a URL that you can share to somebody So we're gonna look at it today get the basics of it and then I'll show you a script that I wrote in the next video That takes this and everything we've been working on the last week or two and puts it all into a script That's I think very useful. I wrote it myself for my usage and it just makes things super simple. So Let's just see how it works. You go to the website here They claim that ex the the information the data like location and probably dating time and stuff I would assume is stripped away from the image. Don't upload any images or information You don't want the internet that you don't want everybody to see that's just a general rule I'm not saying that trust people. Also, you don't know if this website's gonna be here five years now Don't use this as like a place to store your photos I believe I read somewhere of the the owner of this site has paid a few years out and he promises It's gonna be up for at least two years But who knows gonna happen after that you might be watching this three years from now and none of this applies anymore But as of right now Towards the end of 2018 is one and there's many sites out there similar to this. This is just the one that I'm using currently Just little disclaimers there don't put things on your net you don't want everybody in the world to see and Don't expect it to be there forever, you know, so let's choose a file And I'm gonna choose this image of my son. I'm gonna click open and I'm gonna click upload and It's going to upload it and then here's this URL I can send this URL to Anybody and they'll be able to open it and see that image connecting directly to it Supposedly with all the you know the location such type data Supposedly removed. I don't I haven't checked to see if it is I'm sure it is but that doesn't mean they're not storing it somewhere else I'm not saying they are on the same the knot that is claiming that it's restrict anyway So that's simply I guess you can also give it a URL to a current image and now add it there And now you have it someplace else in case, you know, this URL might be a little more restrictive Although if it's restrictive, I don't know if it will work here. Anyway, we're looking at uploading images So now that we've done that let's get into Scripting it out. So We're going to use curl sometimes I use W get sometimes I use curl today We're gonna be using curl So I'm in a directory with a bunch of pictures of my son. So let's go ahead and start off With our curl command. So I'm gonna type in curl Dash s for silence. That doesn't give me a bunch of the curl output dash f So we're going to give it a file to upload and I'm going to do IMG Brackets equal at symbol and then the name of a file So here I'm gonna give it it's in this folder so I can skip the name of file Otherwise you can give it the full path. They're gonna do a semicolon. We got to give it the the meme type and in this case It's type Equals and it's an image. Oops image For its last type of image. It's a jpeg file dash capital D Space dash and then we're gonna give it our URL of HTTP. Let me make my text a little bit smaller so this all fits on one line hopefully Column forward slash forward slash Maga in a net it's just straight to that URL and When I do that, we're gonna go go ahead and hit enter and it's gonna give me what the page returns and right here The location is where that image is. So now I should be able to select that URL and Open the link and there's that image now if you try to upload the same image again It's going to know that it's there. It's going to go through fine, but it's going to see it gave me the same URL I don't know if you Actually noticed that so I'll open it once I'll go to upload it again and you can see this URL here matches this URL here So that's good that they don't fill up their server with the same photo and over over and over again Obviously if you change the photo in any way, it's going to have a different. I'm sure they're doing MD5 hash or something like that to get what type of File what type of file is see if it's the same file So if you change the resolution at all or you do anything to it, it's going to show up as a different image But there you go. That is it for that of course Let's let's look at a few other things about this real quick before I end the video so This dash capital D dumps the header, which is this information from the server With and then dash D just means standard output So that's that's making sure that we get this output if we leave that out Let's see what happens Yeah, we get nothing because because basically it's going when you do it in web browser It's going to redirect you to that image. We're not redirecting with curl here If I turn sound off it might tell you that you're being redirected But we want the header that the server the stuff that you normally don't see being displayed So that's what we get right there Now let's let's also look at we got the mean type here. I know I know this is a JPEG image But as we showed you I showed you a few videos ago. You can use the file command So in this case file dash dash meme dash type the file name Will give you the meme type like so and then I was Doing print Ock print column 2 to get just that so that's how you find what's put in there And of course like I said, we're going to use this in a script later on So we're going to want to be able to automate that because you might not always be uploading a JPEG you might be uploading a Jiff or a GIF or a PNG file I'm not sure all the different formats that the website accepts but you need to get the proper meme for the file you're uploading and Then so now that we can get this information Let's say we want to return just the URL here because we're gonna use that in a script Well, we're going to pipe that into grep and we're gonna say Make this text a little bit smaller again, so you can see it Let's go ahead and clear the screen We're gonna say grep and then we're gonna say the little carrot symbol Location and what that's gonna say is find the line that begins with the word location Boom, and then of course we can use Ock as I've shown in the past curly braces here print and dollar sign to Which means get the second column So this is column one and then there's a space and then there's our URL and that will return just the URL For where our image is so we'll be using this As well as well with a lot of the techniques we've been going over In our next video and I'm going to show you a script that I wrote that all makes all this with some nice functionality So I hope you did enjoy this again. I'm not Endorsing this website. You could probably do this with a lot of other websites. This is just the one I'm currently using I find it simple to use and since I wrote my script for this website This is what we're looking over so I do thank you for watching Please visit films by chris.com. That's Chris of the K. There's a link in the description There you can search through all my videos You can also go to the support section support me through PayPal or patreon if you can't support me financially Think about liking sharing subscribing and commenting all those things help spread the word more people watching my videos is Greatly appreciated. I thank you for watching and I hope that you have a great day