 I love using the shell, the terminal, command prompt, technically all different things on a computer because it is so efficient. If you're not doing most of the things you do on a computer at the shell, I promise you, you may not realize it, but I promise you most things are easier and more efficient from the shell. But there is also the cool factor that retro hacker type feel you get from using the shell. Sometimes there's programs out there just to give you that feel. Think about the original Robocop movie, there's that awesome scene where he's marching through the police station up to a computer terminal and then out of his hand comes a big old spike which he jams into the computer data terminal and uploads an image of a criminal he had seen earlier and it searches through all the wanted posters in that cool retro pixelated view. Well, I wrote a script that's kind of like that. I wrote the script just for fun and to get that retro feel but it really does grab wanted posters and criminal information from the FBI website. Let's have a quick look at it. So what this program does, this script, a basic little bash script does is it goes to the FBI most wanted website and pulls down some of the top most wanted people and then it goes to the separate pages, grabs an image and some of the data about that person and then it uses Chaffa to give us this shell image, this ASCII art image of the person and it just goes through. So it is, every time you run the script it really is going to the website and grabbing real information and it's using very basic commands. Again, W get mainly and Chaffa would be the only program that you may not have installed that you could install for the images there. So install that but also it's not just grabbing information and putting it down, it's actually parsing through it and displaying it in a retro style. So let's look at the code. Okay, looking at the code here, again it's a basic shell script, a bash script. I have some variables set up here for where the images are going to go and the info is going to go. I have a main function, I have a function that prints out the information and I have information that gets the list and a function that gets the info and one that gets the photo. So again we're going to start off, excuse me, with the main function here. So real quick, the way we want this to go is we're going to pull down the image, pull down the information, put them together but we don't just want to display them on the screen. As you'll see there's a delay so that we can get that each line loading. So we're going to run the get list and put that into a variable called list. So what does get list do? Get list we have this URL, we have FBI wanted at top 10. We're going to get that and we're going to cut out and sort some of that information and we're going to put that into a list and then we're going to go through each one of those. So we're getting the links to each of the most wanted people and then looking at their page one by one. We're going to get the photo, so we're going to pass the link that we've gotten from our first function here and the get photo is again simple, we're passing at the URL, it's going to look through and scrape through that web page, get the image downloaded. It's going to do the same thing for information, we're going to pass the same URL but to this get info and we're going to double get W get on this again. So again this is just for fun, I'm using W get to get the same page twice and scrape through it. Really a more efficient way would be to W get that, throw that into either a temporary file or even better yet a variable and then scrape through it separately instead of doing double the work of getting it from the website. But again it's just for fun so I just kind of threw it together. Then what we're going to do is we're going to clear the screen and use Chaffa to convert that image to a text and we're going to dump that into a temporary file and then we're going to print the output. So basically we put all that into a file and then in the print output we're using the paste command. If you're not familiar with the paste command basically if I have two text files, you know if I was capped them together they'd put them one on top of the other but paste will let you put two text files line by line next to each other so that way I can get the image loading here as well as the information loading here. So we're going to do that, we're going to paste it but instead of putting it into a file we're going to pipe the output of that into a while loop. We're going to echo it line by line but you can see I have the sleep command here with a .05 second delay and that will allow us to have that where it's slowing because newer computers, modern day computers, I do this is just going to boop the whole thing would be on the screen and we don't want that. We want that cool retro loading screen line by line. I mean I could do character by character but we're doing line by line so it's a little bit faster. So that's what that sleep why we're doing that instead of just using the paste command we actually have a function that does the paste command and then loops it echoes it line by line with a delay and that's pretty much it. Then we're going to you know say please enter to continue you click read and then when you hit enter it's going to loop to the next person so we're all the way through the list. Again this is not a perfect script. There are certain at the top 10 you're not going to get all top 10 I had certain issues where some people again I'm scraping the website sometimes it wouldn't grab the text and no text would show up or the text would be messed up. So I set it to check if the text is blank just skip that person and go to the next person. Again it's just for fun we're not really you know using this to look at the top 10 but it's just a cool little retro style thing we got going. So let's go ahead and run this. So we got this here and I called it wanted so I do is wanted and it will run through so it doesn't take long at all to grab that information it displays that I can hit enter and it goes to the next person I can enter again it goes to the next person again grabbing real photos from the FBI website as well as some permanent information there and we can go all the way through until they're done and again it may skip some of them if for some reason scripting the web page misses something which is instead loading something that didn't look right I just said skip it if it isn't right again just for fun here and when you get all the way through it will just bring you back to your promise all in all this is just under 50 lines of actual code and definitely could be shortened and cleaned up again it was just done to be done I did quickly just to get it done but I have it up on pay spin there'll be a link in the description of this video so go ahead check it out download again it's all it's using tools that you already have on your system it's using W get built in bash commands and it's also using paste which is installed on most systems I'm not sure if that's built in a bash or if that's an external command but it's on your system and the only thing that you probably have to install that isn't on most systems by default is chaff to get that nice looking you know image in the shell so I hope you enjoyed this and I hope you have fun just run this maybe on a loop in the background on your computer when you're not there so thanks for watching and I hope that you have a great day please visit filmsbychris.com Chris the K link in the description again as well as a link to the code and comment below let me know what you think you know this was a quick little just demonstration but just a fun thing that you can do and play around with have a great day