├── .DS_Store ├── .gitignore ├── .vscode └── settings.json ├── Bash ├── Hunt_Username │ ├── README.md │ └── huntUsername.sh ├── Twitter_Bookmarks │ ├── README.md │ └── twitterBookmarks.sh └── URL_Scraper │ ├── README.md │ └── url_scraper.sh ├── CODE_OF_CONDUCT.md ├── Contruibuting.md ├── Golang ├── Bitcoin_Price_Tracker │ ├── Readme.md │ ├── go.mod │ ├── go.sum │ └── main.go ├── GIF_Creator │ ├── README.md │ ├── convert │ │ └── convert.go │ ├── gifgen.go │ ├── gifs │ │ ├── g.gif │ │ └── gif.gif │ └── go.mod └── Github_UserName_Checker │ ├── README.md │ ├── go.mod │ ├── go.sum │ ├── main.go │ └── postfix.csv ├── Javascript ├── Amazon_Price_Tracker │ ├── ReadMe.md │ ├── index.js │ ├── package-lock.json │ └── package.json ├── Automate_Tinder │ ├── Readme.md │ └── automateTinder.js └── Blog_Image_Finder │ ├── ImageFinder.js │ ├── README.md │ └── index.html ├── LICENSE ├── Python ├── 2048 Game │ └── 2048_Game.py ├── 21_NUMBER_GAME │ └── 21NumberGame.py ├── 5FunctionCalculator │ └── 5functionCalculator.py ├── Acronyms Using Python │ └── Acronyms_using_python.py ├── AgeCalculator │ └── ageCalc.py ├── Auto typer │ └── auto_typer.py ├── AutomatedCalling │ ├── autocall.py │ └── instruction.txt ├── Automatic Birthday mail │ └── Automatic_Birthday_mail.py ├── Automating Happy Birthday post on Facebook │ └── happy_birthday.py ├── BMI Calculator │ └── BMI_Calculator.py ├── Basic Calculator │ └── main.py ├── Bitcoin Address Validator │ └── btc_address_validator.py ├── CSV to Excel │ ├── CSV to Excel.py │ └── requirements.txt ├── Cartooning an Image │ └── main.py ├── ConvertUnit │ ├── README.md │ └── unit_coverter.py ├── Cryptocurrency Price Alert │ └── CryptocurrencyPriceAlert.py ├── CurrencyConversionRates │ ├── Currency_Conversion_Rates.py │ └── README.md ├── Curve Fitting Script │ ├── Curve_Fitting.py │ ├── Data_Input.py │ └── data.csv ├── DNSCrawler │ ├── main.py │ ├── readme.md │ └── requirements.txt ├── DataScraping │ ├── Data-Scraping.py │ ├── README.md │ └── requirements.txt ├── Dice Roller │ └── dice_roller.py ├── Email Validator │ ├── README.md │ └── email_validator.py ├── File Converter │ ├── file_converter.py │ └── requirements.txt ├── File Renamer │ └── fileRenamer.py ├── Google automated search │ └── Google_automated_search.py ├── Google-Meet-automation-with-Python │ ├── README.md │ ├── config.json │ ├── main.py │ └── requirements.txt ├── HowLongtoBeat Game │ ├── howlongtobeat.py │ └── requirements.txt ├── Image Fetcher │ └── main.py ├── Image-Resizer │ ├── README.md │ └── resizer.py ├── Instagram Reels Downloader │ └── Instagram Reel Downloader.py ├── Instagram bot │ └── main.py ├── InternetSpeedTest │ └── main.py ├── JPG_to_PDF_Converter │ ├── convert.py │ ├── mad_libs_generator.py │ │ ├── mad_libs.py │ │ └── rock_paper_scissor.py │ │ │ ├── # Python script for Amazon product avail.py │ │ │ └── r_p_s.py │ └── requirements.md ├── JumbleSolver │ ├── LICENSE │ ├── main.py │ └── scraper.py ├── Language Translate │ ├── README.md │ ├── language_translate.py │ └── requirements.txt ├── Mastermind Game │ └── mastermindGame.py ├── MessageSender │ ├── Readme.md │ └── message.py ├── Number Guessing │ └── NumberGuessing.py ├── Password Generator │ └── password_generator.py ├── Pintrest Bulk Image Uploader Script │ ├── README.md │ ├── assets │ │ └── delete_me.txt │ ├── data │ │ ├── csv_structure.csv │ │ └── json_structure.json │ ├── main.py │ └── requirements.txt ├── Python program to extract rectangular shape │ └── main.py ├── Python-GUI │ └── python.py ├── QR-Code Genrator │ ├── QR_code.py │ └── qr.svg ├── RGB_to_Grayscale Image Converter │ ├── README.md │ ├── RGB_to_Grayscale_Image.py │ ├── grayscaled_image.png │ └── sample.jpg ├── Rock Paper Scissor Game │ ├── JUMBLE_WORD_GAME │ │ └── JumbleWordGame.py │ └── RockPaperScissorGame.py ├── SnakeGame │ ├── README.md │ ├── resources │ │ ├── apple.jpg │ │ ├── background.jpg │ │ ├── block.jpg │ │ ├── crash.mp3 │ │ ├── ding.mp3 │ │ └── music1.mp3 │ └── snakeWithPython.py ├── Space Shooter game using python │ ├── 1assets │ │ ├── background-black.png │ │ ├── pixel_laser_blue.png │ │ ├── pixel_laser_green.png │ │ ├── pixel_laser_red.png │ │ ├── pixel_laser_yellow.png │ │ ├── pixel_ship_blue_small.png │ │ ├── pixel_ship_green_small.png │ │ ├── pixel_ship_red_small.png │ │ └── pixel_ship_yellow.png │ ├── background-black.png │ ├── main.py │ ├── pixel_laser_blue.png │ ├── pixel_laser_green.png │ ├── pixel_laser_red.png │ ├── pixel_laser_yellow.png │ ├── pixel_ship_blue_small.png │ ├── pixel_ship_green_small.png │ ├── pixel_ship_red_small.png │ ├── pixel_ship_yellow.png │ ├── spaceinv-Copy1.ipynb.url │ └── spaceinvade.py ├── Sudoku │ └── sudoku.py ├── TIC-TAC-TOE │ └── TICTACTOE.py ├── Text detection using Python │ └── text_detection.py ├── Twitter automation │ ├── main.py │ └── requirements.txt ├── URL-Shortener │ ├── README.md │ └── UrlShortener.py ├── Video to Audio │ └── Video to Audio converter ├── Weather App │ ├── main.py │ ├── weather.py │ └── weather.txt ├── Weather Desktop Notifications │ └── Weather_Desktop_Notifications.py ├── Web Scrapping Using Python │ ├── README.md │ ├── READMECode.txt │ └── main.py ├── WifiPassWordExtractor │ └── wifi.py ├── WikipediaInformation │ ├── README.md │ └── WikipediaInformationScript.py ├── Wordle Game │ ├── README.md │ ├── colour.py │ ├── colour_curses.py │ ├── custom_exceptions.py │ ├── utils.py │ ├── wordle.py │ └── words-list.txt ├── Youtube Opener │ └── open_Youtube.py ├── Youtube Video Downloader │ └── Youtube Video Downloader.py ├── bar graph │ └── bar graph.py ├── count down timer │ └── countdowntimer.py ├── dice rolling simulator │ └── Dice rolling simulator.py ├── draw any program in turtle │ └── draw_any_program_in_turtle.py ├── mad_libs_generator │ ├── Untitled-1.lua │ ├── Untitled-1.py │ └── mad_libs.py ├── palette with trackbars │ └── main.py ├── pdf watermark │ ├── requirements.txt │ └── watermark.py ├── rock-paper-scissors │ ├── readme.md │ └── rps.py └── word guessing │ └── wordguessing.py ├── README.md ├── Rust ├── Youtube_Downloader │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ └── src │ │ ├── cli.rs │ │ └── main.rs └── email-validator │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ └── src │ └── main.rs ├── banner.png └── container.jpg /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | venv 2 | __pycache__/ -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.formatting.provider": "yapf" 3 | } -------------------------------------------------------------------------------- /Bash/Hunt_Username/README.md: -------------------------------------------------------------------------------- 1 | # Hunt Username 2 | 3 | [![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com) 4 | [![forthebadge](https://forthebadge.com/images/badges/open-source.svg)](https://forthebadge.com) 5 | [![Bash Shell](https://img.shields.io/static/v1?label=MADE%20WITH&message=BASH&color=red&style=for-the-badge&logo=gnu-bash)](https://shields.io/) 6 | [![Linux](https://img.shields.io/static/v1?label=MADE%20FOR&message=LINUX&color=red&style=for-the-badge&logo=linux)](https://shields.io/) 7 | 8 | Hunt Username is a simple Bash Script that searches for a username on various social channels(Github, Dev.To, Reddit) and then displays whether an account exists with that username.This script can be used for searching for a person on various social channels. 9 | 10 | ## Dependencies 11 | 12 | - cURL 13 | 14 | ## Setup Instructions 15 | 16 | - Installing cURL: 17 | 18 | > sudo apt install curl 19 | 20 | - For running the script when we are in the same directory where **huntUsername.sh** resides, execute the following command. 21 | 22 | > bash huntUsername.sh 23 | 24 | - For the running script from anywhere regardless of the directory the current user is in, move the file **huntUsername.sh** to **_/usr/local/bin_**. 25 | 26 | 1. To do so execute the following command: 27 | 28 | > sudo cp huntUsername.sh /usr/local/bin 29 | 30 | 2. Then give execute permission to the script. 31 | 32 | For adding execute permission, run the following command: 33 | 34 | > sudo chmod +x /usr/local/bin/huntUsername.sh 35 | 36 | 3. Now you can run the script using the follwing command: 37 | 38 | > huntUsername.sh 39 | 40 | ## Usage 41 | 42 | Using the script is fairly simple, just type the following command if you want to provide the username when prompted: 43 | 44 | > bash huntUsername.sh 45 | 46 | To provide the username as an argument to the script, run the following command: 47 | 48 | > bash huntUsername.sh username 49 | 50 | ## Output 51 | 52 | ![sample-output](https://imgur.com/PurqZtD.png) 53 | 54 | ## Author(s) 55 | 56 | **_ Made By [Ashutosh Kumar](https://github.com/Blastoise) _** 57 | -------------------------------------------------------------------------------- /Bash/Hunt_Username/huntUsername.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function github() { 4 | 5 | baseUrl="https://github.com" 6 | statusCode=$(curl -I -s -L "$baseUrl/$username" | grep -w "HTTP" | cut -d " " -f2 | tail -n 1) 7 | if (( statusCode == 200 )); then 8 | echo "$username exists on Github" 9 | else 10 | echo "$username does not exists on Github" 11 | fi 12 | } 13 | 14 | function reddit() { 15 | baseUrl="https://www.reddit.com/user" 16 | for i in {1..5}; do 17 | statusCode=$(curl -I -s -L "$baseUrl/$username" \ 18 | -H 'upgrade-insecure-requests: 1' \ 19 | -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36' \ 20 | -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' \ 21 | -H 'accept-language: en-GB,en;q=0.9' \ 22 | --compressed | grep -w "HTTP" | cut -d " " -f2 | tail -n 1) 23 | 24 | if (( statusCode == 200 )); then 25 | echo "$username exists on Reddit" 26 | break 27 | elif (( statusCode == 404 )); then 28 | echo "$username does not exists on Reddit" 29 | break 30 | elif (( statusCode == 504 )); then 31 | continue 32 | else 33 | echo "$username does not exists on Reddit" 34 | break 35 | fi 36 | done 37 | } 38 | 39 | function devTo() { 40 | baseUrl="https://dev.to" 41 | statusCode=$(curl -I -s -L "$baseUrl/$username" | grep -w "HTTP" | cut -d " " -f2 | tail -n 1) 42 | if (( statusCode == 200 )); then 43 | echo "$username exists on DEV Community" 44 | else 45 | echo "$username does not exists on DEV Community" 46 | fi 47 | } 48 | 49 | function huntSocialMedia() { 50 | github 51 | reddit 52 | devTo 53 | 54 | } 55 | 56 | username=$1 57 | if [ -z $1 ]; then 58 | read -p "Enter Username: " username 59 | fi 60 | 61 | huntSocialMedia 62 | -------------------------------------------------------------------------------- /Bash/Twitter_Bookmarks/README.md: -------------------------------------------------------------------------------- 1 | # Twitter Bookmarks 2 | 3 | [![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com) 4 | [![forthebadge](https://forthebadge.com/images/badges/open-source.svg)](https://forthebadge.com) 5 | [![forthebadge](https://forthebadge.com/images/badges/made-with-markdown.svg)](https://forthebadge.com) 6 | [![Bash Shell](https://img.shields.io/static/v1?label=MADE%20WITH&message=BASH&color=red&style=for-the-badge&logo=gnu-bash)](https://shields.io/) 7 | [![Linux](https://img.shields.io/static/v1?label=MADE%20FOR&message=LINUX&color=red&style=for-the-badge&logo=linux)](https://shields.io/) 8 | 9 | Twitter Bookmarks is an awesome bash script which when executed appropriately scrapes the URL of all of the tweets bookmarked by you by signing in to your Twitter account using the credentials provided by you while running the script. By default it stores the output in a markdown file name **_twitterBookmarks.md_** located at **_/home/user/_**.This script when used with a task scheduler can be used for generation of data that can be used for various purposes. 10 | 11 | ## Dependencies 12 | 13 | - cURL 14 | - jq 15 | - Appropriate Chrome Web Driver(Same Version that of your Google Chrome Browser) 16 | 17 | ## Setup Instructions 18 | 19 | - First download the appropriate Chrome Web Driver using the this [link](https://chromedriver.chromium.org/downloads). 20 | 21 | - Install the other two dependencies using the following commands: 22 | 23 | 1. Installing cURL: 24 | 25 | > sudo apt install curl 26 | 27 | 2. Installing jq: 28 | > sudo apt-get install jq 29 | 30 | - For running the script when we are in the same directory where **twitterBookmarks.sh** resides, execute the following command.(Assuming Chrome Driver is located at **_/home/user/_**) 31 | 32 | > bash twitterBookmarks.sh 33 | 34 | - For the running script from anywhere regardless of the directory the current user is in, move the file **twitterBookmarks.sh** to **_/usr/local/bin_**.(Assuming Chrome Driver is located at **_/home/user/_**.) 35 | 36 | 1. To do so execute the following command: 37 | 38 | > sudo cp twitterBookmarks.sh /usr/local/bin 39 | 40 | 2. Then give execute permission to the script. 41 | 42 | For adding execute permission, run the following command: 43 | 44 | > sudo chmod +x /usr/local/bin/twitterBookmarks.sh 45 | 46 | 3. Now you can run the script using the follwing command: 47 | 48 | > twitterBookmarks.sh 49 | 50 | - Please read the [NOTE](#note) section to know how to specify the location of Chrome Web Driver and for editing other settings. 51 | 52 | ## Usage 53 | 54 | Using the script is fairly simple, just type the following command if you want to provide your username and password when prompted(this does not show your password while typing): 55 | 56 | > bash twitterBookmarks.sh 57 | 58 | To provide the username and password as an argument to the script, run the following command: 59 | 60 | > bash twitterBookmarks.sh username password 61 | 62 | ## Note 63 | 64 | There are few variables that can be modified according to your need. 65 | 66 | 1. The most important variable that can be modified is the **_driver_location_** variable that stores the full path of the directory where the Chrome Web Driver is situated. By default it will search for the Web Driver at **_/home/user/_** 67 | 68 | 2. Another important variable is **_sleep_time_** which is set to 5 by default and describes the number of seconds to wait for the page to be loaded. If your internet speed is slow then increase the number accordingly. 69 | 70 | 3. Last variable that can be tuned is **_location_of_file_** which stores the full path of the file where the output will be stored. 71 | 72 | ## Output 73 | 74 | ![sample-output](https://imgur.com/GgVDc2s.png) 75 | 76 | ## Author(s) 77 | 78 | **_ Made By [Ashutosh Kumar](https://github.com/Blastoise) _** 79 | -------------------------------------------------------------------------------- /Bash/Twitter_Bookmarks/twitterBookmarks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Variable to be modified according to internet speed 4 | # If your internet speed is fast a value of 2 or 3 will be great 5 | sleep_time=5 6 | 7 | # Varible where Chrome Driver is located 8 | driver_location="${HOME}" 9 | 10 | # Complete path of the markdown file to be created 11 | location_of_file="${HOME}/twitterBookmarks.md" 12 | 13 | function login() { 14 | 15 | # Open Twitter login page 16 | curl -s -d '{"url":"https://twitter.com/login"}' ${baseUrl}/${sessionId}/url > /dev/null 17 | sleep "$sleep_time" 18 | 19 | # Element ID for username 20 | usernameID=$(curl -s ${baseUrl}/${sessionId}/element -d '{"using":"name","value":"session[username_or_email]"}' | jq '.value.ELEMENT' | cut -d '"' -f2) 21 | 22 | # Type out the username in the username field 23 | curl -s ${baseUrl}/${sessionId}/element/${usernameID}/value -d "{\"value\":[\"$username\"]}" > /dev/null 24 | 25 | # Element ID for password 26 | passwordID=$(curl -s ${baseUrl}/${sessionId}/element -d '{"using":"name","value":"session[password]"}' | jq '.value.ELEMENT' | cut -d '"' -f2) 27 | 28 | # Type out the password in the password field 29 | curl -s ${baseUrl}/${sessionId}/element/${passwordID}/value -d "{\"value\":[\"$password\"]}" > /dev/null 30 | 31 | # Element ID for button 32 | buttonID=$(curl -s ${baseUrl}/${sessionId}/element -d '{"using":"xpath","value":"//div[@data-testid=\"LoginForm_Login_Button\"]"}' | jq '.value.ELEMENT' | cut -d '"' -f2) 33 | 34 | # Click the button 35 | curl -s -XPOST ${baseUrl}/${sessionId}/element/${buttonID}/click > /dev/null 36 | 37 | sleep "$sleep_time" 38 | } 39 | 40 | function getAllUrls() { 41 | 42 | 43 | # Go to the bookmarks URL 44 | curl -s -d '{"url":"https://twitter.com/i/bookmarks"}' ${baseUrl}/${sessionId}/url > /dev/null 45 | 46 | sleep "$sleep_time" 47 | 48 | # Associative Array that stores URL as keys 49 | declare -A tweets 50 | 51 | # Height to be scrolled 52 | height=1000 53 | 54 | # Variable to check after each iteration 55 | scrolling="true" 56 | 57 | # Get the y-position of scroll bar 58 | prev_pos=$(curl -s -d '{"script":"return window.pageYOffset;","args":[]}' ${baseUrl}/${sessionId}/execute | jq '.value') 59 | 60 | while [ "$scrolling" = "true" ]; do 61 | 62 | # Get the id's of the anchor tag of the tweets 63 | arr=($(curl -s ${baseUrl}/${sessionId}/elements -d '{"using":"xpath","value":"//a[./time]"}' | jq '.value[] | .ELEMENT' | cut -d '"' -f2)) 64 | 65 | # Loop for getting url for those tweets which are not repetative 66 | for i in ${arr[@]}; do 67 | 68 | # Getting the URL 69 | temp_url=$(curl -s ${baseUrl}/${sessionId}/element/${i}/attribute/href | jq .value | cut -d '"' -f2) 70 | 71 | # Saving the URL if it doesn't exists 72 | if [ -z "${tweets[${temp_url}]}" ]; then 73 | tweets["$temp_url"]=1 74 | else 75 | continue 76 | fi 77 | 78 | done 79 | 80 | # Variable to try scrolling 81 | scroll_attempt=0 82 | 83 | while true; do 84 | 85 | # For scrolling the page 86 | curl -s -d "{\"script\":\"window.scrollTo(0,$height);\",\"args\":[]}" ${baseUrl}/${sessionId}/execute > /dev/null 87 | sleep "$sleep_time" 88 | 89 | # Getting the current y-position of scroll bar 90 | current=$(curl -s -d '{"script":"return window.pageYOffset;","args":[]}' ${baseUrl}/${sessionId}/execute | jq '.value') 91 | 92 | # If the scrolling didn't happen then try again 93 | if (( $(echo "$current == $prev_pos" | bc -l) )); then 94 | ((scroll_attempt=scroll_attempt+1)) 95 | 96 | # We reached the end of tweets 97 | if [ "$scroll_attempt" -ge 5 ] ;then 98 | scrolling="false" 99 | break 100 | else 101 | sleep "$sleep_time" 102 | fi 103 | else 104 | prev_pos=$current 105 | ((height=height+1000)) 106 | break 107 | fi 108 | 109 | done 110 | 111 | done 112 | 113 | # Adding URl's to the markdown file 114 | touch "$location_of_file" && echo -e "# Twitter Bookmarks\n" >> "$location_of_file" 115 | 116 | for i in "${!tweets[@]}"; do 117 | echo -e "- $i" >> "$location_of_file" 118 | done 119 | 120 | echo "${location_of_file} file created and saved" 121 | 122 | } 123 | 124 | 125 | username=$1 126 | password=$2 127 | 128 | if [ -z "$username" ]; then 129 | read -p "Enter Username: " username 130 | read -s -p "Enter password: " password 131 | elif [ -z "$password" ]; then 132 | read -s -p "Enter password: " password 133 | fi 134 | 135 | 136 | # Location where web driver is located 137 | cd "$driver_location" 138 | 139 | # Running the web driver in the background 140 | ./chromedriver & 141 | 142 | # Create a session and store the sessionId 143 | baseUrl="http://localhost:9515/session" 144 | sessionId=$(curl -s -d '{"desiredCapabilities":{"browserName":"chrome","goog:chromeOptions":{"args":["headless"]}}}' ${baseUrl} | jq '.sessionId' | cut -d '"' -f2) 145 | 146 | # Function to login into Twitter 147 | login 148 | 149 | # Function to get Tweets and saving them in Markdown.md file 150 | getAllUrls 151 | -------------------------------------------------------------------------------- /Bash/URL_Scraper/README.md: -------------------------------------------------------------------------------- 1 | # Extract URL(s) from a web page 2 | 3 | [![Bash Shell](https://img.shields.io/static/v1?label=MADE%20WITH&message=BASH&color=red&style=for-the-badge&logo=gnu-bash)](https://shields.io/) 4 | [![Linux](https://img.shields.io/static/v1?label=MADE%20FOR&message=LINUX&color=red&style=for-the-badge&logo=linux)](https://shields.io/) 5 | 6 | Bash scripting is very powerful and can be used to perform difficult tasks as web scraping too. In general `grep` is a popular tools for finding text in a file and so many other applications. Combined with other tools like `lynx`, `sed, `awk` and `curl`, bash script can be used to extract url from a web page directly from the terminal. 7 | 8 | ## Prerequisite 9 | 10 | You must have `lynx` and `curl` installed in order to use this script. Check using command given below. This will check as well as install the packages. 11 | 12 | ```bash 13 | sudo apt-get update && sudo apt-get install -y lynx curl 14 | ``` 15 | All other packages comes pre-installed in most linux distributions. In case of an error, install that package. 16 | 17 | ## Usage 18 | 19 | - Download [url_scraper.sh](url_scraper.sh) file, or copy the content of this file to a local file on your system. 20 | 21 | - Goto the folder and run the script 22 | 23 | ```bash 24 | # without any argument 25 | ./url_scraper.sh 26 | # output 27 | Usage: ./url_scraper.sh [-d|-r|-a] url 28 | -d list primary domains of every link 29 | -r list only relative links to site 30 | -a list all links 31 | ``` 32 | 33 | ## Output 34 | 35 | - With URL as argument ( same as ./url_scraper.sh -a www.google.com) 36 | ```bash 37 | ./url_scraper.sh www.google.com 38 | # output 39 | http://maps.google.co.in/maps 40 | http://www.google.co.in/history/optout 41 | http://www.google.co.in/imghp 42 | http://www.google.co.in/services/ 43 | http://www.google.com/advanced_search 44 | http://www.google.com/intl/en/about.html 45 | http://www.google.com/intl/en/ads/ 46 | http://www.google.com/intl/en/policies/privacy/ 47 | http://www.google.com/intl/en/policies/terms/ 48 | http://www.google.com/preferences 49 | http://www.google.com/setprefdomain 50 | http://www.google.com/setprefs 51 | http://www.youtube.com/ 52 | https://accounts.google.com/ServiceLogin 53 | https://drive.google.com/ 54 | https://mail.google.com/mail/ 55 | https://news.google.com/ 56 | https://play.google.com/ 57 | https://www.google.co.in/intl/en/about/products 58 | [found 19 url(s): 9 OK | 10 Redirected | 0 Broken] 59 | ``` 60 | 61 | - With -d flag and URL argument 62 | 63 | ```bash 64 | ./url_scraper -d www.google.com 65 | # output 66 | accounts.google.com 67 | drive.google.com 68 | mail.google.com 69 | maps.google.co.in 70 | news.google.com 71 | play.google.com 72 | www.google.co.in 73 | www.google.com 74 | www.youtube.com 75 | [found 9 domain(s): 2 OK | 7 Redirected | 0 Broken] 76 | ``` 77 | 78 | - With -r flag and URL argument 79 | 80 | ```bash 81 | ./url_scrapper -r www.google.co.in 82 | # output 83 | intl/en/about/products 84 | [found 1 relative url(s): 0 OK | 1 Redirected | 0 Broken] 85 | ``` 86 | 87 | ## Author(s) 88 | 89 | Created by [Avinal Kumar](https://github.com/avinal) 90 | -------------------------------------------------------------------------------- /Bash/URL_Scraper/url_scraper.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # file: Bash/URL_Scraper/url_scraper.sh 4 | # Author: Avinal Kumar (https://github.com/avinal) 5 | 6 | # define colors and escape sequence 7 | lightgreen='\033[1;32m' 8 | lightred='\033[1;31m' 9 | orange='\033[0;33m' 10 | cyan='\033[0;36m' 11 | wht='\033[0m' 12 | nc='\033[0J' 13 | 14 | 15 | # scrape_urls() function scrapes urls from given web page using lynx, cut, grep, awk, sed, sort, uniq tools. 16 | # it can scrape domains, relative urls and all urls. 17 | function scrape_urls() { 18 | 19 | # check if correct argument has been given or not and print usage 20 | if [ $# -eq 0 ]; then 21 | echo "Usage: $0 [-d|-r|-a] url" >&2 22 | echo " -d list primary domains of every link" >&2 23 | echo " -r list only relative links to site" >&2 24 | echo " -a list all links" >&2 25 | exit 1 26 | fi 27 | 28 | # check if number of arguments is greater than one, i.e. contains a flag 29 | if [ $# -gt 1 ]; then 30 | case "$1" in 31 | -d) lastcmd="cut -d/ -f3|sort|uniq" # cut only relative urls 32 | shift 33 | ;; 34 | -r) basedomain="https://$(echo "$2" | cut -d/ -f3)/" # extract relative domains 35 | lastcmd="grep \"^$basedomain\"|sed \"s|$basedomain||g\"|sort|uniq" 36 | shift 37 | ;; 38 | -a) basedomain="https://$(echo "$2" | cut -d/ -f3)/" # extract all urls 39 | lastcmd="grep -v \"$basedomain\"|sort|uniq" 40 | shift 41 | ;; 42 | *) echo -e "${lightred}$0: unknown option specified: $1" >&2 # error on wrong arguments 43 | exit 1 44 | esac 45 | else 46 | lastcmd="sort|uniq" # only one argument, url is given 47 | fi 48 | 49 | # lynx scrapes all the urls based on given parameters 50 | lynx -dump "$1"|\ 51 | sed -n '/^References$/,$p'|\ 52 | grep -E '[[:digit:]]+\.'|\ 53 | awk '{print $2}'|\ 54 | cut -d\? -f1|\ 55 | eval $lastcmd 56 | } 57 | 58 | # url_check() function checks if scraped url are working or not 59 | # curl is used to check the response of the url 60 | function url_check() { 61 | 62 | # counters for various types of link 63 | redirected=0 64 | success=0 65 | error=0 66 | total=0 67 | 68 | # variables for rich print 69 | if [ "$1" == "-r" ]; then 70 | lnktp="relative url(s)" 71 | append="$2/" 72 | elif [ "$1" == "-d" ]; then 73 | lnktp="domain(s)" 74 | append="" 75 | else 76 | lnktp="url(s)" 77 | append="" 78 | fi 79 | 80 | # read each line from the output given by scrape_urls() function and perform HTTP request to find status 81 | while read -r line; do 82 | aline="$append$line" 83 | sc=$(curl -Is "$aline" | head -n 1 ) 84 | read -ra code <<< "$sc" 85 | total=$(expr $total + 1) 86 | case "${code[1]}" in 87 | 1[0-9][0-9]) echo -e "${cyan}$line${nc}" # informational response 88 | ;; 89 | 2[0-9][0-9]) echo -e "${lightgreen}$line${nc}" # successful response 90 | success=$(expr $success + 1) 91 | ;; 92 | 3[0-9][0-9]) echo -e "${orange}$line${nc}" # redirection response 93 | redirected=$(expr $redirected + 1) 94 | ;; 95 | 4[0-9][0-9]) echo -e "${lightred}$line${nc}" # client response 96 | error=$(expr $error + 1) 97 | ;; 98 | 5[0-9][0-9]) echo -e "${lightred}$line${nc}" # server response 99 | error=$(expr "$error" + 1) 100 | ;; 101 | esac 102 | echo -ne "${wht}[found ${cyan}$total ${wht}$lnktp: ${lightgreen}$success OK ${wht}| ${orange}$redirected Redirected ${wht}| ${lightred}$error Broken${wht}]${nc}\r" # progress 103 | 104 | done < <(scrape_urls $1 $2) # command substitution 105 | 106 | if [ $total -eq 0 -a $# -ne 0 ]; then 107 | echo -e "${wht}[found ${cyan}$total ${wht}$lnktp: ${lightgreen}$success OK ${wht}| ${orange}$redirected Redirected ${wht}| ${lightred}$error Broken${wht}]${nc}" # print in case no urls are found 108 | fi 109 | } 110 | 111 | url_check $1 $2 112 | 113 | exit 0 114 | -------------------------------------------------------------------------------- /Contruibuting.md: -------------------------------------------------------------------------------- 1 | # Contruibuting Guidelines 2 | 3 | While on one hand our repository is a good place for beginners to contribute something useful to open source, on the other hand it is also a good place for experienced people to contribute something useful to open source. We welcome contributions from everyone. 4 | However some people tend to spam the repository with irrelevant pull requests and get one PR for hacktoberfest and other such open source events. We do not want that to happen. So we have a few guidelines that we would like you to follow. 5 | In case we find your PR not relevant or spam, we will mark it as invalid and it will not be counted towards hacktoberfest. 6 | -------------------------------------------------------------------------------- /Golang/Bitcoin_Price_Tracker/Readme.md: -------------------------------------------------------------------------------- 1 | # Bitcoin_Price_Tracker 2 | 3 | A script used to fetch the live price of 1 BTC in INR, written in GOlang. [Colly package](https://github.com/gocolly/colly) is used as a base for the web scraping and tag search. 4 | 5 | 6 | ## Setup instructions 7 | 8 | After forking the repository on your local machine, follow these commands on your terminal: 9 | ```shell 10 | cd Rotten-Scripts/Go/Bitcoin_Price_Tracker 11 | go build main.go 12 | go run main.go 13 | ``` 14 | 15 | ## Detailed explanation of script 16 | 17 | The code uses **colly package** for scraping and **fmt package** for display. 18 | The *main()* function calls the *give_current_price_of_bitcoin()* which calls an instance of colly's collector to scrape with a boolean based condition to exit out of the target 19 | search. 20 | 21 | ## Output 22 | 23 | ![output](https://i.imgur.com/EBJDky5.gif) 24 | -------------------------------------------------------------------------------- /Golang/Bitcoin_Price_Tracker/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/manas221/Rotten-Scripts 2 | 3 | go 1.16 4 | 5 | require ( 6 | github.com/PuerkitoBio/goquery v1.6.1 // indirect 7 | github.com/andybalholm/cascadia v1.2.0 // indirect 8 | github.com/antchfx/htmlquery v1.2.3 // indirect 9 | github.com/antchfx/xmlquery v1.3.5 // indirect 10 | github.com/antchfx/xpath v1.1.11 // indirect 11 | github.com/gobwas/glob v0.2.3 // indirect 12 | github.com/gocolly/colly v1.2.0 // indirect 13 | github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect 14 | github.com/golang/protobuf v1.5.2 // indirect 15 | github.com/kennygrant/sanitize v1.2.4 // indirect 16 | github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect 17 | github.com/temoto/robotstxt v1.1.2 // indirect 18 | golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c // indirect 19 | golang.org/x/text v0.3.6 // indirect 20 | google.golang.org/appengine v1.6.7 // indirect 21 | ) 22 | -------------------------------------------------------------------------------- /Golang/Bitcoin_Price_Tracker/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/gocolly/colly" 7 | ) 8 | 9 | func main() { 10 | give_current_price_of_bitcoin() 11 | } 12 | 13 | func give_current_price_of_bitcoin() { 14 | c := colly.NewCollector( 15 | colly.AllowedDomains("google.com", "www.google.com"), 16 | ) 17 | 18 | //bool variable to close the search after target tag is found 19 | found := false 20 | 21 | c.OnHTML("div", func(e *colly.HTMLElement) { 22 | 23 | if found { 24 | return 25 | } 26 | 27 | if e.Attr("class") == "BNeawe iBp4i AP7Wnd" { 28 | fmt.Printf("1 BTC = %s\n", e.Text) 29 | found = true 30 | } 31 | }) 32 | 33 | //webpage url to be visited 34 | c.Visit("https://www.google.com/search?q=bitcoin+price") 35 | } 36 | -------------------------------------------------------------------------------- /Golang/GIF_Creator/README.md: -------------------------------------------------------------------------------- 1 | # Video/Images to GIF converter in golang 2 | 3 | ## Use [ffmpeg](https://ffmpeg.org/) before using script 4 | 5 | ### Steps to run: 6 | 7 | 1. gitclone 8 | 2. go install gifgen.go 9 | 3. gifgen -s (image/video) -i (input path for images directory) - o (output path for generated gif) 10 | 11 | 12 | -------------------------------------------------------------------------------- /Golang/GIF_Creator/convert/convert.go: -------------------------------------------------------------------------------- 1 | package convert 2 | 3 | import ( 4 | "os/exec" 5 | ) 6 | 7 | func ConvertFiles(path string, output string) error { 8 | 9 | ffmpeg := exec.Command("ffmpeg", "-i", path, "-r", "5", output) 10 | if err := ffmpeg.Run(); err != nil { 11 | return err 12 | } 13 | return nil 14 | } 15 | -------------------------------------------------------------------------------- /Golang/GIF_Creator/gifgen.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "gif/convert" 7 | "image" 8 | "image/color/palette" 9 | "image/draw" 10 | "image/gif" 11 | _ "image/jpeg" 12 | "io/ioutil" 13 | "os" 14 | ) 15 | 16 | var option, output, input string 17 | var delay int 18 | 19 | func main() { 20 | 21 | flag.StringVar(&option, "s", "", "s=image for image to GIF and s=video for video to GIT") 22 | flag.StringVar(&input, "i", "", "path to the folder containing images") 23 | flag.StringVar(&output, "o", "output.gif", "the name of the generated GIF") 24 | flag.Parse() 25 | 26 | if input == "" { 27 | fmt.Println("A path is required") 28 | flag.PrintDefaults() 29 | return 30 | } 31 | if output == "" { 32 | output = "genrated.gif" 33 | flag.PrintDefaults() 34 | return 35 | } 36 | if option == "" { 37 | fmt.Println("Enter image if you want to convert image to gif or else enter video") 38 | flag.PrintDefaults() 39 | return 40 | } 41 | if option == "image" { 42 | imagetoGIF(input, output) 43 | } else if option == "video" { 44 | videoToGIF(input, output) 45 | } 46 | 47 | } 48 | 49 | func videoToGIF(path string, output string) { 50 | 51 | err := convert.ConvertFiles(path, output) 52 | if err != nil { 53 | fmt.Println(err) 54 | fmt.Println("error in converting") 55 | } 56 | } 57 | func imagetoGIF(path string, output string) { 58 | 59 | delay := 3 60 | files, err := ioutil.ReadDir(path) 61 | if err != nil { 62 | fmt.Println(err) 63 | return 64 | } 65 | 66 | anim := gif.GIF{} 67 | for _, info := range files { 68 | f, err := os.Open(path + "/" + info.Name()) 69 | if err != nil { 70 | fmt.Printf("Could not open file %s. Error: %s\n", info.Name(), err) 71 | return 72 | } 73 | defer f.Close() 74 | img, _, _ := image.Decode(f) 75 | 76 | // Image has to be palleted before going into the GIF 77 | paletted := image.NewPaletted(img.Bounds(), palette.Plan9) 78 | draw.FloydSteinberg.Draw(paletted, img.Bounds(), img, image.ZP) 79 | 80 | anim.Image = append(anim.Image, paletted) 81 | anim.Delay = append(anim.Delay, delay*100) 82 | } 83 | 84 | f, _ := os.Create(output) 85 | defer f.Close() 86 | gif.EncodeAll(f, &anim) 87 | } 88 | -------------------------------------------------------------------------------- /Golang/GIF_Creator/gifs/g.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Golang/GIF_Creator/gifs/g.gif -------------------------------------------------------------------------------- /Golang/GIF_Creator/gifs/gif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Golang/GIF_Creator/gifs/gif.gif -------------------------------------------------------------------------------- /Golang/GIF_Creator/go.mod: -------------------------------------------------------------------------------- 1 | module gif 2 | 3 | go 1.13 4 | -------------------------------------------------------------------------------- /Golang/Github_UserName_Checker/README.md: -------------------------------------------------------------------------------- 1 | # Github-UserName-Generator 2 | 3 | This is Go script used to generate the possible UserName for Github. 4 | 5 | ### Prerequisites: 6 | 7 | Go 8 | 9 | ### Process: 10 | 11 | ```go 12 | $ go get -u github.com/badoux/goscraper 13 | $ go run main.go 14 | ``` 15 | 16 | ![image](https://i.imgur.com/MRcCiCP.png) 17 | -------------------------------------------------------------------------------- /Golang/Github_UserName_Checker/go.mod: -------------------------------------------------------------------------------- 1 | module Github-userName-checker 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/badoux/goscraper v0.0.0-20190827161153-36995ce6b19f 7 | golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect 8 | ) 9 | -------------------------------------------------------------------------------- /Golang/Github_UserName_Checker/go.sum: -------------------------------------------------------------------------------- 1 | github.com/badoux/goscraper v0.0.0-20190827161153-36995ce6b19f h1:K7yQFgSzse/bjP0DaNlmgdlg8u0HiIQax0HdTGnaMaY= 2 | github.com/badoux/goscraper v0.0.0-20190827161153-36995ce6b19f/go.mod h1:5iU5AiceCVP7wmrAIn/9YhJzvmErX/GihV/T2o5QUpM= 3 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 4 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 5 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 6 | golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4= 7 | golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 8 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 9 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 10 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 11 | golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= 12 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 13 | -------------------------------------------------------------------------------- /Golang/Github_UserName_Checker/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/csv" 5 | "flag" 6 | "fmt" 7 | "log" 8 | "os" 9 | 10 | "github.com/badoux/goscraper" 11 | ) 12 | 13 | func main() { 14 | fmt.Println("Welcome to Github_UserName_Checker\n Rules:\n1.Github username may only contain alphanumeric characters or hyphens.\n2.Github username cannot have multiple consecutive hyphens.\n3.Github username cannot begin or end with a hyphen.\n4.Maximum is 39 characters.") 15 | getInput() 16 | } 17 | 18 | func getInput() { 19 | fmt.Println("\n\nEnter the Initial_Name: ") 20 | var initialName string 21 | 22 | _, err := fmt.Scanln(&initialName) 23 | if err != nil { 24 | log.Fatal("error occured while taking input : ", err) 25 | } 26 | 27 | length := len(initialName) 28 | 29 | switch checkerror(initialName, length) { 30 | case 1: 31 | fmt.Println("Read the Rules carefully:\nUsername must only alphanumeric character") 32 | getInput() 33 | case 2: 34 | fmt.Println("Read the Rules carefully:\nHyphens not allowed at begining") 35 | getInput() 36 | case 3: 37 | fmt.Println("Read the Rules carefully:\nHyphens not allowed at end") 38 | getInput() 39 | case 4: 40 | fmt.Println("Read the Rules carefully:\nLength should not be greater than 39 characters") 41 | getInput() 42 | case 5: 43 | fmt.Println("Read the Rules carefully:\nConsecutive hyphen not allowed") 44 | getInput() 45 | case 6: 46 | checkUserName(initialName) 47 | } 48 | 49 | } 50 | 51 | func checkerror(initialName string, length int) int { 52 | if notAlphaNumeric(initialName, length) { 53 | return 1 54 | } 55 | if initialName[0] == '-' { 56 | return 2 57 | } 58 | if length == 39 && initialName[length-1] == '-' { 59 | return 3 60 | } 61 | if length > 39 { 62 | return 4 63 | } 64 | if doubleHyphen(initialName, length) { 65 | return 5 66 | } 67 | return 6 68 | } 69 | func checkUserName(username string) { 70 | finalusername := username 71 | counter := 0 72 | for i := 48; i <= 57; i++ { 73 | if ping(finalusername) { 74 | counter++ 75 | fmt.Printf("%v. %v\n", counter, finalusername) 76 | } 77 | finalusername = username + string(i) 78 | } 79 | for i := 65; i <= 90; i++ { 80 | finalusername = username + string(i) 81 | if ping(finalusername) { 82 | counter++ 83 | fmt.Printf("%v. %v\n", counter, finalusername) 84 | } 85 | } 86 | csvFileName := flag.String("csv", "postfix.csv", "csv file in the formate of questions and answer") 87 | flag.Parse() 88 | file, err := os.Open(*csvFileName) 89 | if err != nil { 90 | log.Fatalln("Opening file failed: ", err) 91 | } 92 | 93 | r := csv.NewReader(file) 94 | lines, err := r.ReadAll() 95 | if err != nil { 96 | log.Fatalln("file parsing failed: ", err) 97 | } 98 | 99 | for _, line := range lines { 100 | finalusername = username + line[0] 101 | if ping(finalusername) { 102 | counter++ 103 | fmt.Printf("%v. %v\n", counter, finalusername) 104 | } 105 | } 106 | 107 | if counter == 0 { 108 | fmt.Println("No Id with initial_name found") 109 | } 110 | 111 | } 112 | 113 | func ping(finalusername string) bool { 114 | finalurl := "https://github.com/" + finalusername 115 | 116 | s, err := goscraper.Scrape(finalurl, 10) 117 | if err != nil { 118 | fmt.Println("Scrapping failed : ", err) 119 | } 120 | //fmt.Printf("Title : %s\n", s.Preview.Title) 121 | if s.Preview.Title == "Build software better, together" { 122 | return true 123 | } 124 | return false 125 | } 126 | 127 | func notAlphaNumeric(username string, length int) bool { 128 | for i := 0; i < length; i++ { 129 | switch int(username[i]) { 130 | case 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122: 131 | default: 132 | return true 133 | } 134 | } 135 | return false 136 | } 137 | 138 | func doubleHyphen(name string, length int) bool { 139 | for i := 0; i < length-1; i++ { 140 | if name[i] == '-' && name[i+1] == '-' { 141 | return true 142 | } 143 | } 144 | return false 145 | 146 | } 147 | -------------------------------------------------------------------------------- /Golang/Github_UserName_Checker/postfix.csv: -------------------------------------------------------------------------------- 1 | 1990 2 | 1989 3 | 1991 4 | 1992 5 | 1993 6 | 1994 7 | 1995 8 | 1996 9 | 1997 10 | 1998 11 | 1999 12 | 2000 13 | 2001 14 | 2002 15 | 2003 16 | 2004 17 | 2005 18 | 2006 19 | 2007 20 | 2010 21 | 2020 22 | Stark 23 | Helpchicken 24 | Chisholmdetailed 25 | Erispofty 26 | Megawardle 27 | Apiradius 28 | Testiclespinching 29 | Fickledapert 30 | Lovablefruit 31 | Tarsetlegacy 32 | Obituaryfamiliar 33 | Sandstormpentland 34 | Jovialfrustum 35 | Yearlingcatena 36 | Appliedrush 37 | Filmsdeserve 38 | Pousseastronomy 39 | Chracaiggastrin 40 | Portfoliolandfill 41 | Poesuno 42 | bridleeerie 43 | Sweetartistic 44 | Resortsqueamish 45 | Certificatesheer 46 | Matehead 47 | Yardsulfide 48 | Boyelbow 49 | Vicinityram 50 | Foolresidence 51 | Openheeping 52 | Skiffinsbrody 53 | Sharegnaw 54 | Nephewtrucker 55 | Exaltedrich 56 | Harvesttiny 57 | Pradadumpster 58 | Oozemonkey 59 | Flashlightbanshee 60 | Glorytacky 61 | Poofreeboard 62 | Leadenmorning 63 | Paprikabaroque 64 | Duckingrepulsive 65 | Aldusneglector 66 | Domelikestonework 67 | Paraffingreater 68 | surrenderdominance 69 | paralegalannoyance 70 | boastfulevaporate 71 | threadshaft 72 | scourgeteen 73 | jonnyentity 74 | yodelblasphemy 75 | durtreesperform 76 | doudywax 77 | stadiummodulo 78 | cropleyhouse 79 | wirelessail 80 | selectedpolicy 81 | crecksanguine 82 | royalbuzz 83 | slimmedial 84 | yemenirebuild 85 | willtoday 86 | causalskinless 87 | translateskeletal 88 | violinsnap 89 | labrenegade 90 | beachsoundcloud 91 | sprigbungee 92 | danceunderstanding 93 | nodulesenlisted 94 | yardstash 95 | gigletglope 96 | fillerauto 97 | strapquiet 98 | percentageprotozoan 99 | rideoverjoyed 100 | daybreakeye 101 | dishonestfilling 102 | jorkinspecan 103 | oxbirdshone 104 | insectbark 105 | upperdonut 106 | jockstrapaware 107 | outerexchange 108 | macarenaabbey 109 | twentiethpincers 110 | concertwallow 111 | herospan 112 | saunaattendee 113 | scootbleak 114 | patienceslum 115 | acidicdatabase 116 | breakregister 117 | widowammonia 118 | greasytipp 119 | saintperky 120 | joystickstockings 121 | marzpetty 122 | charlieragefilled 123 | herbthinly 124 | garlickygallows 125 | bakingpyroxene 126 | planeelwy 127 | mousyomit 128 | nextdoorlara 129 | mimosaevolution 130 | presumefiz 131 | fonduecabinet 132 | felineensure 133 | filedrab 134 | kilbrideguiding 135 | firechargebulbous 136 | skatepostcard 137 | prawnsglottle 138 | bobtailarbitrate 139 | foamgore 140 | bristlerace 141 | landlessupgrade 142 | quarterlyrandom 143 | fetchfibber 144 | quickestacts 145 | bisteddemocracy 146 | groupunharmed 147 | disbeliefaground 148 | chikypegs 149 | parchmentknowledge 150 | familypig 151 | taxidriverbroke 152 | anguishedsanctuary 153 | pranksaddlebag 154 | summersonsociety 155 | ennuiwoodchat 156 | hushedoptical 157 | bubblinglewdster 158 | perkyabdominal 159 | overcrowdgalaxy 160 | hopperprevalent 161 | betsytupperware 162 | langeredbollar 163 | retailpobster 164 | wheysproys 165 | tabletresupply 166 | enchantingdynamite 167 | zonewall 168 | shonevocation 169 | holylangdale 170 | chollybackward 171 | crapreeve 172 | rutpear 173 | caucasianmonsoon 174 | syringesinitiated 175 | glovestumbling 176 | frighteneggplant 177 | peaksholedeficient 178 | lowlyunlikable 179 | icepackbobbing 180 | amazonspirketting 181 | nuttersullivan 182 | pageamong 183 | leanpubavalanche 184 | uselesslycarwinley 185 | foggyhowdy 186 | epilepticguy 187 | sulfitepauper 188 | poppysweetie 189 | chariotfullscreen 190 | unvisitedwarleggan 191 | dumpyobtain 192 | shoddydad 193 | tobycrinkly 194 | robbingwildcat 195 | oppositetwist 196 | bivvystuffed 197 | analoguehalting 198 | unisonsummer 199 | windartless 200 | radiationjuly 201 | uncombedjuggle 202 | quickstepore 203 | xericlovaton 204 | specifiedgalette 205 | spiritsdingdong 206 | evidentoral 207 | antarcticesragan 208 | sprungcouplekiss 209 | steinbachyawl 210 | acclimateaction 211 | watchstays 212 | acceleratorhaptic 213 | pedestrianshanghai 214 | mississippiexpert 215 | malechillingwood 216 | snowflaketrustful 217 | cellairline 218 | afocaltrossy 219 | civiliantor 220 | elmcotton 221 | manholepotterson 222 | itinerarynissan 223 | -------------------------------------------------------------------------------- /Javascript/Amazon_Price_Tracker/ReadMe.md: -------------------------------------------------------------------------------- 1 | # Amazon Price Tracker 2 | 3 | A Script to track prices of products from Amazon. 4 | 5 | ## Setup 6 | 7 | 1. Clone the folder. 8 | 2. Open command line and change the directory to your folder by using ```cd foldername```. 9 | 3. Run the command ```npm install```. 10 | 4. Then run the script using command ```node index.js```. 11 | 12 | # Output 13 | 14 | ![output-video] https://urlzs.com/9WgxH 15 | 16 | ![img] https://urlzs.com/gqyCG 17 | 18 | # Author 19 | 20 | [Harsh Kaushik](https://github.com/haarsh01) 21 | -------------------------------------------------------------------------------- /Javascript/Amazon_Price_Tracker/index.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const cheerio = require('cheerio'); 3 | const cron = require('node-cron'); 4 | const nodemailer = require('nodemailer') 5 | const fetchPrice = async(url, targetPrice) =>{ 6 | const response = await axios.get(url); 7 | const html = response.data; 8 | const $ = cheerio.load(html); 9 | const priceText = $('#priceblock_ourprice').text(); 10 | const price = parseFloat(priceText.replace('$','')); 11 | if(targetPrice >= price){ 12 | sendEmail(url,price); 13 | }else{ 14 | console.log('too expensive'); 15 | } 16 | } 17 | const sendEmail = async (url, price) => { 18 | const testAccount = await nodemailer.createTestAccount(); 19 | const transport = nodemailer.createTransport({ 20 | host:'smtp.ethereal.email', 21 | port: 587, 22 | secure: false, 23 | auth:{ 24 | user: testAccount.user, 25 | pass:testAccount.pass, 26 | } 27 | 28 | }); 29 | const info = await transport.sendMail({ 30 | from:'"UI Infinity" ', 31 | to:'test@test.com', 32 | subject:'amazon watcher', 33 | text:`${price} - ${url}`, 34 | html:`

${price}

${url}

`, 35 | }); 36 | console.log(nodemailer.getTestMessageUrl(info)); 37 | } 38 | 39 | const watchPrice = (priceTaget, url, schedule = '*/5 * * * * *') => { 40 | cron.schedule(schedule, () => fetchPrice(url, priceTaget)); 41 | }; 42 | -------------------------------------------------------------------------------- /Javascript/Amazon_Price_Tracker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "amazon-price-tracker", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "axios": "^0.21.1", 13 | "cheerio": "^1.0.0-rc.6", 14 | "node-cron": "^3.0.0", 15 | "nodemailer": "^6.5.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Javascript/Automate_Tinder/Readme.md: -------------------------------------------------------------------------------- 1 | # Automate Tinder 2 | 3 | Too bored of Right-Swiping Tinder? This Script allows you to automate Right-Swipes on Tinder. You just need to go to the Official Website 4 | and kickstart the Developer Console and push the Code. Press ENTER and let the magic redeem itself. 5 | 6 | [Not be used for Malicious Purposes] 7 | 8 | ![image](https://i.imgur.com/IJAGTVq.png) 9 | -------------------------------------------------------------------------------- /Javascript/Automate_Tinder/automateTinder.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Too bored of Right-Swiping Tinder? This Script allows you to automate Right-Swipes on Tinder. You just need to go to the Official Website 4 | and kickstart the Developer Console and push the Code. Press ENTER and let the magic redeem itself. 5 | 6 | */ 7 | 8 | a = setInterval( 9 | function(){ 10 | var elem = document.getElementsByClassName("button Lts($ls-s) Z(0) Cur(p) Tt(u) Bdrs(50%) P(0) Fw($semibold) recsGamepad__button D(b) Bgc(#fff) Wc($transform) End(15px) Scale(1.1):h"); 11 | elem[0].click() 12 | },2000) 13 | -------------------------------------------------------------------------------- /Javascript/Blog_Image_Finder/ImageFinder.js: -------------------------------------------------------------------------------- 1 | // All DOM variables 2 | let container = document.querySelector('.container'); 3 | 4 | // Enter your Unsplash API key here 5 | let key = ''; 6 | 7 | let btn = document.querySelector('#btn'); 8 | let input = document.querySelector('#query'); 9 | 10 | // function to retrieve photos from unsplash API 11 | async function getPhotos(reqURL){ 12 | let res = await fetch(reqURL); 13 | let data = await res.json(); 14 | console.log(data); 15 | if(data.results.length){ 16 | for(let i = 0; i < data.results.length; i++){ 17 | let img = document.createElement('img'); 18 | img.src = data.results[i].links.download; 19 | img.height = "200"; 20 | img.width = "200"; 21 | container.appendChild(img); 22 | img.addEventListener('click',()=>{ 23 | alert(img.src); 24 | }) 25 | } 26 | }else{ 27 | alert('No images Found for this input!'); 28 | } 29 | } 30 | 31 | // init function 32 | function init(){ 33 | let word = input.value; 34 | input.value = ""; 35 | container.textContent = ""; 36 | let reqURL = `https://api.unsplash.com/search/photos?per_page=30&query=${word}&client_id=${key}`; 37 | getPhotos(reqURL); 38 | } 39 | 40 | // Setting up all event listeners 41 | btn.addEventListener('click', init); 42 | document.addEventListener("keypress",e =>{ 43 | if(e.which === 13)init(); 44 | }) 45 | -------------------------------------------------------------------------------- /Javascript/Blog_Image_Finder/README.md: -------------------------------------------------------------------------------- 1 | # Script in JS used to get images 2 | 3 | ## About 4 | 5 | Blogs are like caffeine for writers for which they always tries to find interesting stuffs(images/quotes/GIFs) to encourage readers to read even a long blog.Now, Blogs are of various genres, so it is very difficult for a writes to get apt images to insert in their blog. So, I've developed a script which is very much easy to use and which can find 20+ images instantly and also provides the link(Unsplash link). 6 | 7 | ## Explanation of code 8 | 9 | - unsplash API is used to fetch all [images](https://api.unsplash.com/search/photos?per_page=30&query=[word]&client_id=[key]) 10 | - An API key is required to use the API in your app, which can easily be obtained from [unsplash official website](https://unsplash.com/developers). 11 | - Async/Await is used to consume promises. 12 | - Script is dependent on a basic boilerplate HTML file, which displays all the images retrieved by the script. 13 | - To get link of any image, just click on that, a pop-up/alert window with link will appear. 14 | 15 | ## To run the code 16 | 17 | - Clone the folder 18 | - Inside the folder open index.html or in some editor you can use live-server to run HTML file. 19 | - Then search images of which category/genre you want. 20 | 21 | ## Output 22 | ![image](https://i.imgur.com/jiTQVJf.png) 23 | 24 | Made by [Piyush Gupta](https://github.com/gupta-piyush19) 25 | -------------------------------------------------------------------------------- /Javascript/Blog_Image_Finder/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Blog Image Finder 7 | 19 | 20 | 21 |

Blog Image Finder

22 | 23 | 24 |
25 | 26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Subhradeep Samanta 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Python/21_NUMBER_GAME/21NumberGame.py: -------------------------------------------------------------------------------- 1 | # Python code to play 21 Number game 2 | 3 | # returns the nearest multiple to 4 4 | def nearestMultiple(num): 5 | if num >= 4: 6 | near = num + (4 - (num % 4)) 7 | else: 8 | near = 4 9 | return near 10 | 11 | def lose1(): 12 | print ("\n\nYOU LOSE !") 13 | print("Better luck next time !") 14 | exit(0) 15 | 16 | # checks whether the numbers are consecutive 17 | def check(xyz): 18 | i = 1 19 | while i ') 33 | 34 | # player takes the first chance 35 | if chance == "F": 36 | while True: 37 | if last == 20: 38 | lose1() 39 | else: 40 | print ("\nYour Turn.") 41 | print ("\nHow many numbers do you wish to enter?") 42 | inp = int(input('> ')) 43 | 44 | if inp > 0 and inp <= 3: 45 | comp = 4 - inp 46 | else: 47 | print ("Wrong input. You are disqualified from the game.") 48 | lose1() 49 | 50 | i, j = 1, 1 51 | 52 | print ("Now enter the values") 53 | while i <= inp: 54 | a = input('> ') 55 | a = int(a) 56 | xyz.append(a) 57 | i = i + 1 58 | 59 | # store the last element of xyz. 60 | last = xyz[-1] 61 | 62 | # checks whether the input 63 | # numbers are consecutive 64 | if check(xyz) == True: 65 | if last == 21: 66 | lose1() 67 | 68 | else: 69 | #"Computer's turn." 70 | while j <= comp: 71 | xyz.append(last + j) 72 | j = j + 1 73 | print ("Order of inputs after computer's turn is: ") 74 | print (xyz) 75 | last = xyz[-1] 76 | else: 77 | print ("\nYou did not input consecutive integers.") 78 | lose1() 79 | 80 | # player takes the second chance 81 | elif chance == "S": 82 | comp = 1 83 | last = 0 84 | while last < 20: 85 | #"Computer's turn" 86 | j = 1 87 | while j <= comp: 88 | xyz.append(last + j) 89 | j = j + 1 90 | print ("Order of inputs after computer's turn is:") 91 | print (xyz) 92 | if xyz[-1] == 20: 93 | lose1() 94 | 95 | else: 96 | print ("\nYour turn.") 97 | print ("\nHow many numbers do you wish to enter?") 98 | inp = input('> ') 99 | inp = int(inp) 100 | i = 1 101 | print ("Enter your values") 102 | while i <= inp: 103 | xyz.append(int(input('> '))) 104 | i = i + 1 105 | last = xyz[-1] 106 | if check(xyz) == True: 107 | # print (xyz) 108 | near = nearestMultiple(last) 109 | comp = near - last 110 | if comp == 4: 111 | comp = 3 112 | else: 113 | comp = comp 114 | else: 115 | # if inputs are not consecutive 116 | # automatically disqualified 117 | print ("\nYou did not input consecutive integers.") 118 | # print ("You are disqualified from the game.") 119 | lose1() 120 | print ("\n\nCONGRATULATIONS !!!") 121 | print ("YOU WON !") 122 | exit(0) 123 | 124 | else: 125 | print ("wrong choice") 126 | 127 | 128 | game = True 129 | while game == True: 130 | print ("Player 2 is Computer.") 131 | print("Do you want to play the 21 number game? (Yes / No)") 132 | ans = input('> ') 133 | if ans =='Yes': 134 | start1() 135 | else: 136 | print ("Do you want quit the game?(yes / no)") 137 | nex = input('> ') 138 | if nex == "yes": 139 | print ("You are quitting the game...") 140 | exit(0) 141 | elif nex == "no": 142 | print ("Continuing...") 143 | else: 144 | print ("Wrong choice") 145 | 146 | -------------------------------------------------------------------------------- /Python/5FunctionCalculator/5functionCalculator.py: -------------------------------------------------------------------------------- 1 | # Program to make a 5 function calculator:- 2 | 3 | # This function adds two numbers 4 | def add(x, y): 5 | return x + y 6 | 7 | # This function subtracts two numbers 8 | def subtract(x, y): 9 | return x - y 10 | 11 | # This function multiplies two numbers 12 | def multiply(x, y): 13 | return x * y 14 | 15 | # This function divides two numbers 16 | def divide(x, y): 17 | return x / y 18 | 19 | # This function gives the remainder by dividing two numbers 20 | def remainder(x, y): 21 | return x % y 22 | 23 | 24 | print("Select operation:") 25 | print("1.Add") 26 | print("2.Subtract") 27 | print("3.Multiply") 28 | print("4.Divide") 29 | print("5.Remainder") 30 | 31 | while True: 32 | # take input from the user 33 | choice = input("Enter choice(1/2/3/4/5): ") 34 | 35 | # check if choice is one of the four options 36 | if choice in ('1', '2', '3', '4','5'): 37 | num1 = float(input("Enter first number: ")) 38 | num2 = float(input("Enter second number: ")) 39 | 40 | if choice == '1': 41 | print(num1, "+", num2, "=", add(num1, num2)) 42 | 43 | elif choice == '2': 44 | print(num1, "-", num2, "=", subtract(num1, num2)) 45 | 46 | elif choice == '3': 47 | print(num1, "*", num2, "=", multiply(num1, num2)) 48 | 49 | elif choice == '4': 50 | print(num1, "/", num2, "=", divide(num1, num2)) 51 | 52 | elif choice == '5': 53 | print(num1, "%", num2, "=", remainder(num1, num2)) 54 | 55 | # check if user wants another calculation 56 | # break the while loop if answer is no 57 | next_calculation = input("Let's do next calculation? (yes/no): ") 58 | if next_calculation == "no": 59 | break 60 | 61 | else: 62 | print("Invalid Input") -------------------------------------------------------------------------------- /Python/Acronyms Using Python/Acronyms_using_python.py: -------------------------------------------------------------------------------- 1 | user_input = str(input("Enter a Phrase: ")) 2 | text = user_input.split() 3 | a = " " 4 | for i in text: 5 | a = a+str(i[0]).upper() 6 | print(a) -------------------------------------------------------------------------------- /Python/Auto typer/auto_typer.py: -------------------------------------------------------------------------------- 1 | import pyautogui 2 | import time 3 | time.sleep(10) 4 | pyautogui.typewrite("""CodeSpeedy - Coding Solution & Software Development 5 | A Place Where You Find Solutions In Coding And Programming For PHP, WordPress, HTML, CSS, JavaScript, Python, C++ and much more.""",interval=0.3) -------------------------------------------------------------------------------- /Python/AutomatedCalling/autocall.py: -------------------------------------------------------------------------------- 1 | """ please go through the docs before running this scripts """ 2 | 3 | from twilio.rest import Client 4 | 5 | print("\n" + " ***** WELCOME TO AUTOMATED PYTHONz SCRIPT ***** ") 6 | print(" ***** PLEASE CREATE A TWILIO ACCOUNT BEFORE USING THE SCRIPT ***** ") 7 | print(" ***** TO CREATE TWILIO ACCOUNT GO TO WWW.TWILIO.COM ***** ") 8 | print(" ***** TYPE 'YES/yes' IF YOU WANT TO PROCEED ***** "+'\n') 9 | i = input() 10 | print("\n") 11 | 12 | 13 | if (i == "YES" or i == "yes"): 14 | account_sid = input(" ENTER YOUR TWILIO ACCOUNT-SID ") 15 | auth_token = input(" ENTER YOUR TWILIO AUTH-TOKEN ") 16 | 17 | client = Client(account_sid,auth_token) 18 | 19 | print("**** press 1 for single phone number *****") 20 | print("**** press 2 for multiple phone numbers *****") 21 | i = int(input()) 22 | 23 | if (i == 1): 24 | print(" ***** PLEASE ENTER RECIEVER's NUMBER **note mention your country code followed by '+' *****") 25 | number = int(input()) 26 | print(" ***** PLEASE ENTER YOUR AUTOGENERATED NUMBER **note mention your country code followed by '+' *****") 27 | my_number = int(input()) 28 | """ client.calls.create will be responsible for the call process 29 | also here url is the reponse urls , i.e whatever you want to 30 | give as a response to the reciever you can give by simply creating your 31 | own at twilio.com, since it is a trail we have used trail response 32 | 33 | 'to' attribute specifies whom you want to dial 34 | 'from' attribute specifies from which number the receiver will receive the call 35 | **note that number will be auto genrated in the trail process 36 | 37 | """ 38 | call = client.calls.create( 39 | url='http://demo.twilio.com/docs/voice.xml', 40 | to=number, 41 | from_=my_number 42 | ) 43 | print(" call success ") 44 | 45 | if (i == 2): 46 | print(" ***** PLEASE ENTER RECIEVER's NUMBER SEPARTED BY SPACE **note mention your country code followed by '+' *****") 47 | number = list(int (i) for i in input().strip().split(' ')) 48 | print(" ***** PLEASE ENTER YOUR AUTOGENERATED NUMBER **note mention your country code followed by '+' *****") 49 | my_number = int(input()) 50 | """ client.calls.create will be responsible for the call process 51 | also here url is the reponse urls , i.e whatever you want to 52 | give as a response to the reciever you can give by simply creating your 53 | own at twilio.com, since it is a trail we have used trail response 54 | 55 | 'to' attribute specifies whom you want to dial 56 | 'from' attribute specifies from which number the receiver will receive the call 57 | **note that number will be auto genrated in the trail process 58 | 59 | """ 60 | for i in number: 61 | call = client.calls.create( 62 | url='http://demo.twilio.com/docs/voice.xml', 63 | to=i, 64 | from_=my_number 65 | ) 66 | print(" call success to the number " + str(i)) 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /Python/AutomatedCalling/instruction.txt: -------------------------------------------------------------------------------- 1 | This is an automated calling script genrated using python it uses twilio for 2 | sending messages thus to use this script you have to create twilio account 3 | 4 | To create twilio account log in to twilio website 5 | 6 | after completing the registration you will receive various credentials 7 | such as auth_token , account s_id , messaging s_id and one auto_generated mobile number 8 | 9 | requirement : 10 | 11 | twilio client 12 | 13 | installation : pip install twilio -------------------------------------------------------------------------------- /Python/Automatic Birthday mail/Automatic_Birthday_mail.py: -------------------------------------------------------------------------------- 1 | # import required packages 2 | import pandas as pd 3 | import datetime 4 | import smtplib 5 | import time 6 | import requests 7 | from win10toast import ToastNotifier 8 | 9 | # your gmail credentials here 10 | GMAIL_ID = 'your_email_here' 11 | GMAIL_PWD = 'your_password_here' 12 | 13 | # for desktop notification 14 | toast = ToastNotifier() 15 | 16 | # define a function for sending email 17 | def sendEmail(to, sub, msg): 18 | 19 | # connection to gmail 20 | gmail_obj = smtplib.SMTP('smtp.gmail.com', 587) 21 | 22 | # starting the session 23 | gmail_obj.starttls() 24 | 25 | # login using credentials 26 | gmail_obj.login(GMAIL_ID, GMAIL_PWD) 27 | 28 | # sending email 29 | gmail_obj.sendmail(GMAIL_ID, to, 30 | f"Subject : {sub}\n\n{msg}") 31 | 32 | # quit the session 33 | gmail_obj.quit() 34 | 35 | print("Email sent to " + str(to) + " with subject " 36 | + str(sub) + " and message :" + str(msg)) 37 | 38 | toast.show_toast("Email Sent!" , 39 | f"{name} was sent e-mail", 40 | threaded = True, 41 | icon_path = None, 42 | duration = 6) 43 | 44 | while toast.notification_active(): 45 | time.sleep(0.1) 46 | 47 | # define a function for sending sms 48 | def sendsms(to, msg, name, sub): 49 | 50 | url = "https://www.fast2sms.com/dev/bulk" 51 | payload = f"sender_id=FSTSMS&message={msg}&language=english&route=p&numbers={to}" 52 | 53 | headers = { 54 | 'authorization': "API_KEY_HERE", 55 | 'Content-Type': "application/x-www-form-urlencoded", 56 | 'Cache-Control': "no-cache", 57 | } 58 | 59 | response_obj = requests.request("POST", url, 60 | data = payload, 61 | headers = headers) 62 | print(response_obj.text) 63 | print("SMS sent to " + str(to) + " with subject :" + 64 | str(sub) + " and message :" + str(msg)) 65 | 66 | toast.show_toast("SMS Sent!" , 67 | f"{name} was sent message", 68 | threaded = True, 69 | icon_path = None, 70 | duration = 6) 71 | 72 | while toast.notification_active(): 73 | time.sleep(0.1) 74 | 75 | # driver code 76 | if __name__=="__main__": 77 | 78 | # read the excel sheet having all the details 79 | dataframe = pd.read_excel("excelsheet.xlsx") 80 | 81 | # today date in format : DD-MM 82 | today = datetime.datetime.now().strftime("%d-%m") 83 | 84 | # current year in format : YY 85 | yearNow = datetime.datetime.now().strftime("%Y") 86 | 87 | # writeindex list 88 | writeInd = [] 89 | 90 | for index,item in dataframe.iterrows(): 91 | 92 | msg = "Many Many Happy Returns of the day dear " + str(item['NAME']) 93 | 94 | # stripping the birthday in excel 95 | # sheet as : DD-MM 96 | bday = item['Birthday'].strftime("%d-%m") 97 | 98 | # condition checking 99 | if (today == bday) and yearNow not in str(item['Year']): 100 | 101 | # calling the sendEmail function 102 | sendEmail(item['Email'], "Happy Birthday", 103 | msg) 104 | 105 | # calling the sendsms function 106 | sendsms(item['Contact'], msg, item['NAME'], 107 | "Happy Birthday") 108 | 109 | writeInd.append(index) 110 | 111 | for i in writeInd: 112 | 113 | yr = dataframe.loc[i,'Year'] 114 | 115 | # this will record the years in which 116 | # email has been sent 117 | dataframe.loc[i,'Year'] = str(yr) + ',' + str(yearNow) 118 | 119 | dataframe.to_excel('excelsheet.xlsx', 120 | index = False) 121 | -------------------------------------------------------------------------------- /Python/Automating Happy Birthday post on Facebook/happy_birthday.py: -------------------------------------------------------------------------------- 1 | # importing necessary classes 2 | # from different modules 3 | from selenium import webdriver 4 | from selenium.webdriver.common.by import By 5 | from selenium.webdriver.support.ui import WebDriverWait 6 | from selenium.webdriver.support import expected_conditions as EC 7 | from selenium.webdriver.chrome.options import Options 8 | from selenium.common.exceptions import TimeoutException 9 | from selenium.webdriver.common.keys import Keys 10 | import time 11 | 12 | chrome_options = webdriver.ChromeOptions() 13 | 14 | prefs = {"profile.default_content_setting_values.notifications": 2} 15 | chrome_options.add_experimental_option("prefs", prefs) 16 | browser = webdriver.Chrome("chromedriver.exe") 17 | 18 | # open facebook.com using get() method 19 | browser.get('https://www.facebook.com/') 20 | 21 | # user_name or e-mail id 22 | username = "agrawal.abhi108@gmail.com" 23 | 24 | # getting password from text file 25 | with open('test.txt', 'r') as myfile: 26 | password = myfile.read().replace('\n', '') 27 | 28 | print("Let's Begin") 29 | 30 | element = browser.find_elements_by_xpath('//*[@id ="email"]') 31 | element[0].send_keys(username) 32 | 33 | print("Username Entered") 34 | 35 | element = browser.find_element_by_xpath('//*[@id ="pass"]') 36 | element.send_keys(password) 37 | 38 | print("Password Entered") 39 | 40 | # logging in 41 | log_in = browser.find_elements_by_id('loginbutton') 42 | log_in[0].click() 43 | 44 | print("Login Successful") 45 | 46 | browser.get('https://www.facebook.com/events/birthdays/') 47 | 48 | feed = 'Happy Birthday !' 49 | 50 | element = browser.find_elements_by_xpath("//*[@class ='enter_submit\ 51 | uiTextareaNoResize uiTextareaAutogrow uiStreamInlineTextarea\ 52 | inlineReplyTextArea mentionsTextarea textInput']") 53 | 54 | cnt = 0 55 | 56 | for el in element: 57 | cnt += 1 58 | element_id = str(el.get_attribute('id')) 59 | XPATH = '//*[@id ="' + element_id + '"]' 60 | post_field = browser.find_element_by_xpath(XPATH) 61 | post_field.send_keys(feed) 62 | post_field.send_keys(Keys.RETURN) 63 | print("Birthday Wish posted for friend" + str(cnt)) 64 | 65 | # Close the browser 66 | browser.close() 67 | -------------------------------------------------------------------------------- /Python/BMI Calculator/BMI_Calculator.py: -------------------------------------------------------------------------------- 1 | Height=float(input("Enter your height in centimeters: ")) 2 | Weight=float(input("Enter your Weight in Kg: ")) 3 | Height = Height/100 4 | BMI=Weight/(Height*Height) 5 | print("your Body Mass Index is: ",BMI) 6 | if(BMI>0): 7 | if(BMI<=16): 8 | print("you are severely underweight") 9 | elif(BMI<=18.5): 10 | print("you are underweight") 11 | elif(BMI<=25): 12 | print("you are Healthy") 13 | elif(BMI<=30): 14 | print("you are overweight") 15 | else: print("you are severely overweight") 16 | else:("enter valid details") -------------------------------------------------------------------------------- /Python/Basic Calculator/main.py: -------------------------------------------------------------------------------- 1 | import tkinter 2 | 3 | expression="" 4 | def press(num): 5 | global expression 6 | expression = expression + str(num) 7 | command.set(expression) 8 | 9 | def equalpress(): 10 | try: 11 | global expression 12 | total=str(eval(expression)) 13 | command.set(total) 14 | expression="" 15 | except: 16 | command.set("error") 17 | expression="" 18 | 19 | def clear(): 20 | global expression 21 | expression ="" 22 | command.set("") 23 | top=tkinter.Tk() 24 | top.title("Calculator") 25 | top.tk_focusFollowsMouse() 26 | top.geometry('300x300') 27 | 28 | command=tkinter.StringVar() 29 | display=tkinter.Entry(top,textvariable=command) 30 | display.grid(columnspan=4,ipadx=80) 31 | button1 = tkinter.Button(top, text=' 1 ', fg='black', bg='white', 32 | command=lambda: press(1), height=3, width=6) 33 | button1.grid(row=2, column=0) 34 | 35 | button2 = tkinter.Button(top, text=' 2 ', fg='black', bg='white', 36 | command=lambda: press(2), height=3, width=6) 37 | button2.grid(row=2, column=1) 38 | 39 | button3 = tkinter.Button(top, text=' 3 ', fg='black', bg='white', 40 | command=lambda: press(3), height=3, width=6) 41 | button3.grid(row=2, column=2) 42 | 43 | button4 = tkinter.Button(top, text=' 4 ', fg='black', bg='white', 44 | command=lambda: press(4), height=3, width=6) 45 | button4.grid(row=3, column=0) 46 | 47 | button5 = tkinter.Button(top, text=' 5 ', fg='black', bg='white', 48 | command=lambda: press(5), height=3, width=6) 49 | button5.grid(row=3, column=1) 50 | 51 | button6 = tkinter.Button(top, text=' 6 ', fg='black', bg='white', 52 | command=lambda: press(6), height=3, width=6) 53 | button6.grid(row=3, column=2) 54 | 55 | button7 = tkinter.Button(top, text=' 7 ', fg='black', bg='white', 56 | command=lambda: press(7), height=3, width=6) 57 | button7.grid(row=4, column=0) 58 | 59 | button8 = tkinter.Button(top, text=' 8 ', fg='black', bg='white', 60 | command=lambda: press(8), height=3, width=6) 61 | button8.grid(row=4, column=1) 62 | 63 | button9 = tkinter.Button(top, text=' 9 ', fg='black', bg='white', 64 | command=lambda: press(9), height=3, width=6) 65 | button9.grid(row=4, column=2) 66 | 67 | button0 = tkinter.Button(top, text=' 0 ', fg='black', bg='white', 68 | command=lambda: press(0), height=3, width=6) 69 | button0.grid(row=5, column=0) 70 | 71 | plus = tkinter.Button(top, text=' + ', fg='black', bg='white',command=lambda: press("+"), height=3, width=9) 72 | plus.grid(row=2, column=3) 73 | 74 | minus = tkinter.Button(top, text=' - ', fg='black', bg='white',command=lambda: press("-"), height=3, width=9) 75 | minus.grid(row=3, column=3) 76 | 77 | multiply = tkinter.Button(top, text=' * ', fg='black', bg='white',command=lambda: press("*"), height=3, width=9) 78 | multiply.grid(row=4, column=3) 79 | 80 | divide = tkinter.Button(top, text=' / ', fg='black', bg='white',command=lambda: press("/"), height=3, width=9) 81 | divide.grid(row=5, column=3) 82 | 83 | equal = tkinter.Button(top, text=' = ', fg='black', bg='red',command=equalpress, height=3, width=6) 84 | equal.grid(row=5, column=2) 85 | 86 | clear = tkinter.Button(top, text='Clear', fg='black', bg='yellow',command=clear, height=3, width=6) 87 | clear.grid(row=5, column=1) 88 | 89 | Decimal=tkinter.Button(top, text='.', fg='black', bg='white',command=lambda: press('.'), height=3, width=6) 90 | Decimal.grid(row=6, column=0) 91 | 92 | top.mainloop() -------------------------------------------------------------------------------- /Python/Bitcoin Address Validator/btc_address_validator.py: -------------------------------------------------------------------------------- 1 | """ 2 | Usage: python btc_address_validator.py 3 | 4 | Example: $ python btc_address_validator.py 1DJJoJ4sxwJdwExTsoDg8qXL1FEozDGQEFA ─╯ 5 | Output: Address with type Bitcoin Address is not a valid Bitcoin address. 6 | 7 | Example: $ python btc_address_validator.py 1P5ZEDWTKTFGxQjZphgWPQUpe554WKDfHQ ─╯ 8 | Output: Address with type Bitcoin Address is a valid Bitcoin address. 9 | """ 10 | 11 | from base58 import b58decode 12 | from hashlib import sha256 13 | import sys 14 | 15 | # Taking the bitcoin address as command line input 16 | btc_address_to_validate = sys.argv[1] 17 | 18 | if __name__ == "__main__": 19 | 20 | btc_address_decoded = b58decode(btc_address_to_validate) 21 | 22 | version_plus_payload = btc_address_decoded[:-4] 23 | checksum_found = btc_address_decoded[-4:] 24 | 25 | # calculate real checksum 26 | checksum_real = sha256(sha256(version_plus_payload).digest()).digest()[:4] 27 | 28 | address_type = None 29 | version_prefix = version_plus_payload.hex()[0:8] 30 | if version_prefix[0:2] == "00": 31 | address_type = "Bitcoin Address" 32 | elif version_prefix[0:2] == "05": 33 | address_type = "Pay-to-Script-Hash Address" 34 | elif version_prefix[0:2] == "6F": 35 | address_type = "Bitcoin Testnet Address" 36 | elif version_prefix[0:2] == "80": 37 | address_type = "Private Key WIF" 38 | elif version_prefix[0:4] == "0142": 39 | address_type = "BIP-38 Encrypted Private Key" 40 | elif version_prefix[0:8] == "0488B21E": 41 | address_type = "BIP-32 Extended Public Key" 42 | 43 | if checksum_real == checksum_found: 44 | print(f"Address with type {address_type} is a valid Bitcoin address.") 45 | else: 46 | print(f"Address with type {address_type} is not a valid Bitcoin address.") -------------------------------------------------------------------------------- /Python/CSV to Excel/CSV to Excel.py: -------------------------------------------------------------------------------- 1 | 2 | import openpyxl 3 | import sys 4 | 5 | #inputs 6 | print("This programme writes the data in any Comma-separated value file (such as: .csv or .data) to a Excel file.") 7 | print("The input and output files must be in the same directory of the python file for the programme to work.\n") 8 | 9 | csv_name = input("Name of the CSV file for input (with the extension): ") 10 | sep = input("Separator of the CSV file: ") 11 | excel_name = input("Name of the excel file for output (with the extension): ") 12 | sheet_name = input("Name of the excel sheet for output: ") 13 | 14 | #opening the files 15 | try: 16 | wb = openpyxl.load_workbook(excel_name) 17 | sheet = wb.get_sheet_by_name(sheet_name) 18 | 19 | file = open(csv_name,"r",encoding = "utf-8") 20 | except: 21 | print("File Error!") 22 | sys.exit() 23 | 24 | #rows and columns 25 | row = 1 26 | column = 1 27 | 28 | #for each line in the file 29 | for line in file: 30 | #remove the \n from the line and make it a list with the separator 31 | line = line[:-1] 32 | line = line.split(sep) 33 | 34 | #for each data in the line 35 | for data in line: 36 | #write the data to the cell 37 | sheet.cell(row,column).value = data 38 | #after each data column number increases by 1 39 | column += 1 40 | 41 | #to write the next line column number is set to 1 and row number is increased by 1 42 | column = 1 43 | row += 1 44 | 45 | #saving the excel file and closing the csv file 46 | wb.save(excel_name) 47 | file.close() -------------------------------------------------------------------------------- /Python/CSV to Excel/requirements.txt: -------------------------------------------------------------------------------- 1 | openpyxl -------------------------------------------------------------------------------- /Python/Cartooning an Image/main.py: -------------------------------------------------------------------------------- 1 | class Cartoonizer 2 | Cartoonizer effect 3 | A class that applies a cartoon effect to an image. 4 | The class uses a bilateral filter and adaptive thresholding to create 5 | a cartoon effect. 6 | 7 | def __init__(self) 8 | pass 9 | 10 | def render(self, img_rgb) 11 | img_rgb = cv2.imread(img_rgb) 12 | img_rgb = cv2.resize(img_rgb, (1366,768)) 13 | numDownSamples = 2 # number of downscaling steps 14 | numBilateralFilters = 50 # number of bilateral filtering steps 15 | 16 | # -- STEP 1 -- 17 | 18 | # downsample image using Gaussian pyramid 19 | img_color = img_rgb 20 | for _ in range(numDownSamples) 21 | img_color = cv2.pyrDown(img_color) 22 | 23 | #cv2.imshow(downcolor,img_color) 24 | #cv2.waitKey(0) 25 | # repeatedly apply small bilateral filter instead of applying 26 | # one large filter 27 | for _ in range(numBilateralFilters) 28 | img_color = cv2.bilateralFilter(img_color, 9, 9, 7) 29 | 30 | #cv2.imshow(bilateral filter,img_color) 31 | #cv2.waitKey(0) 32 | # upsample image to original size 33 | for _ in range(numDownSamples) 34 | img_color = cv2.pyrUp(img_color) 35 | #cv2.imshow(upscaling,img_color) 36 | #cv2.waitKey(0) 37 | 38 | # -- STEPS 2 and 3 -- 39 | # convert to grayscale and apply median blur 40 | img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_RGB2GRAY) 41 | img_blur = cv2.medianBlur(img_gray, 3) 42 | #cv2.imshow(grayscale+median blur,img_color) 43 | #cv2.waitKey(0) 44 | 45 | # -- STEP 4 -- 46 | # detect and enhance edges 47 | img_edge = cv2.adaptiveThreshold(img_blur, 255, 48 | cv2.ADAPTIVE_THRESH_MEAN_C, 49 | cv2.THRESH_BINARY, 9, 2) 50 | #cv2.imshow(edge,img_edge) 51 | #cv2.waitKey(0) 52 | 53 | # -- STEP 5 -- 54 | # convert back to color so that it can be bit-ANDed with color image 55 | (x,y,z) = img_color.shape 56 | img_edge = cv2.resize(img_edge,(y,x)) 57 | img_edge = cv2.cvtColor(img_edge, cv2.COLOR_GRAY2RGB) 58 | cv2.imwrite(edge.png,img_edge) 59 | #cv2.imshow(step 5, img_edge) 60 | #cv2.waitKey(0) 61 | #img_edge = cv2.resize(img_edge,(i for i in img_color.shape[2])) 62 | #print img_edge.shape, img_color.shape 63 | return cv2.bitwise_and(img_color, img_edge) 64 | 65 | tmp_canvas = Cartoonizer() 66 | 67 | file_name = Screenshot.png #File_name will come here 68 | res = tmp_canvas.render(file_name) 69 | 70 | cv2.imwrite(Cartoon version.jpg, res) 71 | cv2.imshow(Cartoon version, res) 72 | cv2.waitKey(0) 73 | cv2.destroyAllWindows() 74 | -------------------------------------------------------------------------------- /Python/ConvertUnit/README.md: -------------------------------------------------------------------------------- 1 | # Unit Converter 2 | 3 | A Simple Python Script to help convert values within their Metric systems. 4 | 5 | ## Installation 6 | - Install Python if you already haven't. 7 | 8 | ## Usage 9 | ```bash 10 | python3 unit_converter.py -f -t 11 | ``` 12 | 13 | ``` 14 | usage: unit_coverter.py [-h] -f FROM_TYPE -t TO_TYPE value 15 | 16 | positional arguments: 17 | value The value to convert. 18 | 19 | options: 20 | -h, --help show this help message and exit 21 | -f FROM_TYPE, --from_type FROM_TYPE 22 | The Metric unit type to Convert from. 23 | -t TO_TYPE, --to_type TO_TYPE 24 | The Metric unit type to Convert to. 25 | ``` 26 | -------------------------------------------------------------------------------- /Python/ConvertUnit/unit_coverter.py: -------------------------------------------------------------------------------- 1 | import enum 2 | import argparse 3 | 4 | 5 | class LengthUnits(enum.Enum): 6 | """ Common Units of Measurement for Length """ 7 | centimeterss = 0.01 8 | meters = 1 9 | kilometers = 1000 10 | millimeters = 0.001 11 | miles = 1609.344 12 | yards = 0.9144 13 | foot = 0.3048 14 | inches = 0.0254 15 | 16 | 17 | class WeightUnits(enum.Enum): 18 | """ Common Units of Measurement for Weight """ 19 | milligrams = 0.001 20 | grams = 1 21 | kilograms = 1000 22 | centigrams = 0.01 23 | pounds = 453.592 24 | ounces = 28.3495 25 | ton = 907185 26 | 27 | 28 | types_tree = { 29 | "centimeter": LengthUnits.centimeterss, 30 | "cm": LengthUnits.centimeterss, 31 | "centimeters": LengthUnits.centimeterss, 32 | "meter": LengthUnits.meters, 33 | "m": LengthUnits.meters, 34 | "meters": LengthUnits.meters, 35 | "kilometer": LengthUnits.kilometers, 36 | "km": LengthUnits.kilometers, 37 | "kilometers": LengthUnits.kilometers, 38 | "millimeter": LengthUnits.millimeters, 39 | "mm": LengthUnits.millimeters, 40 | "millimeters": LengthUnits.millimeters, 41 | "mile": LengthUnits.miles, 42 | "mi": LengthUnits.miles, 43 | "miles": LengthUnits.miles, 44 | "yard": LengthUnits.yards, 45 | "yd": LengthUnits.yards, 46 | "yards": LengthUnits.yards, 47 | "feet": LengthUnits.foot, 48 | "ft": LengthUnits.foot, 49 | "foot": LengthUnits.foot, 50 | "inch": LengthUnits.inches, 51 | "in": LengthUnits.inches, 52 | "inches": LengthUnits.inches, 53 | "milligram": WeightUnits.milligrams, 54 | "mg": WeightUnits.milligrams, 55 | "milligrams": WeightUnits.milligrams, 56 | "gram": WeightUnits.grams, 57 | "g": WeightUnits.grams, 58 | "grams": WeightUnits.grams, 59 | "kilogram": WeightUnits.kilograms, 60 | "kg": WeightUnits.kilograms, 61 | "kilograms": WeightUnits.kilograms, 62 | "centigram": WeightUnits.centigrams, 63 | "cg": WeightUnits.centigrams, 64 | "centigrams": WeightUnits.centigrams, 65 | "pound": WeightUnits.pounds, 66 | "lb": WeightUnits.pounds, 67 | "pounds": WeightUnits.pounds, 68 | "ounce": WeightUnits.ounces, 69 | "oz": WeightUnits.ounces, 70 | "ounces": WeightUnits.ounces, 71 | "ton": WeightUnits.ton, 72 | "t": WeightUnits.ton, 73 | "tons": WeightUnits.ton 74 | } 75 | 76 | 77 | def init_args(): 78 | parser = argparse.ArgumentParser() 79 | parser.add_argument( 80 | '-f', '--from_type', help="The Metric unit type to Convert from.", 81 | required=True 82 | ) 83 | parser.add_argument( 84 | '-t', '--to_type', help="The Metric unit type to Convert to.", 85 | required=True 86 | ) 87 | parser.add_argument("value", help="The value to convert.") 88 | args = parser.parse_args() 89 | return args 90 | 91 | 92 | def convert(from_type_str, to_type_str, value_raw): 93 | 94 | try: 95 | from_type = types_tree[from_type_str.lower()] 96 | to_type = types_tree[to_type_str.lower()] 97 | except KeyError: 98 | raise ValueError("Invalid Unit Type.") 99 | 100 | try: 101 | value = float(value_raw) 102 | except ValueError: 103 | raise ValueError("Invalid Value. Must be a Float acceptable number.") 104 | 105 | if from_type.__class__ != to_type.__class__: 106 | raise Exception("Cannot convert between two different metric systems.") 107 | 108 | convert_value = value * from_type.value / to_type.value 109 | print(f"{convert_value} {to_type.name}") 110 | 111 | 112 | if __name__ == "__main__": 113 | args = init_args() 114 | convert(args.from_type, args.to_type, args.value) 115 | -------------------------------------------------------------------------------- /Python/Cryptocurrency Price Alert/CryptocurrencyPriceAlert.py: -------------------------------------------------------------------------------- 1 | # A python script that alerts you by opening your portfolio webpage on browser when a cryptocurrency hits a certain price. 2 | 3 | ''' 4 | Example: If MATIC hits $0.80 or more, it will automatically open a webpage (crypto trade) on the user's browser. 5 | 6 | (it will run in background using cronjob) 7 | 8 | Use case: Crypto prices are highly volatile and there are no stop loss or good alert systems in many exchange platforms. This will help the user to stay updated with the crypto price trend while they do other tasks. 9 | ''' 10 | 11 | # cryptocompare is a library that fetches the cryptocurrency prices 12 | # more details about the library: https://pypi.org/project/cryptocompare/ 13 | # you can install it using: pip install cryptocompare 14 | 15 | from cryptocompare import get_price as gp 16 | 17 | # webbrowser opens the default webbrowser of the system 18 | from webbrowser import open as op 19 | 20 | # define prices 21 | # get_price returns 22 | # {'SYMBOL': {'USD': 1.000}} 23 | # nested [foo][bar] to get value in float 24 | 25 | # note: only use what you need, comment rest, this will save time fetching the prices 26 | 27 | BTC = gp('BTC', currency='USD')['BTC']['USD'] 28 | MATIC = gp('MATIC', currency='USD')['MATIC']['USD'] 29 | # ETH = gp('ETH', currency='USD')['ETH']['USD'] 30 | # ADA = gp('ADA', currency='USD')['ADA']['USD'] 31 | # SOL = gp('SOL', currency='USD')['SOL']['USD'] 32 | # XRP = gp('XRP', currency='USD')['XRP']['USD'] 33 | # CRO = gp('CRO', currency='USD')['CRO']['USD'] 34 | # DOT = gp('DOT', currency='USD')['DOT']['USD'] 35 | # XLM = gp('XLM', currency='USD')['XLM']['USD'] 36 | # SHIB = gp('SHIB', currency='USD')['SHIB']['USD'] 37 | # ALGO = gp('ALGO', currency='USD')['ALGO']['USD'] 38 | # NEAR = gp('NEAR', currency='USD')['NEAR']['USD'] 39 | # ATOM = gp('ATOM', currency='USD')['ATOM']['USD'] 40 | 41 | 42 | # retrieve prices and compare 43 | # if the condition satisfies, use the webbrowser module to open relevant links 44 | 45 | if MATIC <= 1.42: 46 | # this will open the chart page on coinmarketcap 47 | op('https://coinmarketcap.com/currencies/polygon/') 48 | 49 | # this opens the page to your cryptocurrency exchange platform 50 | op('https://coindcx.com/insta/buy/matic') 51 | 52 | #if BTC >= 45000.0: 53 | # op('https://coinmarketcap.com/currencies/bitcoin/') 54 | # op('https://coindcx.com/insta/sell/btc') 55 | 56 | # use this script in cronjob 57 | # crontab -e 58 | # * * * * * python3 /home/username/path/to/cryptalert.py 59 | 60 | # After you add this to cronjob, this script will run every minute 61 | # You can change this using https://crontab-generator.org/ -------------------------------------------------------------------------------- /Python/CurrencyConversionRates/Currency_Conversion_Rates.py: -------------------------------------------------------------------------------- 1 | import json 2 | import sys 3 | import urllib.request 4 | 5 | if len(sys.argv) != 3: 6 | print("Usage: ./currencyrates.py lookup_currency base_currency. Example: ./currencyrates.py cad usd") 7 | sys.exit() 8 | 9 | currency = sys.argv[1] 10 | basecurrency = sys.argv[2] 11 | 12 | currencyurl = "http://freecurrencyrates.com/api/action.php?do=cvals&iso=" + currency + "&f=" + basecurrency + "&v=1&s=cbr" 13 | f = urllib.request.urlopen(currencyurl) 14 | obj = json.loads(f.read()) 15 | result = "1 " + currency.upper() + " is " 16 | result+="{:,.2f}".format(1/obj[currency.upper()]) + " " + basecurrency.upper() 17 | 18 | print(result); -------------------------------------------------------------------------------- /Python/CurrencyConversionRates/README.md: -------------------------------------------------------------------------------- 1 | # Description # 2 | You’ve probably looked up conversion rates using your browser, but here’s how to automate the task of finding the current exchange rate between any two currencies. 3 | 4 | 5 | 6 | ## How to run this ## 7 | * git clone https://github.com/Subhradeep10/Automation-Scripts-Using-Python 8 | * Open your terminal 9 | * Run python Currency_Conversion_Rates.py usd inr 10 | 11 | -------------------------------------------------------------------------------- /Python/Curve Fitting Script/Curve_Fitting.py: -------------------------------------------------------------------------------- 1 | import Data_Input 2 | import tkinter 3 | import csv 4 | import matplotlib.pyplot as plt 5 | import numpy as np 6 | 7 | #Closing Window Function 8 | def close_win(): 9 | top.destroy() 10 | exit(0) 11 | 12 | #Curve Fitting Function 13 | def pull(ch): 14 | n = 0 15 | X = 0 16 | Y = 0 17 | sum_of_y = 0 18 | sum_of_x = 0 19 | sum_of_xsquare = 0 20 | sum_of_xy = 0 21 | sum_of_xcube = 0 22 | sum_of_xquad = 0 23 | sum_of_yxsquare = 0 24 | choice = ch 25 | f = open(r"Curve Fitting Script\data.csv") 26 | text = csv.reader(f) 27 | for i in text: 28 | if (i == []): 29 | break 30 | sum_of_x += float(i[0]) 31 | sum_of_y += float(i[1]) 32 | sum_of_xy += (float(i[0]) * float(i[1])) 33 | sum_of_xsquare += float(i[0])**2 34 | sum_of_xcube += float(i[0])**3 35 | sum_of_xquad += float(i[0])**4 36 | sum_of_yxsquare += (float(i[0])**2) * float(i[1]) 37 | n += 1 38 | next(text) 39 | if (choice == 1): 40 | a = round(((n * sum_of_xy) - (sum_of_y * sum_of_x)) / 41 | (n * sum_of_xsquare - (sum_of_x**2)), 3) 42 | b = round( 43 | ((sum_of_y - ((n * sum_of_xy - (sum_of_x * sum_of_y)) / 44 | (n * sum_of_xsquare - sum_of_x**2) * sum_of_x)) / n), 45 | 3) 46 | if (b < 0): 47 | plt.title("y=({})x+({})".format(a, b)) 48 | Y = a 49 | X = -b / a 50 | else: 51 | Y = b 52 | X = -a / b 53 | plt.title("y=({})x+({})".format(b, a)) 54 | xpoints = np.array([0, X]) 55 | ypoints = np.array([0, Y]) 56 | plt.plot(xpoints, ypoints) 57 | plt.show() 58 | elif (choice == 2): 59 | A = np.array([[n, sum_of_x, sum_of_xsquare], 60 | [sum_of_x, sum_of_xsquare, sum_of_xcube], 61 | [sum_of_xsquare, sum_of_xcube, sum_of_xquad]]) 62 | B = np.array([sum_of_y, sum_of_xy, sum_of_yxsquare]) 63 | try: 64 | C = np.linalg.solve(A, B) 65 | plt.title("y=({:.2f})x^2+({:.2f})x+({:.2f})".format( 66 | C[0], C[1], C[2])) 67 | x = np.linspace(-10, 10, 100) 68 | y = C[0] * x**2 + C[1] * x + C[2] 69 | plt.plot(x, y) 70 | plt.show() 71 | except: 72 | print("Singular Error ") 73 | plt.show() 74 | plt.clf() 75 | 76 | 77 | #Main Function 78 | top = tkinter.Tk() 79 | top.title("CURVE FITTING") 80 | top.tk_focusFollowsMouse() 81 | top.geometry("300x160") 82 | one = tkinter.Button(top, 83 | text="Straight Line", 84 | command=lambda: pull(1), 85 | height=8, 86 | width=12,bg='green') 87 | one.grid(row=1, column=1) 88 | two = tkinter.Button(top, 89 | text="Parabola", 90 | command=lambda: pull(2), 91 | height=8, 92 | width=12,bg='blue') 93 | two.grid(row=1, column=2) 94 | exitbutton = tkinter.Button(top, 95 | text="EXIT", 96 | command=lambda:close_win(), 97 | height=8, 98 | width=12,bg='red') 99 | exitbutton.grid(row=1,column=3) 100 | top.mainloop() 101 | top.destroy() -------------------------------------------------------------------------------- /Python/Curve Fitting Script/Data_Input.py: -------------------------------------------------------------------------------- 1 | import csv 2 | 3 | f=open(r"Curve Fitting Script\data.csv",'w+') 4 | fw=csv.writer(f) 5 | t=int(input("Enter Number of Co-ordinates\n")) 6 | paras=[] 7 | for tt in range(t): 8 | print("Enter x and y Coordinates respectively\n") 9 | x,y = map(float,(input().split())) 10 | paras.append([x,y]) 11 | fw.writerows(paras) 12 | f.close() 13 | -------------------------------------------------------------------------------- /Python/Curve Fitting Script/data.csv: -------------------------------------------------------------------------------- 1 | 0.0,0.0 2 | 5.0,25.0 3 | -------------------------------------------------------------------------------- /Python/DNSCrawler/main.py: -------------------------------------------------------------------------------- 1 | from dns import resolver 2 | 3 | 4 | def get_records(domain): 5 | record_types = ["a", "mx", "txt", "cname"] 6 | records = [] 7 | searcher = resolver.Resolver() 8 | 9 | for record_type in record_types: 10 | try: 11 | search = searcher.resolve( 12 | domain if record_type != "cname" else f"www.{domain}", record_type 13 | ) 14 | for data in search: 15 | if record_type == "cname": 16 | records.append( 17 | "www" f" 14400s {str(record_type).upper()} {data}" 18 | ) 19 | else: 20 | records.append(f" 14400s {str(record_type).upper()} {data}") 21 | except: 22 | print(f'Failed to search the record type {record_type}') 23 | return records 24 | 25 | 26 | records = get_records('bbc.com') 27 | 28 | for r in records: 29 | print(r) 30 | -------------------------------------------------------------------------------- /Python/DNSCrawler/readme.md: -------------------------------------------------------------------------------- 1 | # DNS Crawler 2 | 3 | 4 | Place your domain in the function and get the DNS records. 5 | 6 | You can make a list of CNAME's and check if exists with bruteforce. 7 | 8 | Uses dnspython package. 9 | -------------------------------------------------------------------------------- /Python/DNSCrawler/requirements.txt: -------------------------------------------------------------------------------- 1 | dnspython 2 | -------------------------------------------------------------------------------- /Python/DataScraping/Data-Scraping.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from bs4 import BeautifulSoup 3 | import re 4 | import time 5 | 6 | 7 | def check_request(url): 8 | 9 | print(f'[+] Sending Request to {url}') 10 | time.sleep(1) #To avoid load on the server 11 | req = requests.get(url) 12 | 13 | print(f'[+] Request sent to {url}') 14 | 15 | #Checking the status code of the web page 16 | if req.status_code != 200: 17 | raise Exception(f'failed to load web page {url} {req.status_code}') 18 | return -1 19 | 20 | print(f'[+] Web Page Loaded Successfully') 21 | return req.text 22 | 23 | 24 | def url_check(url): 25 | 26 | url_pattern = "^https?:\\/\\/(?:www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b(?:[-a-zA-Z0-9()@:%_\\+.~#?&\\/=]*)$" 27 | 28 | #Checking the url in correct format or not 29 | if not(re.match(url_pattern, url)): 30 | 31 | print(f'ERROR: \"{url}\" URL SHOULD BE IN CORRECT FORMAT[EXAMPLE: https://google.com, https://stackoverflow.com/, ..]') 32 | return -1 33 | 34 | return 0 35 | 36 | 37 | def scraping(doc, tag, url): 38 | 39 | # Finding all the required the tags in the page 40 | data_collected = doc.find_all(tag) 41 | 42 | if len(data_collected) == 0: 43 | print(f'[-] There is no present in the given url {url} with {tag} tag') 44 | return -1 45 | 46 | print(f'[+] Data Present in the given url {url} with {tag} tags are: \n') 47 | for data in data_collected: 48 | print(data.text) # Printing the data in the tags 49 | 50 | 51 | def scrap_data(url, tag): 52 | 53 | url_check_status = url_check(url) 54 | if url_check_status == -1: 55 | print(f'[-] Execution Unsuccessful') 56 | return 57 | 58 | web_content = check_request(url) 59 | if web_content == -1: 60 | print(f'[-] Execution Unsuccessful') 61 | return 62 | 63 | doc = BeautifulSoup(web_content, 'html.parser') 64 | scraping(doc, tag, url) 65 | print('\n[+] Execution Successfully Completed') 66 | 67 | url = input('Enter/Paste The Url: ') 68 | tag = input('Enter the tag you wanna scrape. EX: p, h1, h2....: ') 69 | scrap_data(url, tag) 70 | 71 | -------------------------------------------------------------------------------- /Python/DataScraping/README.md: -------------------------------------------------------------------------------- 1 | # Data-Scraping 2 | 3 | Data scraping is the process of extracting and parsing data from websites in an automated fashion using a computer program. It's a useful technique for creating datasets for research and learning. It is developed using python3. 4 | 5 | ### Required Libraries 6 | - Requests 7 | - BeautifulSoup 8 | 9 | ### project outline: 10 | - After the execution of the enter the url of the web page that you want to scrape. 11 | - Next enter the html tag element to scrap particular tag. 12 | 13 | #### First Clone the Repo 14 | 15 | ``` 16 | git clone https://github.com/Subhradeep10/Automation-Scripts-Using-Python.git 17 | ``` 18 | #### Then move to the folder 19 | 20 | ``` 21 | cd Automation-Scripts-Using-Python/DataScraping 22 | ``` 23 | 24 | #### Install Requirements 25 | ``` 26 | pip install -r requirements.txt 27 | ``` 28 | #### Then execute the code 29 | From terminal 30 | ``` 31 | python Data-Scraping.py 32 | ``` -------------------------------------------------------------------------------- /Python/DataScraping/requirements.txt: -------------------------------------------------------------------------------- 1 | requests >= 2.24.0 2 | beautifulsoup4 >=4.9.1 -------------------------------------------------------------------------------- /Python/Dice Roller/dice_roller.py: -------------------------------------------------------------------------------- 1 | import random 2 | x = "y" 3 | 4 | while x == "y": 5 | 6 | # Generates a random number b/w 1 and 6 (including both 1 and 6) 7 | no = random.randint(1,6) 8 | 9 | if no == 1: 10 | print("1") 11 | 12 | if no == 2: 13 | print("2") 14 | 15 | if no == 3: 16 | print("3") 17 | 18 | if no == 4: 19 | print("4") 20 | 21 | if no == 5: 22 | print("5") 23 | 24 | if no == 6: 25 | print("6") 26 | 27 | x=input("Press Y to roll again or N to exit : ") -------------------------------------------------------------------------------- /Python/Email Validator/README.md: -------------------------------------------------------------------------------- 1 | # Email Validator with Python 2 | 3 | This is a script that takes input as an email address and checks whether the email address is valid or not. It contains checking static email address format as well as smtp server checking for better validation. 4 | 5 | 6 | ### Usage 7 | - Install the requirements 8 | - Run the script by 'python email_validator.py' 9 | - Input the email address to be validated when prompted 10 | 11 | 12 | ### Requirements 13 | ```pip install py3dns, pyfiglet, validate-email-address``` 14 | 15 | -------------------------------------------------------------------------------- /Python/Email Validator/email_validator.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Author: smit-sms 3 | 'pip install py3dns, pyfiglet, validate-email-address' to get all required libraries 4 | 5 | USAGE 6 | - Run the script by 'python email_validator.py' 7 | - Input the email address to be validated when prompted 8 | ''' 9 | 10 | 11 | import pyfiglet 12 | from validate_email_address import validate_email 13 | 14 | # printing the ascii banner 15 | print(pyfiglet.figlet_format(" Email Validator")) 16 | 17 | print('-'*72) 18 | email_id = input("Enter email address to be validated: ") 19 | print('-'*72) 20 | 21 | # Verifying the email id with the smtp server to check validity 22 | isvalid = validate_email(email_id, verify=True) 23 | 24 | if isvalid: 25 | print("\n\nThe following email address is Valid.\n") 26 | else: 27 | print("\n\nThe following email address is Invalid.\n") 28 | 29 | -------------------------------------------------------------------------------- /Python/File Converter/file_converter.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | 3 | filePath = input('Enter the path to the image: ') 4 | ext = filePath.split('/')[-1].split('.')[-1] 5 | folderPath = '/'.join(filePath.split('/')[:-1]) 6 | fileName = ''.join(filePath.split('/')[-1].split('.')[:-1]) 7 | 8 | if ext == 'png': 9 | img = Image.open(filePath) 10 | img.save(f'{folderPath}/{fileName}.jpg') 11 | else: 12 | img = Image.open(filePath) 13 | img.save(f'{folderPath}/{fileName}.png') -------------------------------------------------------------------------------- /Python/File Converter/requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow -------------------------------------------------------------------------------- /Python/File Renamer/fileRenamer.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | path = input('Enter the path to the files: ') 4 | 5 | metricsList = ( 6 | 'creation date', 7 | 'modification date', 8 | 'title', 9 | 'size' 10 | ) 11 | 12 | for count, i in enumerate(metricsList, start=1): 13 | print(f'{count}. {i}') 14 | 15 | metricsChoice = int(input("Enter the number corresponding to the metric: ")) 16 | commonName = input('\nEnter the common name for the files: ') 17 | 18 | filePaths = [] 19 | 20 | for i in os.listdir(path): 21 | filePaths.append(path + i) 22 | 23 | if metricsChoice == 1: 24 | filePaths.sort(key = os.path.getctime) 25 | elif metricsChoice == 2: 26 | filePaths.sort(key=os.path.getmtime) 27 | elif metricsChoice == 3: 28 | filePaths.sort() 29 | elif metricsChoice == 4: 30 | filePaths.sort(key=os.path.getsize) 31 | 32 | n = 1 33 | for src in filePaths: 34 | ext = src.split('.')[-1] 35 | os.rename(src, f'{path}/{commonName} {n}.{ext}') 36 | n += 1 -------------------------------------------------------------------------------- /Python/Google automated search/Google_automated_search.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | import sys 3 | 4 | # function to convert a list into string 5 | def convert(s): 6 | str1 = "" 7 | return(str1.join(s)) 8 | 9 | # Assign the arguments passed to a variable search_string 10 | search_string = sys.argv[1:] 11 | 12 | # The argument passed to the program is accepted 13 | # as list, it is needed to convert that into string 14 | search_string = convert(search_string) 15 | 16 | # This is done to structure the string 17 | # into search url.(This can be ignored) 18 | search_string = search_string.replace(' ', '+') 19 | 20 | 21 | # Assigning the browser variable with chromedriver of Chrome. 22 | # Any other browser and its respective webdriver 23 | # like geckodriver for Mozilla Firefox can be used 24 | browser = webdriver.Chrome('chromedriver') 25 | 26 | 27 | for i in range(1): 28 | matched_elements = browser.get("https://www.google.com/search?q=" + 29 | search_string + "&start=" + str(i)) 30 | -------------------------------------------------------------------------------- /Python/Google-Meet-automation-with-Python/README.md: -------------------------------------------------------------------------------- 1 | # Join Google Meet automatically with camera and microphone turned off 2 | 3 | ### This python script script uses Selenium to log into your gmail account at first to get all around access of google services and then joins the meeting link! 4 | 5 | ## Installation 6 | 7 | ### Navigate to the directory where you want to have this file. 8 | ### Clone this repo with ` $ git clone https://github.com/utkrixx/Google-Meet-automation-with-Python.git ` 9 | ### The required packages can be installed with 10 | 11 | > `pip install -r requirements.txt` 12 | 13 | ### A config.json file is used to store passwords, rather than hardcoding the password in the code. 14 | 15 | ## You should change the meeting links and time according to your needs from the ` main.py ` file. 16 | -------------------------------------------------------------------------------- /Python/Google-Meet-automation-with-Python/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "email": "", 3 | "password": "", 4 | } 5 | -------------------------------------------------------------------------------- /Python/Google-Meet-automation-with-Python/requirements.txt: -------------------------------------------------------------------------------- 1 | astroid==2.4.2 2 | certifi==2020.6.20 3 | chardet==3.0.4 4 | colorama==0.4.3 5 | configparser==5.0.0 6 | crayons==0.3.1 7 | idna==2.10 8 | isort==4.3.21 9 | lazy-object-proxy==1.4.3 10 | mccabe==0.6.1 11 | pylint==2.5.3 12 | python-nmap==0.6.1 13 | requests==2.24.0 14 | selenium==3.141.0 15 | six==1.15.0 16 | toml==0.10.1 17 | urllib3==1.25.9 18 | webdriver-manager==3.2.1 19 | wrapt==1.12.1 20 | -------------------------------------------------------------------------------- /Python/HowLongtoBeat Game/howlongtobeat.py: -------------------------------------------------------------------------------- 1 | from prettytable import PrettyTable 2 | from howlongtobeatpy import HowLongToBeat 3 | import asyncio 4 | while True: 5 | try: 6 | inp=input("Enter the Game Name: ") 7 | 8 | async def main(inp): 9 | global results_list 10 | results_list = await HowLongToBeat().async_search(inp) 11 | asyncio.run(main(inp)) 12 | 13 | if results_list is not None and len(results_list) > 0: 14 | best_element = max(results_list, key=lambda element: element.similarity) 15 | table = PrettyTable() 16 | table.title = best_element.game_name 17 | table.field_names = ['Game Type', 'Review Score (Out of 100)', 'Main Story Completion Time (in Hrs)','Main Story + Extra Completion Time (in Hrs)','Completionist Time (in Hrs)'] 18 | table.add_row([best_element.game_type,best_element.review_score,best_element.main_story,best_element.main_extra,best_element.completionist]) 19 | print(table) 20 | break; 21 | else: 22 | print("Enter a descriptive Name") 23 | except ValueError: 24 | print("Provide a correct name...") 25 | continue 26 | 27 | 28 | -------------------------------------------------------------------------------- /Python/HowLongtoBeat Game/requirements.txt: -------------------------------------------------------------------------------- 1 | howlongtobeatpy==1.0.2 2 | prettytable==3.4.1 -------------------------------------------------------------------------------- /Python/Image Fetcher/main.py: -------------------------------------------------------------------------------- 1 | import requests; 2 | from PIL import Image 3 | 4 | def img_requests(txt): 5 | response=requests.get("https://source.unsplash.com/random{0}".format(txt)) 6 | file=open('container.jpg','wb') 7 | file.write(response.content) 8 | img=Image.open(r"container.jpg") 9 | img.show() 10 | file.close 11 | 12 | #Main Function 13 | print("""Please provide an option for Image 14 | # 1, HD Random Picture 15 | # 2, FHD Random Picture 16 | # 3, 2K Random Picture 17 | # 4, 4k Random Picture 18 | # 5, Picture with User Provided Keywords """) 19 | #Takes User Choice 20 | ans=input() 21 | 22 | if 'one' in ans or '1' in ans: 23 | print("Please wait while we fetch the images from our database.") 24 | img_requests('/1280x720') 25 | elif 'two' in ans or '2' in ans: 26 | print("Please wait while we fetch the images from our database.") 27 | img_requests('/1920x1080') 28 | elif 'three' in ans or '3' in ans: 29 | print("Please wait while we fetch the images from our database.") 30 | img_requests('/2048x1080') 31 | elif 'four' in ans or '4' in ans: 32 | print("Please wait while we fetch the images from our database.") 33 | img_requests('/4096x2160') 34 | elif 'five' in ans or '5' in ans: 35 | print("speak keywords seperated by commas ") 36 | st=input() 37 | if 'comma' in st: 38 | st.replace('comma',',') 39 | st="?"+st 40 | print("Please wait while we fetch the images from our database.") 41 | img_requests(st) 42 | else: 43 | print("Please provide a valid Input") -------------------------------------------------------------------------------- /Python/Image-Resizer/README.md: -------------------------------------------------------------------------------- 1 | ## Image-Resizer 2 | 3 | Python script to resize a given image. Enter height and width when prompted. 4 | 5 | ``` 6 | python3 resize.py image_name 7 | ``` -------------------------------------------------------------------------------- /Python/Image-Resizer/resizer.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | import sys 3 | 4 | height = int(input("Enter image height: ")) 5 | width = int(input("Enter image width: ")) 6 | image = Image.open(sys.argv[1]) 7 | resized = image.resize((width, height)) 8 | resized.save('output.jpeg') 9 | -------------------------------------------------------------------------------- /Python/Instagram Reels Downloader/Instagram Reel Downloader.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from PIL import ImageTk, Image 3 | import tkinter.font as font 4 | from tkinter import messagebox 5 | from instascrape import Reel 6 | import time 7 | 8 | root =Tk() 9 | root.title("Instagram Reel Downloader") 10 | root.minsize(600,500) 11 | root.maxsize(600,500) 12 | HEIGHT = 500 13 | WIDTH = 600 14 | FONT = font.Font(family ="Times New Roman", size ="18", weight ="bold") 15 | 16 | 17 | def download(link): 18 | try: 19 | if (link): 20 | SESSIONID = "18614737527%3ApTLwFoXv5BZohu%3A4" 21 | headers = { 22 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.74 Safari/537.36 Edg/79.0.309.43", 23 | "cookie":f'sessionid={SESSIONID};' 24 | } 25 | 26 | google_reel=Reel(link) 27 | google_reel.scrape(headers=headers) 28 | google_reel.download(fp=f".\\reel{int(time.time())}.mp4") 29 | messagebox.showinfo("Status","Reel downloaded successfully") 30 | else: 31 | messagebox.showwarning("Empty field","Please fill out the field") 32 | except Exception as e: 33 | messagebox.showerror("Error","Something went wrong. Please try again later.") 34 | 35 | 36 | canvas = Canvas(root,height = HEIGHT, width = WIDTH) 37 | canvas.pack() 38 | 39 | frame=Frame(root,bg="white") 40 | frame.place(relwidth=1,relheight=1) 41 | 42 | background_image = ImageTk.PhotoImage(Image.open(r"C:\Users\ASUS\OneDrive\Desktop\Prof\copyassign\instareel\insta5.jpg")) 43 | background_label = Label(frame, image = background_image) 44 | background_label.place(relx=-0.25,relwidth = 0.7, relheight =1) 45 | 46 | 47 | label1 = Label(frame, text = "Download Reels in a Click!", font =FONT, bd =5, fg= "#0d1137",bg="white") 48 | label1.place(relx = 0.48, rely = 0.1, relheight =0.1) 49 | 50 | 51 | 52 | FONT = font.Font(family ="Times New Roman", size ="12", weight ="bold") 53 | label2 = Label(frame, text = "Enter link address: ", font =FONT, bd =5, fg= "#e52165",bg="white") 54 | label2.place(relx = 0.48, rely = 0.25, relheight =0.1) 55 | 56 | entry = Entry(frame, font = FONT, fg = "#fbad50") 57 | entry.place(relx = 0.48, rely = 0.35,relwidth=0.4, relheight = 0.05) 58 | 59 | button1 = Button(root, text = "Download", font = FONT, bg = "pink", fg = "black", activeforeground = "pink", activebackground = "black",command=lambda:download(entry.get())) 60 | button1.place(relx = 0.48,rely = 0.45,relwidth = 0.2, relheight = 0.06) 61 | 62 | label2 = Label(frame, text = "Instructions: ", font =FONT, bd =5, fg= "#0d1137",bg="white") 63 | label2.place(relx = 0.48, rely = 0.6, relheight =0.1) 64 | 65 | FONT = font.Font(family ="Times New Roman", size ="10", weight ="bold") 66 | TEXT="1.Only public account reels can be downloaded\n2.Enter the link address of reel from the Instagram\n3.This is not meant to be used for mischeif" 67 | label2 = Label(frame, text = TEXT, font =FONT, bd =5, fg= "#cd486b",justify=LEFT,bg="white") 68 | label2.place(relx = 0.48, rely = 0.7, relheight =0.1) 69 | 70 | 71 | 72 | root.mainloop() -------------------------------------------------------------------------------- /Python/Instagram bot/main.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | from selenium.common.exceptions import ElementClickInterceptedException 3 | from selenium.webdriver.common.by import By 4 | from selenium.webdriver.common.keys import Keys 5 | import time 6 | 7 | DRIVER_PATH = "DRIVER_PATH" 8 | USERNAME = "YOUR INSTAGRAM ACCOUNT USERNAME" 9 | PASSWORD = "YOUR INSTAGRAM ACCOUNT PASSWORD" 10 | SIMILAR_ACCOUNT = "ACCOUNT NAME YOU WANT TO FOLLOW FOLLOWERS OF" 11 | 12 | 13 | class InstaFollower: 14 | def __init__(self, path): 15 | self.driver = webdriver.Chrome(executable_path=path) 16 | 17 | def login(self): 18 | self.driver.get("https://www.instagram.com/accounts/login/") 19 | time.sleep(3) 20 | username = self.driver.find_element(By.NAME, 'username') 21 | password = self.driver.find_element(By.NAME, "password") 22 | 23 | username.send_keys(USERNAME) 24 | password.send_keys(PASSWORD) 25 | time.sleep(2) 26 | password.send_keys(Keys.ENTER) 27 | 28 | def find_followers(self): 29 | time.sleep(5) 30 | self.driver.get(f"https://www.instagram.com/{SIMILAR_ACCOUNT}") 31 | 32 | time.sleep(2) 33 | followers = self.driver.find_element_by_xpath( 34 | '//*[@id="react-root"]/div/div/section/main/div/header/section/ul/li[2]/a/div') 35 | followers.click() 36 | 37 | time.sleep(2) 38 | modal = self.driver.find_element(By.XPATH, '/html/body/div[6]/div/div/div/div[2]') 39 | for _ in range(10): 40 | self.driver.execute_script("arguments[0].scrollTop = arguments[0].scrollHeight", modal) 41 | time.sleep(2) 42 | 43 | def follow(self): 44 | all_buttons = self.driver.find_elements_by_css_selector("li button") 45 | for button in all_buttons: 46 | try: 47 | button.click() 48 | time.sleep(1) 49 | except ElementClickInterceptedException: 50 | cancel_button = self.driver.find_element_by_xpath('/html/body/div[7]/div/div/div/div[3]/button[2]') 51 | cancel_button.click() 52 | 53 | 54 | bot = InstaFollower(DRIVER_PATH) 55 | bot.login() 56 | bot.find_followers() 57 | bot.follow() 58 | 59 | 60 | -------------------------------------------------------------------------------- /Python/InternetSpeedTest/main.py: -------------------------------------------------------------------------------- 1 | ''' 2 | # Test Network Speed 3 | # pip install speedtest-cli 4 | ''' 5 | 6 | 7 | import speedtest 8 | 9 | st = speedtest.Speedtest() 10 | 11 | #fetch the download speed 12 | download = st.download() 13 | 14 | #fetch the upload speed 15 | upload = st.upload() 16 | 17 | #converting into mbps 18 | download = download/1000000 19 | upload = upload/1000000 20 | 21 | #display the result 22 | print("Download speed is", round(download, 3), 'Mbps') 23 | print("Upload speed is", round(upload, 3), 'Mbps') 24 | 25 | #fetch the ping 26 | st.get_servers([]) 27 | 28 | ping = st.results.ping 29 | 30 | #display the result 31 | print("Ping is", round(ping)) 32 | -------------------------------------------------------------------------------- /Python/JPG_to_PDF_Converter/convert.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | 3 | image_1 = Image.open(r'path') # here path = path where the image is stored\file name.png 4 | 5 | im_1 = image_1.convert('RGB') 6 | 7 | im_1.save(r'path') # here path = path where the pdf will be stored\new file name.pdf -------------------------------------------------------------------------------- /Python/JPG_to_PDF_Converter/mad_libs_generator.py/mad_libs.py: -------------------------------------------------------------------------------- 1 | #Loop back to this point once code finishes 2 | 3 | loop = 1 4 | 5 | while (loop < 10): 6 | 7 | # All the questions that the program asks the user 8 | 9 | noun = input("Choose a noun: ") 10 | 11 | p_noun = input("Choose a plural noun: ") 12 | 13 | noun2 = input("Choose a noun: ") 14 | 15 | place = input("Name a place: ") 16 | 17 | adjective = input("Choose an adjective (Describing word): ") 18 | 19 | noun3 = input("Choose a noun: ") 20 | 21 | #Displays the story based on the users input 22 | 23 | print ("------------------------------------------") 24 | 25 | print ("Be kind to your",noun,"- footed", p_noun) 26 | 27 | print ("For a duck may be somebody's", noun2,",") 28 | 29 | print ("Be kind to your",p_noun,"in",place) 30 | 31 | print ("Where the weather is always",adjective,".") 32 | 33 | print () 34 | 35 | print ("You may think that is this the",noun3,",") 36 | 37 | print ("Well it is.") 38 | 39 | print ("------------------------------------------") 40 | 41 | # Loop back to "loop = 1" 42 | 43 | loop = loop + 1 -------------------------------------------------------------------------------- /Python/JPG_to_PDF_Converter/mad_libs_generator.py/rock_paper_scissor.py/# Python script for Amazon product avail.py: -------------------------------------------------------------------------------- 1 | # Python script for Amazon product availability checker 2 | # importing libraries 3 | 4 | from lxml import html 5 | 6 | import requests 7 | 8 | from time import sleep 9 | 10 | import time 11 | 12 | import schedule 13 | 14 | import smtplib 15 | 16 | # Email id for who want to check availability 17 | 18 | receiver_email_id = "EMAIL_ID_OF_USER" 19 | 20 | 21 | 22 | def check(url): 23 | 24 | headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36'} 25 | 26 | 27 | 28 | # adding headers to show that you are 29 | 30 | # a browser who is sending GET request 31 | 32 | page = requests.get(url, headers = headers) 33 | 34 | for i in range(20): 35 | 36 | # because continuous checks in 37 | 38 | # milliseconds or few seconds 39 | 40 | # blocks your request 41 | 42 | sleep(3) 43 | 44 | 45 | 46 | # parsing the html content 47 | 48 | doc = html.fromstring(page.content) 49 | 50 | 51 | 52 | # checking availability 53 | 54 | XPATH_AVAILABILITY = '//div[@id ="availability"]//text()' 55 | 56 | RAw_AVAILABILITY = doc.xpath(XPATH_AVAILABILITY) 57 | 58 | AVAILABILITY = ''.join(RAw_AVAILABILITY).strip() if RAw_AVAILABILITY else None 59 | 60 | return AVAILABILITY 61 | 62 | 63 | 64 | 65 | def sendemail(ans, product): 66 | 67 | GMAIL_USERNAME = "YOUR_GMAIL_ID" 68 | 69 | GMAIL_PASSWORD = "YOUR_GMAIL_PASSWORD" 70 | 71 | 72 | 73 | recipient = receiver_email_id 74 | 75 | body_of_email = ans 76 | 77 | email_subject = product + ' product availability' 78 | 79 | 80 | 81 | # creates SMTP session 82 | 83 | s = smtplib.SMTP('smtp.gmail.com', 587) 84 | 85 | 86 | 87 | # start TLS for security 88 | 89 | s.starttls() 90 | 91 | 92 | 93 | # Authentication 94 | 95 | s.login(GMAIL_USERNAME, GMAIL_PASSWORD) 96 | 97 | 98 | 99 | # message to be sent 100 | 101 | headers = "\r\n".join(["from: " + GMAIL_USERNAME, 102 | 103 | "subject: " + email_subject, 104 | 105 | "to: " + recipient, 106 | 107 | "mime-version: 1.0", 108 | 109 | "content-type: text/html"]) 110 | 111 | 112 | content = headers + "\r\n\r\n" + body_of_email 113 | 114 | s.sendmail(GMAIL_USERNAME, recipient, content) 115 | 116 | s.quit() 117 | 118 | 119 | 120 | def ReadAsin(): 121 | 122 | # Asin Id is the product Id which 123 | 124 | # needs to be provided by the user 125 | 126 | Asin = 'B077PWK5BT' 127 | 128 | url = "http://www.amazon.in/dp/" + Asin 129 | 130 | print ("Processing: "+url) 131 | 132 | ans = check(url) 133 | 134 | arr = [ 135 | 136 | 'Only 1 left in stock.', 137 | 138 | 'Only 2 left in stock.', 139 | 140 | 'In stock.'] 141 | 142 | print(ans) 143 | 144 | if ans in arr: 145 | 146 | # sending email to user if 147 | 148 | # in case product available 149 | 150 | sendemail(ans, Asin) 151 | 152 | # scheduling same code to run multiple 153 | # times after every 1 minute 154 | 155 | def job(): 156 | 157 | print("Tracking....") 158 | 159 | ReadAsin() 160 | 161 | 162 | schedule.every(1).minutes.do(job) 163 | 164 | 165 | while True: 166 | 167 | 168 | 169 | # running all pending tasks/jobs 170 | 171 | schedule.run_pending() 172 | 173 | time.sleep(1) -------------------------------------------------------------------------------- /Python/JPG_to_PDF_Converter/mad_libs_generator.py/rock_paper_scissor.py/r_p_s.py: -------------------------------------------------------------------------------- 1 | """ Rock Paper Scissors 2 | 3 | ---------------------------------------- 4 | 5 | """ 6 | 7 | import random 8 | 9 | import os 10 | 11 | import re 12 | 13 | os.system('cls' if os.name=='nt' else 'clear') 14 | 15 | while (1 < 2): 16 | 17 | print ("\n") 18 | 19 | print ("Rock, Paper, Scissors - Shoot!") 20 | 21 | userChoice = input("Choose your weapon [R]ock], [P]aper, or [S]cissors: ") 22 | 23 | if not re.match("[SsRrPp]", userChoice): 24 | 25 | print ("Please choose a letter:") 26 | 27 | print ("[R]ock, [S]cissors or [P]aper.") 28 | 29 | continue 30 | 31 | # Echo the user's choice 32 | 33 | print ("You chose: " + userChoice) 34 | 35 | choices = ['R', 'P', 'S'] 36 | 37 | opponenetChoice = random.choice(choices) 38 | 39 | print ("I chose: " + opponenetChoice) 40 | 41 | if opponenetChoice == str.upper(userChoice): 42 | 43 | print ("Tie! ") 44 | 45 | #if opponenetChoice == str("R") and str.upper(userChoice) == "P" 46 | 47 | elif opponenetChoice == 'R' and userChoice.upper() == 'S': 48 | 49 | print ("Scissors beats rock, I win! ") 50 | 51 | continue 52 | 53 | elif opponenetChoice == 'S' and userChoice.upper() == 'P': 54 | 55 | print ("Scissors beats paper! I win! ") 56 | 57 | continue 58 | 59 | elif opponenetChoice == 'P' and userChoice.upper() == 'R': 60 | 61 | print ("Paper beat rock, I win!") 62 | 63 | continue 64 | 65 | else: 66 | 67 | print ("You win!") -------------------------------------------------------------------------------- /Python/JPG_to_PDF_Converter/requirements.md: -------------------------------------------------------------------------------- 1 | #
Requirements
2 | 1. Step-I : 3 | At first you need the Pillow package which is required of the conversion of the file. 4 | 5 | `pip install Pillow` 6 | 7 | 2. Step-II : 8 | Locate the path where the image is stored. 9 | 10 | For example, suppose we have a jpg file named 'test' and it the stored under the following path: 11 | 12 | >C:\Users\Example\Desktop\Test\test.jpg 13 | 3. Step-III : 14 | Use the following format- 15 | 16 | >from PIL import Image 17 | 18 | >image_1 = Image.open(r'path where the image is stored\file name.png') 19 | im_1 = image_1.convert('RGB') 20 | 21 | >im_1.save(r'path where the pdf will be stored\new file name.pdf') 22 | -------------------------------------------------------------------------------- /Python/JumbleSolver/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 KrishnenduDG 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Python/JumbleSolver/main.py: -------------------------------------------------------------------------------- 1 | from scraper import find 2 | from itertools import permutations 3 | 4 | 5 | if __name__=='__main__': 6 | word=input("Enter the Word:") 7 | 8 | perms=permutations(word) 9 | 10 | isFound=False 11 | real_word = [] 12 | 13 | # Traversing all the permutations of the word 14 | for word in perms: 15 | 16 | # If the word is found then we append the word to the reulatnat list 17 | if(find(word)): 18 | real_word.append(''.join(word)) 19 | 20 | # If the word has already been found, then we print the Result 21 | if(len(real_word)): 22 | print("The Possible words are:") 23 | for i in real_word: 24 | print(i) 25 | 26 | # Else we print that we could not find the word 27 | else: 28 | print("No Valid Permutation Found!!!!!") 29 | -------------------------------------------------------------------------------- /Python/JumbleSolver/scraper.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from bs4 import BeautifulSoup 3 | 4 | URL = '''https://www.dictionary.com/browse/''' 5 | result_class = 'one-click-content css-nnyc96 e1q3nk1v1' 6 | 7 | 8 | def find(word2): 9 | 10 | word='' 11 | 12 | for item in word2: 13 | word+=item 14 | 15 | 16 | a=requests.get(URL + word).content 17 | soup = BeautifulSoup(a, "html.parser") 18 | 19 | try: 20 | # Checking if the Word Exists or not 21 | soup.find_all("span",{"class":result_class})[0].get_text() 22 | 23 | # Checking if the word is an Abbreviation or not. If yes, Then retur False 24 | isType=soup.find_all('span',{"class":'pos'})[0].get_text() 25 | 26 | if('abbreviation' in isType): 27 | return False 28 | 29 | return True 30 | except: 31 | return False 32 | 33 | 34 | if __name__=='__main__': 35 | print(find(('t','a','c'))) -------------------------------------------------------------------------------- /Python/Language Translate/README.md: -------------------------------------------------------------------------------- 1 | # Language Translate 2 | 3 | A simple script to help translate your text into different languages. 4 | 5 | ## Installation 6 | - Install Python if you already haven't. 7 | - Install all required dependencies by running ``pip install -r requirements.txt``. 8 | 9 | ## Usage 10 | ```bash 11 | python3 language_translate.py 12 | ``` 13 | 14 | ``` 15 | usage: language_translate.py [-h] [--from_lang FROM_LANG] [--to_lang TO_LANG] 16 | 17 | options: 18 | -h, --help show this help message and exit 19 | --from_lang FROM_LANG 20 | Language to translate from. 21 | --to_lang TO_LANG Language to translate to. (defaults to English) 22 | ``` 23 | -------------------------------------------------------------------------------- /Python/Language Translate/language_translate.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | from translate import Translator 3 | 4 | 5 | def main(): 6 | parser = argparse.ArgumentParser() 7 | parser.add_argument( 8 | "--from_lang", help="Language to translate from.", type=str) 9 | parser.add_argument( 10 | "--to_lang", help="Language to translate to. (defaults to English)", 11 | type=str) 12 | text = input("Enter text to translate: ") 13 | args = parser.parse_args() 14 | if args.from_lang: 15 | translator = Translator( 16 | to_lang=args.to_lang if args.to_lang else "English", 17 | from_lang=args.from_lang 18 | ) 19 | else: 20 | translator = Translator( 21 | to_lang=args.to_lang if args.to_lang else "English") 22 | try: 23 | translation = translator.translate(text) 24 | except Exception: 25 | print("Translation Error. Returning...") 26 | return None 27 | print(translation) 28 | 29 | 30 | if __name__ == "__main__": 31 | main() 32 | -------------------------------------------------------------------------------- /Python/Language Translate/requirements.txt: -------------------------------------------------------------------------------- 1 | translate -------------------------------------------------------------------------------- /Python/Mastermind Game/mastermindGame.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | 4 | # the .randrange() function generates a 5 | # random number within the specified range. 6 | num = random.randrange(1000, 10000) 7 | 8 | n = int(input("Guess the 4 digit number:")) 9 | 10 | # condition to test equality of the 11 | # guess made. Program terminates if true. 12 | if (n == num): 13 | print("Great! You guessed the number in just 1 try! You're a Mastermind!") 14 | else: 15 | # ctr variable initialized. It will keep count of 16 | # the number of tries the Player takes to guess the number. 17 | ctr = 0 18 | 19 | # while loop repeats as long as the 20 | # Player fails to guess the number correctly. 21 | while (n != num): 22 | # variable increments every time the loop 23 | # is executed, giving an idea of how many 24 | # guesses were made. 25 | ctr += 1 26 | 27 | count = 0 28 | 29 | # explicit type conversion of an integer to 30 | # a string in order to ease extraction of digits 31 | n = str(n) 32 | 33 | # explicit type conversion of a string to an integer 34 | num = str(num) 35 | 36 | # correct[] list stores digits which are correct 37 | correct = ['X']*4 38 | 39 | # for loop runs 4 times since the number has 4 digits. 40 | for i in range(0, 4): 41 | 42 | # checking for equality of digits 43 | if (n[i] == num[i]): 44 | # number of digits guessed correctly increments 45 | count += 1 46 | # hence, the digit is stored in correct[]. 47 | correct[i] = n[i] 48 | else: 49 | continue 50 | 51 | # when not all the digits are guessed correctly. 52 | if (count < 4) and (count != 0): 53 | print("Not quite the number. But you did get ", count, " digit(s) correct!") 54 | print("Also these numbers in your input were correct.") 55 | for k in correct: 56 | print(k, end=' ') 57 | print('\n') 58 | print('\n') 59 | n = int(input("Enter your next choice of numbers: ")) 60 | 61 | # when none of the digits are guessed correctly. 62 | elif (count == 0): 63 | print("None of the numbers in your input match.") 64 | n = int(input("Enter your next choice of numbers: ")) 65 | 66 | # condition for equality. 67 | if n == num: 68 | print("You've become a Mastermind!") 69 | print("It took you only", ctr, "tries.") 70 | -------------------------------------------------------------------------------- /Python/MessageSender/Readme.md: -------------------------------------------------------------------------------- 1 | This is an automated calling script genrated using python it uses twilio for 2 | sending messages thus to use this script you have to create twilio account 3 | 4 | To create twilio account log in to twilio website 5 | 6 | after completing the registration you will receive various credentials 7 | such as auth_token , account s_id , messaging s_id and one auto_generated mobile number 8 | 9 | requirement : 10 | 11 | twilio client 12 | 13 | installation : pip install twilio -------------------------------------------------------------------------------- /Python/MessageSender/message.py: -------------------------------------------------------------------------------- 1 | """ please go through the docs before running this scripts """ 2 | 3 | from twilio.rest import Client 4 | 5 | print("\n" + " ***** WELCOME TO AUTOMATED PYTHON MESSAGING SCRIPT ***** ") 6 | print(" ***** PLEASE CREATE A TWILIO ACCOUNT BEFORE USING THE SCRIPT ***** ") 7 | print(" ***** TO CREATE TWILIO ACCOUNT GO TO WWW.TWILIO.COM ***** ") 8 | print(" ***** TYPE 'YES/yes' IF YOU WANT TO PROCEED ***** "+'\n') 9 | i = input() 10 | print("\n") 11 | 12 | 13 | if (i == "YES" or i == "yes"): 14 | account_sid = input(" ENTER YOUR TWILIO ACCOUNT-SID ") 15 | auth_token = input(" ENTER YOUR TWILIO AUTH-TOKEN ") 16 | 17 | client = Client(account_sid,auth_token) 18 | 19 | print("**** press 1 for single phone number *****") 20 | print("**** press 2 for multiple phone numbers *****") 21 | i = int(input()) 22 | 23 | if (i == 1): 24 | print(" ***** PLEASE ENTER RECIEVER's NUMBER **note mention your country code followed by '+' *****") 25 | number = int(input()) 26 | print(" ***** PLEASE ENTER YOUR SID *****") 27 | my_sid = input() 28 | print(" ENTER YOUR MESSAGE ") 29 | msg = input() 30 | """ client.message.create will be responsible for the sending the message 31 | also here messaging_service id is the id that you got from twilio 32 | 33 | 'to' attribute specifies whom you want to send the message 34 | 'body' attribute specifies what message you want to send 35 | """ 36 | message = client.messages.create( 37 | messaging_service_sid=my_sid, 38 | body=msg, 39 | to=number 40 | ) 41 | print(" msg sent ") 42 | 43 | if (i == 2): 44 | print(" ***** PLEASE ENTER RECIEVER's NUMBER **note mention your country code followed by '+' *****") 45 | number = list(int (i) for i in input().strip().split(' ')) 46 | print(" ***** PLEASE ENTER YOUR SID *****") 47 | my_sid = input() 48 | print(" ENTER YOUR MESSAGE ") 49 | msg = input() 50 | """ client.message.create will be responsible for the sending the message 51 | also here messaging_service id is the id that you got from twilio 52 | 53 | 'to' attribute specifies whom you want to send the message 54 | 'body' attribute specifies what message you want to send 55 | """ 56 | for i in number: 57 | message = client.messages.create( 58 | messaging_service_sid=my_sid, 59 | body=msg, 60 | to=number 61 | ) 62 | print(" call success to the number " + str(i)) 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /Python/Number Guessing/NumberGuessing.py: -------------------------------------------------------------------------------- 1 | import random 2 | import math 3 | # Taking Inputs 4 | lower = int(input("Enter Lower bound:- ")) 5 | 6 | # Taking Inputs 7 | upper = int(input("Enter Upper bound:- ")) 8 | 9 | # generating random number between 10 | # the lower and upper 11 | x = random.randint(lower, upper) 12 | print("\n\tYou've only ", 13 | round(math.log(upper - lower + 1, 2)), 14 | " chances to guess the integer!\n") 15 | 16 | # Initializing the number of guesses. 17 | count = 0 18 | 19 | # for calculation of minimum number of 20 | # guesses depends upon range 21 | while count < math.log(upper - lower + 1, 2): 22 | count += 1 23 | 24 | # taking guessing number as input 25 | guess = int(input("Guess a number:- ")) 26 | 27 | # Condition testing 28 | if x == guess: 29 | print("Congratulations you did it in ", 30 | count, " try") 31 | # Once guessed, loop will break 32 | break 33 | elif x > guess: 34 | print("You guessed too small!") 35 | elif x < guess: 36 | print("You Guessed too high!") 37 | 38 | # If Guessing is more than required guesses, 39 | # shows this output. 40 | if count >= math.log(upper - lower + 1, 2): 41 | print("\nThe number is %d" % x) 42 | print("\tBetter Luck Next time!") 43 | 44 | # Better to use This source Code on pycharm! -------------------------------------------------------------------------------- /Python/Password Generator/password_generator.py: -------------------------------------------------------------------------------- 1 | import random 2 | import array 3 | 4 | x="y" 5 | while x=="y": 6 | max_len=int(input("Enter the lenght of the password you want : ")) 7 | if max_len >= 8: 8 | digits=['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] 9 | 10 | lower_case=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h','i', 'j', 'k', 'm', 'n', 'o', 'p', 'q','r', 's', 't', 'u', 'v', 'w', 'x', 'y','z'] 11 | 12 | upper_case=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H','I', 'J', 'K', 'M', 'N', 'O', 'P', 'Q','R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y','Z'] 13 | 14 | symbols=['!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '-', '=', '+', ':', '?', '.', '/', '|', '~', '>', '<'] 15 | 16 | mix = digits + upper_case + lower_case + symbols 17 | 18 | random_digit = random.choice(digits) 19 | random_upper = random.choice(upper_case) 20 | random_lower = random.choice(lower_case) 21 | random_symbol = random.choice(symbols) 22 | 23 | temp_pass = random_digit + random_upper + random_lower + random_symbol 24 | 25 | for x in range(max_len - 4): 26 | temp_pass = temp_pass + random.choice(mix) 27 | temp_pass_list = array.array('u', temp_pass) 28 | random.shuffle(temp_pass_list) 29 | 30 | password = "" 31 | 32 | for x in temp_pass_list: 33 | password = password + x 34 | 35 | print(password,"\n") 36 | 37 | else: 38 | print("Password length should be of minimum 8 characters\n") 39 | 40 | x=input("Do you want another password (y/n) : ") -------------------------------------------------------------------------------- /Python/Pintrest Bulk Image Uploader Script/README.md: -------------------------------------------------------------------------------- 1 | # Automatically upload as many Pins as you want to Pinterest. 2 | 3 | 4 | ## What does this bot do? 5 | 6 | This script allows you to upload as many Pins (150 in a row) as you want to Pinterest, all automatically and quickly (about 4 Pins per minute). 7 | The upload limit on Pinterest is about 150 pins in a row. **You can do multiple upload sessions in a day but risk having your account suspended.** 8 | 9 | ## To do list: 10 | 11 | * ✔ Pinterest automatic login. 12 | * ❌ Pinterest two-factor authentication support. 13 | * ✔ Automatic Pins uploader. 14 | * ✔ Data file browsing feature. 15 | * ✔ CSV structure reader and interpreter. 16 | * ✔ JSON structure reader and interpreter. 17 | 18 | ## Instructions: 19 | 20 | * ### Basic installation of Python for beginners: 21 | 22 | * Download this repository or clone it: 23 | * It requires [Python](https://www.python.org/) 3.7 or a newest version. 24 | * Install [pip](https://pip.pypa.io/en/stable/installation/) to be able to have needed Python modules. 25 | * Open a command prompt in repository folder and type: 26 | ``` 27 | pip install -r requirements.txt 28 | ``` 29 | 30 | * ### Configuration of bot: 31 | 32 | * Download and install [Google Chrome](https://www.google.com/intl/en_en/chrome/). 33 | * Download the [ChromeDriver executable](https://chromedriver.chromium.org/downloads) that is compatible with the actual version of your Google Chrome browser and your OS (Operating System). Refer to: _[What version of Google Chrome do I have?](https://www.whatismybrowser.com/detect/what-version-of-chrome-do-i-have)_ 34 | * Extract the executable from the ZIP file and copy/paste it in the `assets/` folder of the repository. You may need to change the path of the file: 35 | ```python 36 | class Pinterest: 37 | """Main class of the Pinterest uploader.""" 38 | 39 | def __init__(self, email: str, password: str) -> None: 40 | """Set path of used file and start webdriver.""" 41 | self.email = email # Pinterest email. 42 | self.password = password # Pinterest password. 43 | self.webdriver_path = os.path.abspath('assets/chromedriver.exe') # Edit this line with your path. 44 | self.driver = self.webdriver() # Start new webdriver. 45 | self.login_url = 'https://www.pinterest.com/login/' 46 | self.upload_url = 'https://www.pinterest.com/pin-builder/' 47 | ``` 48 | * **Optional:** the email and the password are asked when you run the bot, but you can: 49 | * create and open the `assets/email.txt` file, and then write your Pinterest email; 50 | * create and open the `assets/password.txt` file, and then write your Pinterest password. 51 | * Create your Pins data file containing all details of each Pin. It can be a JSON or CSV file. Save it in the data folder. 52 | 53 | ## Known issues: 54 | 55 | * If you are using a Linux distribution or MacOS, you may need to change some parts of the code: 56 | * ChromeDriver extension may need to be changed from `.exe` to something else. 57 | * **If you use a JSON file for your Pins data, the file path should not contain a unique "\\". It can be a "/" or a "\\\\":** 58 | ```json 59 | "file_path": "C:/Users/Admin/Desktop/Pinterest/image.png", 60 | // or: 61 | "file_path": "C:\\Users\\Admin\\Desktop\\Pinterest\\image.png", 62 | // but not: 63 | "file_path": "C:\Users\Admin\Desktop\Pinterest\image.png", // You can see that "\" is highlighted in red. 64 | ``` 65 | 66 | -------------------------------------------------------------------------------- /Python/Pintrest Bulk Image Uploader Script/assets/delete_me.txt: -------------------------------------------------------------------------------- 1 | delete me -------------------------------------------------------------------------------- /Python/Pintrest Bulk Image Uploader Script/data/csv_structure.csv: -------------------------------------------------------------------------------- 1 | pinboard;; file_path;; title;; description;; alt_text;; link;; date 2 | My Pinboard;; C:/Users/Admin/Desktop/Pinterest/image.png;; My Pin;; This is my pin;; A beautiful dog;; https://google.com/;; 25/12/2021 12:00 3 | My Pinboard;; C:/Users/Admin/Desktop/Pinterest/image.png;; My Pin;; This is my pin;; A beautiful dog;; https://google.com/;; 4 | My Pinboard;; C:/Users/Admin/Desktop/Pinterest/image.png;; My Pin;; This is my pin;; ;; ;; -------------------------------------------------------------------------------- /Python/Pintrest Bulk Image Uploader Script/data/json_structure.json: -------------------------------------------------------------------------------- 1 | { 2 | "pin": [ 3 | { 4 | "pinboard": "My Pinboard", 5 | "file_path": "C:/Users/Admin/Desktop/Pinterest/image.png", 6 | "title": "My Pin", 7 | "description": "This is my pin", 8 | "alt_text": "A beautiful dog", 9 | "link": "https://google.com/", 10 | "date": "25/12/2021 12:00" 11 | }, 12 | { 13 | "pinboard": "My Pinboard", 14 | "file_path": "C:/Users/Admin/Desktop/Pinterest/image.png", 15 | "title": "My Pin", 16 | "description": "This is my pin", 17 | "alt_text": "A beautiful dog", 18 | "link": "https://google.com/", 19 | "date": "" 20 | }, 21 | { 22 | "pinboard": "My Pinboard", 23 | "file_path": "C:/Users/Admin/Desktop/Pinterest/image.png", 24 | "title": "My Pin", 25 | "description": "This is my pin", 26 | "alt_text": "", 27 | "link": "", 28 | "date": "" 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /Python/Pintrest Bulk Image Uploader Script/requirements.txt: -------------------------------------------------------------------------------- 1 | selenium 2 | colorama 3 | tk -------------------------------------------------------------------------------- /Python/Python program to extract rectangular shape/main.py: -------------------------------------------------------------------------------- 1 | # Python program to extract rectangular 2 | # Shape using OpenCV in Python3 3 | import cv2 4 | import numpy as np 5 | 6 | drawing = False # true if mouse is pressed 7 | mode = True # if True, draw rectangle. 8 | ix, iy = -1, -1 9 | 10 | # mouse callback function 11 | def draw_circle(event, x, y, flags, param): 12 | global ix, iy, drawing, mode 13 | 14 | if event == cv2.EVENT_LBUTTONDOWN: 15 | drawing = True 16 | ix, iy = x, y 17 | 18 | elif event == cv2.EVENT_MOUSEMOVE: 19 | if drawing == True: 20 | if mode == True: 21 | cv2.rectangle(img, (ix, iy), (x, y), (0, 255, 0), 3) 22 | a = x 23 | b = y 24 | if a != x | b != y: 25 | cv2.rectangle(img, (ix, iy), (x, y), (0, 0, 0), -1) 26 | else: 27 | cv2.circle(img, (x, y), 5, (0, 0, 255), -1) 28 | 29 | elif event == cv2.EVENT_LBUTTONUP: 30 | drawing = False 31 | if mode == True: 32 | cv2.rectangle(img, (ix, iy), (x, y), (0, 255, 0), 2) 33 | 34 | else: 35 | cv2.circle(img, (x, y), 5, (0, 0, 255), -1) 36 | 37 | img = np.zeros((512, 512, 3), np.uint8) 38 | cv2.namedWindow('image') 39 | cv2.setMouseCallback('image', draw_circle) 40 | 41 | while(1): 42 | cv2.imshow('image', img) 43 | k = cv2.waitKey(1) & 0xFF 44 | if k == ord('m'): 45 | mode = not mode 46 | elif k == 27: 47 | break 48 | 49 | cv2.destroyAllWindows() 50 | -------------------------------------------------------------------------------- /Python/Python-GUI/python.py: -------------------------------------------------------------------------------- 1 | # Python GUI Script 2 | # pip install PyQt6 3 | import sys 4 | from PyQt6.QtWidgets import QApplication, QWidget, QPushButton, QMessageBox, QLabel, QLineEdit 5 | def Application(): 6 | app = QApplication(sys.argv) 7 | win = QWidget() 8 | win.resize(300, 300) 9 | win.move(200, 200) 10 | win.setWindowTitle('Medium Article') 11 | 12 | # Create Buttons 13 | btn = QPushButton('Quit', win) 14 | 15 | # Message Box 16 | QMessageBox.question(win, 'Message',"Are you sure to quit?") 17 | 18 | # Label Text 19 | lbl = QLabel('Hello World', win) 20 | 21 | # Button Clicked 22 | btn.clicked.connect(lambda: QMessageBox.question(win, 'Message',"Are you sure to quit?")) 23 | 24 | # Entry Box 25 | entry = QLineEdit(win) 26 | win.show() 27 | sys.exit(app.exec()) 28 | 29 | if __name__ == '__main__': 30 | Application() 31 | -------------------------------------------------------------------------------- /Python/QR-Code Genrator/QR_code.py: -------------------------------------------------------------------------------- 1 | import qrcode 2 | import qrcode.image.svg 3 | img = qrcode.make('https://github.com/Subhradeep10/Automation-Scripts-Using-Python', 4 | image_factory=qrcode.image.svg.SvgImage) 5 | with open('qr.svg', 'wb') as qr: 6 | img.save(qr) 7 | -------------------------------------------------------------------------------- /Python/RGB_to_Grayscale Image Converter/README.md: -------------------------------------------------------------------------------- 1 | ## RGB Image to Grayscale Image Converter : 2 | 3 | It is a Python program that can be used to convert images in RGB to a grayscale image. 4 | 5 | #### Built With 6 | 1) OpenCV 7 | 8 | #### Prerequisites 9 | 1) pip install opencv-python 10 | 2) pip install numpy 11 | 12 | #### Run the app 13 | 1) Open CLI 14 | 2) Run python RGB_to_Grayscale_Image.py 15 | 16 | ### Sample Input: 17 | ![Sample Input](https://github.com/HVbajoria/Automation-Scripts-Using-Python/blob/main/RGB_to_Grayscale%20Image%20Converter/sample.jpg) 18 | 19 | ### Sample Output: 20 | ![Sample Output](https://github.com/HVbajoria/Automation-Scripts-Using-Python/blob/main/RGB_to_Grayscale%20Image%20Converter/grayscaled_image.png) 21 | -------------------------------------------------------------------------------- /Python/RGB_to_Grayscale Image Converter/RGB_to_Grayscale_Image.py: -------------------------------------------------------------------------------- 1 | # importing libraries and modules 2 | import cv2 3 | import numpy as np 4 | import urllib.request 5 | from PIL import Image 6 | 7 | # Change with the url of the image that needs to be gray scaled. 8 | url = "https://raw.githubusercontent.com/HVbajoria/Automation-Scripts-Using-Python/main/RGB_to_Grayscale%20Image%20Converter/sample.jpg" 9 | 10 | # Getting the image 11 | url_response = urllib.request.urlopen(url) 12 | img_array = np.array(bytearray(url_response.read()), dtype=np.uint8) 13 | image = cv2.imdecode(img_array, -1) 14 | 15 | # Display the original image 16 | cv2.imshow('Original Image', image) 17 | # Close the window on pressing '0' 18 | cv2.waitKey(0) 19 | 20 | # Using the cvtColor() function to grayscale the image 21 | gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) 22 | 23 | # Displaying the Grayscaled Image 24 | cv2.imshow('Grayscale Image', gray_image) 25 | # Close the window in pressing '0' 26 | cv2.waitKey(0) 27 | 28 | # Saving the gray scale image locally 29 | status = cv2.imwrite('grayscaled_image.png',gray_image) 30 | 31 | # Displaying download status 32 | if status: 33 | print("Image Donwloaded Successfully") 34 | else: 35 | print("Image Download Unsuccessfull") 36 | 37 | 38 | cv2.destroyAllWindows() -------------------------------------------------------------------------------- /Python/RGB_to_Grayscale Image Converter/grayscaled_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/RGB_to_Grayscale Image Converter/grayscaled_image.png -------------------------------------------------------------------------------- /Python/RGB_to_Grayscale Image Converter/sample.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/RGB_to_Grayscale Image Converter/sample.jpg -------------------------------------------------------------------------------- /Python/Rock Paper Scissor Game/JUMBLE_WORD_GAME/JumbleWordGame.py: -------------------------------------------------------------------------------- 1 | # Python program for jumbled words game. 2 | 3 | # import random module 4 | import random 5 | 6 | 7 | # function for choosing random word. 8 | def choose(): 9 | # list of word 10 | words = ['rainbow', 'computer', 'science', 'programming', 11 | 'mathematics', 'player', 'condition', 'reverse', 12 | 'water', 'board', 'geeks'] 13 | 14 | # choice() method randomly choose 15 | # any word from the list. 16 | pick = random.choice(words) 17 | 18 | return pick 19 | 20 | 21 | # Function for shuffling the 22 | # characters of the chosen word. 23 | def jumble(word): 24 | # sample() method shuffling the characters of the word 25 | random_word = random.sample(word, len(word)) 26 | 27 | # join() method join the elements 28 | # of the iterator(e.g. list) with particular character . 29 | jumbled = ''.join(random_word) 30 | return jumbled 31 | 32 | 33 | # Function for showing final score. 34 | def thank(p1n, p2n, p1, p2): 35 | print(p1n, 'Your score is :', p1) 36 | print(p2n, 'Your score is :', p2) 37 | 38 | # check_win() function calling 39 | check_win(p1n, p2n, p1, p2) 40 | 41 | print('Thanks for playing...') 42 | 43 | 44 | # Function for declaring winner 45 | def check_win(player1, player2, p1score, p2score): 46 | if p1score > p2score: 47 | print("winner is :", player1) 48 | elif p2score > p1score: 49 | print("winner is :", player2) 50 | else: 51 | print("Draw..Well Played guys..") 52 | 53 | 54 | # Function for playing the game. 55 | def play(): 56 | # enter player1 and player2 name 57 | p1name = input("player 1, Please enter your name :") 58 | p2name = input("Player 2 , Please enter your name: ") 59 | 60 | # variable for counting score. 61 | pp1 = 0 62 | pp2 = 0 63 | 64 | # variable for counting turn 65 | turn = 0 66 | 67 | # keep looping 68 | while True: 69 | 70 | # choose() function calling 71 | picked_word = choose() 72 | 73 | # jumble() function calling 74 | qn = jumble(picked_word) 75 | print("jumbled word is :", qn) 76 | 77 | # checking turn is odd or even 78 | if turn % 2 == 0: 79 | 80 | # if turn no. is even 81 | # player1 turn 82 | print(p1name, 'Your Turn.') 83 | 84 | ans = input("what is in your mind? ") 85 | 86 | # checking ans is equal to picked_word or not 87 | if ans == picked_word: 88 | 89 | # incremented by 1 90 | pp1 += 1 91 | 92 | print('Your score is :', pp1) 93 | turn += 1 94 | 95 | else: 96 | print("Better luck next time ..") 97 | 98 | # player 2 turn 99 | print(p2name, 'Your turn.') 100 | 101 | ans = input('what is in your mind? ') 102 | 103 | if ans == picked_word: 104 | pp2 += 1 105 | print("Your Score is :", pp2) 106 | 107 | else: 108 | print("Better luck next time...correct word is :", picked_word) 109 | 110 | c = int(input("press 1 to continue and 0 to quit :")) 111 | 112 | # checking the c is equal to 0 or not 113 | # if c is equal to 0 then break out 114 | # of the while loop o/w keep looping. 115 | if c == 0: 116 | # thank() function calling 117 | thank(p1name, p2name, pp1, pp2) 118 | break 119 | 120 | else: 121 | 122 | # if turn no. is odd 123 | # player2 turn 124 | print(p2name, 'Your turn.') 125 | ans = input('what is in your mind? ') 126 | 127 | if ans == picked_word: 128 | pp2 += 1 129 | print("Your Score is :", pp2) 130 | turn += 1 131 | 132 | else: 133 | print("Better luck next time.. :") 134 | print(p1name, 'Your turn.') 135 | ans = input('what is in your mind? ') 136 | 137 | if ans == picked_word: 138 | pp1 += 1 139 | print("Your Score is :", pp1) 140 | 141 | else: 142 | print("Better luck next time...correct word is :", picked_word) 143 | 144 | c = int(input("press 1 to continue and 0 to quit :")) 145 | 146 | if c == 0: 147 | # thank() function calling 148 | thank(p1name, p2name, pp1, pp2) 149 | break 150 | 151 | c = int(input("press 1 to continue and 0 to quit :")) 152 | if c == 0: 153 | # thank() function calling 154 | thank(p1name, p2name, pp1, pp2) 155 | break 156 | 157 | 158 | # Driver code 159 | if __name__ == '__main__': 160 | 161 | # play() function calling 162 | play() 163 | -------------------------------------------------------------------------------- /Python/Rock Paper Scissor Game/RockPaperScissorGame.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | # Rock Paper Scissor Game 4 | def gameWin(comp , player): 5 | #If two values are equal, declare a tie! 6 | if comp == player: 7 | return None 8 | 9 | # Check for all possibilities when computer chose Rock 10 | elif comp == 'R': 11 | if player == 'P': 12 | return True 13 | elif player == 'S': 14 | return False 15 | 16 | # Check for all possibilities when computer chose Paper 17 | elif comp == 'P': 18 | if player == 'R': 19 | return False 20 | elif player == 'S': 21 | return True 22 | 23 | # Check for all possibilities when computer chose Scissor 24 | elif comp == 'S': 25 | if player == 'R': 26 | return True 27 | elif player == 'P': 28 | return False 29 | 30 | print("Computer Turn: Rock(R), Paper(P) or Scissor(S)?") 31 | randNo = random.randint(1, 3) 32 | if randNo == 1: 33 | comp = 'R' 34 | elif randNo == 2: 35 | comp = 'P' 36 | elif randNo == 3: 37 | comp = 'S' 38 | 39 | player = input("Player's Turn: Rock(R), Paper(P) or Scissor(S)?") 40 | a = gameWin(comp , player) 41 | 42 | print(f"Computer chose {comp}") 43 | print(f"Player chose {player}") 44 | 45 | if a == None: 46 | print("The game is tie!") 47 | elif a: 48 | print("You Win") 49 | else: 50 | print("You loose") -------------------------------------------------------------------------------- /Python/SnakeGame/README.md: -------------------------------------------------------------------------------- 1 | ##SNAKE GAME 2 | 3 | #LANGUAGE->python 4 | 5 | #PACKAGE->pygame 6 | 7 | #IDE->pycharm 8 | 9 | #Help->youtube & google & github 10 | 11 | #DEMO/S.S->->-> 12 | 13 | ![Screenshot (269)](https://user-images.githubusercontent.com/108628536/195277763-aa95533d-229f-4192-a4ac-9beb446086cc.png) 14 | ![Screenshot (271)](https://user-images.githubusercontent.com/108628536/195277927-ed29dc3a-88c0-48e2-bbc7-5e7841f167fd.png) 15 | ![Screenshot (275)](https://user-images.githubusercontent.com/108628536/195278082-0d9692a0-958d-4afd-af8a-7b3d2eb3078c.png) 16 | ![Screenshot (276)](https://user-images.githubusercontent.com/108628536/195278260-487c26f9-3ca2-470c-a0d5-b21e68d56baf.png) 17 | ![Screenshot (278)](https://user-images.githubusercontent.com/108628536/195277516-4d92dc0d-ad53-44cd-ae9b-0aecf0d27312.png) 18 | -------------------------------------------------------------------------------- /Python/SnakeGame/resources/apple.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/SnakeGame/resources/apple.jpg -------------------------------------------------------------------------------- /Python/SnakeGame/resources/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/SnakeGame/resources/background.jpg -------------------------------------------------------------------------------- /Python/SnakeGame/resources/block.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/SnakeGame/resources/block.jpg -------------------------------------------------------------------------------- /Python/SnakeGame/resources/crash.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/SnakeGame/resources/crash.mp3 -------------------------------------------------------------------------------- /Python/SnakeGame/resources/ding.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/SnakeGame/resources/ding.mp3 -------------------------------------------------------------------------------- /Python/SnakeGame/resources/music1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/SnakeGame/resources/music1.mp3 -------------------------------------------------------------------------------- /Python/Space Shooter game using python/1assets/background-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/1assets/background-black.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/1assets/pixel_laser_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/1assets/pixel_laser_blue.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/1assets/pixel_laser_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/1assets/pixel_laser_green.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/1assets/pixel_laser_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/1assets/pixel_laser_red.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/1assets/pixel_laser_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/1assets/pixel_laser_yellow.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/1assets/pixel_ship_blue_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/1assets/pixel_ship_blue_small.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/1assets/pixel_ship_green_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/1assets/pixel_ship_green_small.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/1assets/pixel_ship_red_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/1assets/pixel_ship_red_small.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/1assets/pixel_ship_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/1assets/pixel_ship_yellow.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/background-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/background-black.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/pixel_laser_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/pixel_laser_blue.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/pixel_laser_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/pixel_laser_green.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/pixel_laser_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/pixel_laser_red.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/pixel_laser_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/pixel_laser_yellow.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/pixel_ship_blue_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/pixel_ship_blue_small.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/pixel_ship_green_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/pixel_ship_green_small.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/pixel_ship_red_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/pixel_ship_red_small.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/pixel_ship_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/Python/Space Shooter game using python/pixel_ship_yellow.png -------------------------------------------------------------------------------- /Python/Space Shooter game using python/spaceinv-Copy1.ipynb.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=http://localhost:8888/notebooks/spaceinv-Copy1.ipynb 3 | -------------------------------------------------------------------------------- /Python/Space Shooter game using python/spaceinvade.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | import os 3 | import time 4 | import random 5 | 6 | WIDTH,HEIGHT=750,750 7 | WIN=pygame.display.set_mode((WIDTH,HEIGHT)) 8 | pygame.display.set_caption("space shooter tutorial") 9 | 10 | #load images 11 | RED_SPACE_SHIP = pygame.image.load(os.path.join("D:\spaceinvader","pixel_player_red_small.png")) 12 | GREEN_SPACE_SHIP = pygame.image.load(os.path.join("D:\spaceinvader\assets","pixel_player_green_small.png")) 13 | BLUE_SPACE_SHIP = pygame.image.load(os.path.join("D:\spaceinvader\assets","pixel_player_blue_small.png")) 14 | 15 | #MAIN PLAYER 16 | YELLOW_SPACE_SHIP = pygame.image.load(os.path.join("D:\spaceinvader\assets","pixel_player_yellow.png")) 17 | 18 | #lasers 19 | RED_LASER=pygame.image.load(os.path.join("D:\spaceinvader\assets","pixel_laser_red.png")) 20 | GREEN_LASER=pygame.image.load(os.path.join("D:\spaceinvader\assets","pixel_laser_green.png")) 21 | BLUE_LASER=pygame.image.load(os.path.join("D:\spaceinvader\assets","pixel_laser_blue.png")) 22 | YELLOW_LASER=pygame.image.load(os.path.join("D:\spaceinvader\assets","pixel_laser_yellow.png")) 23 | 24 | #bg 25 | BG=pygame.transform.scale(pygame.image.load(os.path.join("D:\spaceinvader\assets","background-black.png")),(WIDTH,HEIGHT)) 26 | 27 | class player: 28 | def __init__(self,x,y,health=100): 29 | self.x=x 30 | self.y=y 31 | self.health=health 32 | self.player_img=none 33 | self.laser_img = none 34 | self.lasers=[] 35 | self.cool_down_counter = 0 36 | 37 | def draw(self,window): 38 | window.blit(self.player_img,(self.x,self.y)) 39 | 40 | 41 | 42 | class Player(ship): 43 | def __init__(self,x,y,health=100): 44 | super().__init__(x,y,health) 45 | self.player_img=YELLOW_SPACE_player 46 | self.laser_img =YELOW_LASER 47 | self.mask = pygame.mask.from_surface(self.player_img) 48 | self.max_health=health 49 | 50 | class Enemy(Ship): 51 | COLOR_MAP={ 52 | "red":(RED_SPACE_SHIP,RED_LASER), 53 | "green": (GREEN_SPACE_SHIP,GREEN_LASER), 54 | "blue": (BLUE_SPACE_SHIP,BLUE_LASER) } 55 | 56 | def__init__(self,x,y,color,health=100) 57 | super().__init__(x,y,health) 58 | 59 | 60 | def move(self,vel): 61 | self.y +=vel 62 | 63 | 64 | 65 | 66 | 67 | 68 | def main(): 69 | run=True 70 | FPS=60 71 | level=1 72 | lives=5 73 | main_font = pygame.font.sysFont("comicsans",50) 74 | lost_font = pygame.font.sysFont("comicsans",50) 75 | 76 | 77 | enemies=[] 78 | wave_length=5 79 | enemy_vel=1 80 | 81 | player_vel= 5 82 | 83 | player=player(300,650) 84 | clock=pygame.time.Clock() 85 | 86 | lost=False 87 | 88 | def redraw_window(): 89 | WIN.blit(BG,(0,0)) 90 | #draw text 91 | lives_label = main_font.render(f"Lives:{lives}",1,(255,255,255)) 92 | level_label = main_font.render(f"Level:{level}",1,(255,255,255)) 93 | 94 | WIN.blit(lives_label,(10,10)) 95 | WIN.blit(level_label,(WIDTH-level_label.get_width -10,10)) 96 | 97 | for enemy in enemies: 98 | enemy.draw(WIN) 99 | 100 | player.draw(WIN) 101 | 102 | if lost: 103 | lost_label=lost_font.render("You Lost!!",1,(255,255,255)) 104 | WIN.blit(lost_label,(WIDTH/2- lost_label.get_width()/2,350)) 105 | 106 | 107 | 108 | pygame.display.update() 109 | 110 | 111 | while run: 112 | clock.tick(FPS) 113 | 114 | if lives<=0 or player.health<=0: 115 | lost=True 116 | 117 | 118 | 119 | if len (enemies)==0: 120 | level+=1 121 | wave_length+=5 122 | for i in range (wave_length): 123 | enemy=Enemy(random.randrange(50,WIDTH-100),random.randrange(-1500,-100),random.choice(["red","blue","green"])) 124 | enemies.append(enemy) 125 | 126 | 127 | for event in pygame.event.get(): 128 | if event.type==pygame.QUIT: 129 | run=False 130 | 131 | keys =pygame.key.get_pressed() 132 | if keys[pygame.k_a] and player.x - player_vel > 0: #left 133 | player.x -=player_vel 134 | if keys[pygame.k_d] and player.x + player_vel + player.get_width() < WIDTH: #right 135 | player.x +=player_vel 136 | if keys[pygame.k_w] and player.y - player_vel > 0: #up 137 | player.y -=player_vel 138 | if keys[pygame.k_s] and player.y + player_vel + player.get_height() < HEIGHT: #down 139 | player.y +=player_vel 140 | 141 | for enemy in enemies[:]: 142 | enemy.move(enemy_vel) 143 | if enemy.y+enemy.get_height() > HEIGHT: 144 | lives-=1 145 | enemies.remove(enemy) 146 | 147 | 148 | redraw_window() -------------------------------------------------------------------------------- /Python/Sudoku/sudoku.py: -------------------------------------------------------------------------------- 1 | M = 9 2 | def puzzle(a): 3 | for i in range(M): 4 | for j in range(M): 5 | print(a[i][j],end = " ") 6 | print() 7 | def solve(grid, row, col, num): 8 | for x in range(9): 9 | if grid[row][x] == num: 10 | return False 11 | 12 | for x in range(9): 13 | if grid[x][col] == num: 14 | return False 15 | 16 | 17 | startRow = row - row % 3 18 | startCol = col - col % 3 19 | for i in range(3): 20 | for j in range(3): 21 | if grid[i + startRow][j + startCol] == num: 22 | return False 23 | return True 24 | 25 | def Suduko(grid, row, col): 26 | 27 | if (row == M - 1 and col == M): 28 | return True 29 | if col == M: 30 | row += 1 31 | col = 0 32 | if grid[row][col] > 0: 33 | return Suduko(grid, row, col + 1) 34 | for num in range(1, M + 1, 1): 35 | 36 | if solve(grid, row, col, num): 37 | 38 | grid[row][col] = num 39 | if Suduko(grid, row, col + 1): 40 | return True 41 | grid[row][col] = 0 42 | return False 43 | '''0 means the cells where no value is assigned''' 44 | grid = [[2, 5, 0, 0, 3, 0, 9, 0, 1], 45 | [0, 1, 0, 0, 0, 4, 0, 0, 0], 46 | [4, 0, 7, 0, 0, 0, 2, 0, 8], 47 | [0, 0, 5, 2, 0, 0, 0, 0, 0], 48 | [0, 0, 0, 0, 9, 8, 1, 0, 0], 49 | [0, 4, 0, 0, 0, 3, 0, 0, 0], 50 | [0, 0, 0, 3, 6, 0, 0, 7, 2], 51 | [0, 7, 0, 0, 0, 0, 0, 0, 3], 52 | [9, 0, 3, 0, 0, 0, 6, 0, 4]] 53 | 54 | if (Suduko(grid, 0, 0)): 55 | puzzle(grid) 56 | else: 57 | print("Solution does not exist:(") -------------------------------------------------------------------------------- /Python/TIC-TAC-TOE/TICTACTOE.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | 4 | class TicTacToe: 5 | 6 | def _init_(self): 7 | self.board = [] 8 | 9 | def create_board(self): 10 | for i in range(3): 11 | row = [] 12 | for j in range(3): 13 | row.append('-') 14 | self.board.append(row) 15 | 16 | def get_random_first_player(self): 17 | return random.randint(0, 1) 18 | 19 | def fix_spot(self, row, col, player): 20 | self.board[row][col] = player 21 | 22 | def is_player_win(self, player): 23 | win = None 24 | 25 | n = len(self.board) 26 | 27 | # checking rows 28 | for i in range(n): 29 | win = True 30 | for j in range(n): 31 | if self.board[i][j] != player: 32 | win = False 33 | break 34 | if win: 35 | return win 36 | 37 | # checking columns 38 | for i in range(n): 39 | win = True 40 | for j in range(n): 41 | if self.board[j][i] != player: 42 | win = False 43 | break 44 | if win: 45 | return win 46 | 47 | # checking diagonals 48 | win = True 49 | for i in range(n): 50 | if self.board[i][i] != player: 51 | win = False 52 | break 53 | if win: 54 | return win 55 | 56 | win = True 57 | for i in range(n): 58 | if self.board[i][n - 1 - i] != player: 59 | win = False 60 | break 61 | if win: 62 | return win 63 | return False 64 | 65 | for row in self.board: 66 | for item in row: 67 | if item == '-': 68 | return False 69 | return True 70 | 71 | def is_board_filled(self): 72 | for row in self.board: 73 | for item in row: 74 | if item == '-': 75 | return False 76 | return True 77 | 78 | def swap_player_turn(self, player): 79 | return 'X' if player == 'O' else 'O' 80 | 81 | def show_board(self): 82 | for row in self.board: 83 | for item in row: 84 | print(item, end=" ") 85 | print() 86 | 87 | def start(self): 88 | self.create_board() 89 | 90 | player = 'X' if self.get_random_first_player() == 1 else 'O' 91 | while True: 92 | print(f"Player {player} turn") 93 | 94 | self.show_board() 95 | 96 | # taking user input 97 | row, col = list( 98 | map(int, input("Enter row and column numbers to fix spot: ").split())) 99 | print() 100 | 101 | # fixing the spot 102 | self.fix_spot(row - 1, col - 1, player) 103 | 104 | # checking whether current player is won or not 105 | if self.is_player_win(player): 106 | print(f"Player {player} wins the game!") 107 | break 108 | 109 | # checking whether the game is draw or not 110 | if self.is_board_filled(): 111 | print("Match Draw!") 112 | break 113 | 114 | # swapping the turn 115 | player = self.swap_player_turn(player) 116 | 117 | # showing the final view of board 118 | print() 119 | self.show_board() 120 | 121 | 122 | # starting the game 123 | tic_tac_toe = TicTacToe() 124 | tic_tac_toe.start() -------------------------------------------------------------------------------- /Python/Text detection using Python/text_detection.py: -------------------------------------------------------------------------------- 1 | import time 2 | import pandas as pd 3 | import numpy as np 4 | import matplotlib.pyplot as plt 5 | from tkinter import * 6 | import tkinter.messagebox 7 | from nltk.sentiment.vader import SentimentIntensityAnalyzer 8 | 9 | 10 | class analysis_text(): 11 | 12 | # Main function in program 13 | def center(self, toplevel): 14 | 15 | toplevel.update_idletasks() 16 | w = toplevel.winfo_screenwidth() 17 | h = toplevel.winfo_screenheight() 18 | size = tuple(int(_) for _ in 19 | toplevel.geometry().split('+')[0].split('x')) 20 | 21 | x = w/2 - size[0]/2 22 | y = h/2 - size[1]/2 23 | toplevel.geometry("%dx%d+%d+%d" % (size + (x, y))) 24 | 25 | def callback(self): 26 | if tkinter.messagebox.askokcancel("Quit", 27 | "Do you want to leave?"): 28 | self.main.destroy() 29 | 30 | def setResult(self, type, res): 31 | 32 | #calculated comments in vader analysis 33 | if (type == "neg"): 34 | self.negativeLabel.configure(text = 35 | "you typed negative comment : " 36 | + str(res) + " % \n") 37 | elif (type == "neu"): 38 | self.neutralLabel.configure( text = 39 | "you typed comment : " 40 | + str(res) + " % \n") 41 | elif (type == "pos"): 42 | self.positiveLabel.configure(text 43 | = "you typed positive comment: " 44 | + str(res) + " % \n") 45 | 46 | 47 | def runAnalysis(self): 48 | 49 | sentences = [] 50 | sentences.append(self.line.get()) 51 | sid = SentimentIntensityAnalyzer() 52 | 53 | for sentence in sentences: 54 | 55 | # print(sentence) 56 | ss = sid.polarity_scores(sentence) 57 | 58 | if ss['compound'] >= 0.05 : 59 | self.normalLabel.configure(text = 60 | " you typed positive statement: ") 61 | 62 | elif ss['compound'] <= - 0.05 : 63 | self.normalLabel.configure(text = 64 | " you typed negative statement") 65 | 66 | else : 67 | self.normalLabel.configure(text = 68 | " you normal typed statement: ") 69 | for k in sorted(ss): 70 | self.setResult(k, ss[k]) 71 | print() 72 | 73 | 74 | def editedText(self, event): 75 | self.typedText.configure(text = self.line.get() + event.char) 76 | 77 | 78 | def runByEnter(self, event): 79 | self.runAnalysis() 80 | 81 | 82 | def __init__(self): 83 | # Create main window 84 | self.main = Tk() 85 | self.main.title("Text Detector system") 86 | self.main.geometry("600x600") 87 | self.main.resizable(width=FALSE, height=FALSE) 88 | self.main.protocol("WM_DELETE_WINDOW", self.callback) 89 | self.main.focus() 90 | self.center(self.main) 91 | 92 | # addition item on window 93 | self.label1 = Label(text = "type a text here :") 94 | self.label1.pack() 95 | 96 | # Add a hidden button Enter 97 | self.line = Entry(self.main, width=70) 98 | self.line.pack() 99 | 100 | self.textLabel = Label(text = "\n", 101 | font=("Helvetica", 15)) 102 | self.textLabel.pack() 103 | self.typedText = Label(text = "", 104 | fg = "blue", 105 | font=("Helvetica", 20)) 106 | self.typedText.pack() 107 | 108 | self.line.bind("",self.editedText) 109 | self.line.bind("",self.runByEnter) 110 | 111 | 112 | self.result = Label(text = "\n", 113 | font=("Helvetica", 15)) 114 | self.result.pack() 115 | self.negativeLabel = Label(text = "", 116 | fg = "red", 117 | font=("Helvetica", 20)) 118 | self.negativeLabel.pack() 119 | self.neutralLabel = Label(text = "", 120 | font=("Helvetica", 20)) 121 | self.neutralLabel.pack() 122 | self.positiveLabel = Label(text = "", 123 | fg = "green", 124 | font=("Helvetica", 20)) 125 | self.positiveLabel.pack() 126 | self.normalLabel =Label (text ="", 127 | fg ="red", 128 | font=("Helvetica", 20)) 129 | self.normalLabel.pack() 130 | 131 | # Driver code 132 | myanalysis = analysis_text() 133 | mainloop() 134 | -------------------------------------------------------------------------------- /Python/Twitter automation/main.py: -------------------------------------------------------------------------------- 1 | from selenium import webdriver 2 | from selenium.webdriver.common.by import By 3 | from selenium.webdriver.common.keys import Keys 4 | import time 5 | 6 | PROMISED_DOWN = 150 7 | PROMISED_UP = 10 8 | CHROME_DRIVER_PATH = "YOUR PATH" 9 | TWITTER_USERNAME = "YOUR USERNAME" 10 | TWITTER_PASSWORD = "YOUR PASSWORD" 11 | 12 | 13 | class InternetSpeedTwitterBot: 14 | def __init__(self): 15 | self.driver = webdriver.Chrome(executable_path=CHROME_DRIVER_PATH) 16 | self.down = 0.0 17 | self.up = 0.0 18 | 19 | def get_internet_speed(self): 20 | self.driver.get("https://www.speedtest.net/") 21 | go_button = self.driver.find_element(By.LINK_TEXT, 'GO') 22 | go_button.click() 23 | time.sleep(60) 24 | self.up = self.driver.find_element(By.XPATH, 25 | '//*[@id="container"]/div/div[3]/div/div/div/div[2]/div[3]/div[' 26 | '3]/div/div[3]/div/div/div[2]/div[1]/div[2]/div/div[2]/span').text 27 | self.down = self.driver.find_element(By.XPATH, 28 | '//*[@id="container"]/div/div[3]/div/div/div/div[2]/div[3]/div[' 29 | ' 3]/div/div[3]/div/div/div[2]/div[1]/div[3]/div/div[2]/span').text 30 | 31 | def tweet_at_provider(self): 32 | self.driver.get("https://twitter.com/i/flow/login?input_flow_data=%7B%22requested_variant%22%3A" 33 | "%22eyJsYW5nIjoiZW4ifQ%3D%3D%22%7D") 34 | time.sleep(4) 35 | username = self.driver.find_element(By.CSS_SELECTOR, 'input') 36 | username.send_keys(TWITTER_USERNAME) 37 | time.sleep(2) 38 | next_button = self.driver.find_element(By.XPATH, 39 | '//*[@id="layers"]/div/div/div/div/div/div/div[2]/div[2]/div/div/div[' 40 | '2]/div[2]/div[1]/div/div/div[6]') 41 | next_button.click() 42 | 43 | time.sleep(2) 44 | password = self.driver.find_element(By.XPATH, '//*[@id="layers"]/div/div/div/div/div/div/div[2]/div[' 45 | '2]/div/div/div[2]/div[2]/div[1]/div/div/div[' 46 | '3]/div/label/div/div[2]/div[1]/input') 47 | password.send_keys(TWITTER_PASSWORD) 48 | 49 | time.sleep(2) 50 | login_button = self.driver.find_element(By.XPATH, '//*[@id="layers"]/div/div/div/div/div/div/div[2]/div[' 51 | '2]/div/div/div[2]/div[2]/div[2]/div/div[1]/div/div') 52 | login_button.click() 53 | 54 | tweet = f"Hey Internet Provider, why is my internet speed {self.down}down/{self.up}up when " \ 55 | f"I pay for {PROMISED_DOWN}down/{PROMISED_UP}up? (It is bot, Using it for Testing Purpose.) " 56 | tweet_a_tweet = self.driver.find_element(By.XPATH, 57 | '//*[@id="react-root"]/div/div/div[2]/main/div/div/div/div[1]/div/div[2]/div/div[2]/div[1]/div/div/div/div[2]/div[1]/div/div/div/div/div/div/div/div/div/label/div[1]/div/div/div/div/div[2]/div/div/div/div') 58 | tweet_a_tweet.send_keys(tweet) 59 | self.driver.quit() 60 | 61 | 62 | internet_speed_twitter_bot = InternetSpeedTwitterBot() 63 | internet_speed_twitter_bot.get_internet_speed() 64 | if float(internet_speed_twitter_bot.up) < PROMISED_UP or float(internet_speed_twitter_bot.down) < PROMISED_DOWN: 65 | internet_speed_twitter_bot.tweet_at_provider() 66 | -------------------------------------------------------------------------------- /Python/Twitter automation/requirements.txt: -------------------------------------------------------------------------------- 1 | async-generator==1.10 2 | attrs==22.1.0 3 | certifi==2022.9.24 4 | cffi==1.15.1 5 | exceptiongroup==1.0.0rc9 6 | h11==0.14.0 7 | idna==3.4 8 | outcome==1.2.0 9 | pycparser==2.21 10 | PySocks==1.7.1 11 | selenium==4.5.0 12 | sniffio==1.3.0 13 | sortedcontainers==2.4.0 14 | trio==0.22.0 15 | trio-websocket==0.9.2 16 | urllib3==1.26.12 17 | wsproto==1.2.0 18 | -------------------------------------------------------------------------------- /Python/URL-Shortener/README.md: -------------------------------------------------------------------------------- 1 | # How to run this # 2 | * git clone https://github.com/Subhradeep10/Automation-Scripts-Using-Python 3 | * Open your terminal 4 | * Run pip install urllib3 5 | * Run python UrlShortener.py https://www.only-for-cars.com/ 6 | 7 | ## Thats it you will get shorter url of the original url ## -------------------------------------------------------------------------------- /Python/URL-Shortener/UrlShortener.py: -------------------------------------------------------------------------------- 1 | from __future__ import with_statement 2 | import contextlib 3 | try: 4 | from urllib.parse import urlencode 5 | except ImportError: 6 | from urllib import urlencode 7 | try: 8 | from urllib.request import urlopen 9 | except ImportError: 10 | from urllib import urlopen 11 | import sys 12 | 13 | def make_tiny(url): 14 | request_url = ('http://tinyurl.com/api-create.php?' + 15 | urlencode({'url':url})) 16 | with contextlib.closing(urlopen(request_url)) as response: 17 | return response.read().decode('utf-8') 18 | 19 | def main(): 20 | for tinyurl in map(make_tiny, sys.argv[1:]): 21 | print(tinyurl) 22 | 23 | if __name__ == '__main__': 24 | main() 25 | -------------------------------------------------------------------------------- /Python/Video to Audio/Video to Audio converter: -------------------------------------------------------------------------------- 1 | # Python code to convert video to audio 2 | import moviepy.editor as mp 3 | 4 | # Insert Local Video File Path 5 | clip = mp.VideoFileClip(r"Video File") 6 | 7 | # Insert Local Audio File Path 8 | clip.audio.write_audiofile(r"Audio File") 9 | -------------------------------------------------------------------------------- /Python/Weather App/main.py: -------------------------------------------------------------------------------- 1 | import tkinter 2 | from weather import show_weather 3 | 4 | def push(): 5 | str=e.get() 6 | if str!='': 7 | result=show_weather(str) 8 | label_two.config(text="The Weather Details are as follows:") 9 | label.config(text=result) 10 | top=tkinter.Tk() 11 | top.title('WEATHER APP') 12 | top.tk_focusFollowsMouse() 13 | 14 | # Setting the window size 15 | top.geometry('400x300') 16 | 17 | # Adding the Label for Text Display 18 | label_one=tkinter.Label(top,text="Enter Name of the Place",width=20) 19 | label_one.pack() 20 | 21 | # Adding the Entry 22 | e=tkinter.Entry(top) 23 | e.focus_set() 24 | e.pack() 25 | 26 | # Adding the button 27 | button=tkinter.Button(top,text="Get Weather",width=20,height=2,command=push,bg='#ffffff', activebackground='#00ff00').pack(pady=20) 28 | 29 | # Adding the button for displaying captions 30 | label_two=tkinter.Label(top,text="") 31 | label_two.pack() 32 | 33 | 34 | # Adding the Label for Weather Display 35 | label=tkinter.Label(top,text="") 36 | label.pack() 37 | 38 | top.mainloop() -------------------------------------------------------------------------------- /Python/Weather App/weather.py: -------------------------------------------------------------------------------- 1 | def show_weather(x): 2 | # importing requests and json 3 | import requests, json 4 | x=str(x) 5 | # base URL 6 | BASE_URL = "https://api.openweathermap.org/data/2.5/weather?" 7 | fw = open(r'Weather App\weather.txt') 8 | API_KEY=fw.read() 9 | URL = BASE_URL + "q=" + x + "&appid=" + API_KEY 10 | st="" 11 | # HTTP request 12 | response = requests.get(URL) 13 | # checking the status code of the request 14 | if response.status_code == 200: 15 | # getting data in the json format 16 | data = response.json() 17 | # getting the main dict block 18 | main = data['main'] 19 | # getting temperature 20 | temperature = (int(main['temp'])-273.0) 21 | # getting the humidity 22 | humidity = main['humidity'] 23 | # getting the pressure 24 | pressure = main['pressure'] 25 | # weather report 26 | report = data['weather'] 27 | st+=f"{x:-^30}"+'\n'+f"Temperature: {temperature} Celsius"+'\n'+f"Humidity: {humidity} g/kg"+'\n'+f"Pressure: {pressure} Pa"+'\n'+f"Weather Report: {report[0]['description']}" 28 | return(st) 29 | else: 30 | # showing the error message 31 | return("Provide Valid Input") 32 | -------------------------------------------------------------------------------- /Python/Weather App/weather.txt: -------------------------------------------------------------------------------- 1 | 3e296e84c837be3621f0c16f176ec3a0 -------------------------------------------------------------------------------- /Python/Weather Desktop Notifications/Weather_Desktop_Notifications.py: -------------------------------------------------------------------------------- 1 | # import required libraries 2 | import requests 3 | from bs4 import BeautifulSoup 4 | from win10toast import ToastNotifier 5 | 6 | # create an object to ToastNotifier class 7 | n = ToastNotifier() 8 | 9 | # define a function 10 | def getdata(url): 11 | r = requests.get(url) 12 | return r.text 13 | 14 | htmldata = getdata("https://weather.com/en-IN/weather/today/l/25.59,85.14?par=google&temp=c/") 15 | 16 | soup = BeautifulSoup(htmldata, 'html.parser') 17 | 18 | current_temp = soup.find_all("span", class_= "_-_-components-src-organism-CurrentConditions-CurrentConditions--tempValue--MHmYY") 19 | 20 | chances_rain = soup.find_all("div", class_= "_-_-components-src-organism-CurrentConditions-CurrentConditions--precipValue--2aJSf") 21 | 22 | temp = (str(current_temp)) 23 | 24 | temp_rain = str(chances_rain) 25 | 26 | result = "current_temp " + temp[128:-9] + " in patna bihar" + "\n" + temp_rain[131:-14] 27 | n.show_toast("live Weather update", 28 | result, duration = 10) 29 | -------------------------------------------------------------------------------- /Python/Web Scrapping Using Python/README.md: -------------------------------------------------------------------------------- 1 | Web scraping refers to the extraction of data from a website. 2 | This information is collected and then exported into a format that is more useful for the user. 3 | Be it a spreadsheet or an API. 4 | 5 | Although web scraping can be done manually, in most cases, automated tools are preferred when scraping web data as they can be less costly and work at a faster rate. 6 | 7 | In this project, we have gone along different libraries of python to beautifully present the data of any website. 8 | ->First we installed requests module, BeautifulSoup and html8lib in a file through terminal 9 | Steps: 10 | ->pip install requests 11 | ->pip install bs4 12 | ->pip install html5lib 13 | 14 | requests->Requests allows you to send HTTP/1.1 requests extremely easily. 15 | There’s no need to manually add query strings to your URLs, or to form-encode your PUT & POST data — but nowadays, just use the json method! 16 | here we will use this to send our request thru the url. 17 | 18 | bs4->Beautiful Soup is a library that makes it easy to scrape information from web pages. It sits atop an HTML or XML parser, providing Pythonic idioms for iterating, searching, and modifying the parse tree. 19 | 20 | html5lib->html5lib is a pure-python library for parsing HTML. 21 | It is designed to conform to the WHATWG HTML specification, as is implemented by all major web browsers. 22 | 23 | After using the commands in 'main.py' we get the html page in the terminal. 24 | There are other commands that can be used to get the various parts of the page -> refer to 'READMECode.txt' 25 | 26 | By Prakriti Mandal -------------------------------------------------------------------------------- /Python/Web Scrapping Using Python/READMECode.txt: -------------------------------------------------------------------------------- 1 | 2 | ------->Finding Elements by class 3 | 4 | s = prettyHtmlContent.find('div', class_='Class Name') 5 | content = s.find_all('p') 6 | print(content) 7 | 8 | 9 | ------->Finding by ID 10 | 11 | s = prettyHtmlContent.find('div', id= '') 12 | 13 | 14 | ------->Removing the tags from the content of the page and getting the text only 15 | 16 | s = prettyHtmlContent.find('div', class_='') 17 | lines = s.find_all('p') 18 | for line in lines: 19 | print(line.text) 20 | 21 | 22 | 23 | ------->Getting the Links 24 | 25 | for link in prettyHtmlContent.find_all('a'): 26 | print(link.get('href')) 27 | 28 | 29 | 30 | ------->Extracting The Image 31 | images_list = [] 32 | images = prettyHtmlContent.select('img') 33 | for image in images: 34 | src = image.get('src') 35 | alt = image.get('alt') 36 | images_list.append({"src": src, "alt": alt}) 37 | 38 | for image in images_list: 39 | print(image) 40 | 41 | 42 | 43 | --------->Saving data to CSV 44 | In this case we need to import CSV ->import CSV 45 | prettyHtmlContent = bs(req.text, 'html.parser') 46 | titles = prettyHtmlContent.find_all('div', attrs={'class', 'head'}) 47 | titles_list = [] 48 | count = 1 49 | for title in titles: 50 | d = {} 51 | d['Title Number'] = f'Title {count}' 52 | d['Title Name'] = title.text 53 | count += 1 54 | titles_list.append(d) 55 | 56 | filename = 'titles.csv' 57 | with open(filename, 'w', newline='') as f: 58 | w = csv.DictWriter(f,['Title Number','Title Name']) 59 | w.writeheader() 60 | 61 | w.writerows(titles_list) -------------------------------------------------------------------------------- /Python/Web Scrapping Using Python/main.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from bs4 import BeautifulSoup 3 | # In the URL we put the url of the page to be scraped 4 | # Like url = "https://www..com/" 5 | url = "" 6 | 7 | r = requests.get(url) 8 | htmlcontent = r.content 9 | 10 | prettyHtmlContent = BeautifulSoup(htmlcontent, 'html.parser') 11 | # This provides the total html content of given website. 12 | print(prettyHtmlContent.prettify()) 13 | 14 | # This helps to get the title content in a website. 15 | title = prettyHtmlContent.title 16 | # print(title) -------------------------------------------------------------------------------- /Python/WifiPassWordExtractor/wifi.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | """ a fuction that will fetch and store all the wifi profiles from your pc to a list """ 4 | def get_wifi_profiles(): 5 | """ this will fetch all the profiles of wifi that are being stored in your pc """ 6 | wifi_meta_data = subprocess.check_output(['netsh','wlan','show','profiles']) 7 | wifi_data = wifi_meta_data.decode('utf-8') 8 | wifi_data = wifi_data.split('\n') 9 | 10 | """ this part will help us to store the profiles name in a list """ 11 | wifi_profiles = [] 12 | for line in wifi_data: 13 | if "All User Profile : " in line : 14 | wifi = line.split(':')[1] 15 | wifi_profiles.append(wifi[1:-1]) 16 | return wifi_profiles 17 | 18 | print('\n'+"***** FETCHING SUCCESSFULL *****" +'\n') 19 | """ this will fetch the password for a all the profiles """ 20 | for wifi_names in get_wifi_profiles(): 21 | wifiP_meta_data = subprocess.check_output(['netsh','wlan','show','profile',wifi_names,'key=clear']) 22 | wifiP_data = wifiP_meta_data.decode('utf-8',errors='backslashreplace') 23 | wifiP_data = wifiP_data.split('\n') 24 | wifi_password = [] 25 | 26 | for wifi_password in wifiP_data: 27 | if "Key Content :" in wifi_password: 28 | wifi_password = wifi_password.split(':')[1] 29 | print(wifi_names,":",wifi_password) 30 | -------------------------------------------------------------------------------- /Python/WikipediaInformation/README.md: -------------------------------------------------------------------------------- 1 | # Details 2 | * This script lets you fetch every information from Wikipedia directly from your command line. -------------------------------------------------------------------------------- /Python/WikipediaInformation/WikipediaInformationScript.py: -------------------------------------------------------------------------------- 1 | import wikipedia 2 | import pyttsx3 3 | engine = pyttsx3.init('sapi5') 4 | voices = engine.getProperty('voices') 5 | engine.setProperty('voice', voices[0].id) 6 | def speak(audio): 7 | engine.say(audio) 8 | engine.runAndWait() 9 | query = input("What You Want To Ask ??") 10 | results = wikipedia.summary(query, sentences=2) 11 | speak("According to Wikipedia\n") 12 | print(results) 13 | speak(results) -------------------------------------------------------------------------------- /Python/Wordle Game/README.md: -------------------------------------------------------------------------------- 1 | ## How To Play 2 | - Choose You Difficulty 3 | - Start Playing!! 4 | 5 | RED means the character is not present in the word. 6 | BLUE means the character is present more than once. 7 | YELLOW means the character is present once at different spot. 8 | GREEN means the character is placed on the right spot. 9 | -------------------------------------------------------------------------------- /Python/Wordle Game/colour.py: -------------------------------------------------------------------------------- 1 | 2 | __all__ = [ 3 | "B", "BB", "BU", 4 | "G", "GB", "GU", 5 | "R", "RB", "RU", 6 | "Y", "YB", "YU" 7 | ] 8 | 9 | class Colour: 10 | colour_code = { 11 | "blue" : 96, 12 | "green" : 92, 13 | "red" : 91, 14 | "yellow" : 93 15 | } 16 | 17 | @staticmethod 18 | def colour(colour, msg): 19 | return f"\33[0;49;{colour}m{msg}\33[0m" 20 | 21 | @staticmethod 22 | def colour_block(colour, msg): 23 | return f"\33[7;49;{colour}m{msg}\33[0m" 24 | 25 | @staticmethod 26 | def colour_underline(colour, msg): 27 | return f"\33[4;49;{colour}m{msg}\33[0m" 28 | 29 | blue = lambda msg : Colour.colour(Colour.colour_code["blue"], msg) 30 | blue_block = lambda msg : Colour.colour_block(Colour.colour_code["blue"], msg) 31 | blue_underline = lambda msg : Colour.colour_underline(Colour.colour_code["blue"], msg) 32 | 33 | green = lambda msg : Colour.colour(Colour.colour_code["green"], msg) 34 | green_block = lambda msg : Colour.colour_block(Colour.colour_code["green"], msg) 35 | green_underline = lambda msg : Colour.colour_underline(Colour.colour_code["green"], msg) 36 | 37 | red = lambda msg : Colour.colour(Colour.colour_code["red"], msg) 38 | red_block = lambda msg : Colour.colour_block(Colour.colour_code["red"], msg) 39 | red_underline = lambda msg : Colour.colour_underline(Colour.colour_code["red"], msg) 40 | 41 | yellow = lambda msg : Colour.colour(Colour.colour_code["yellow"], msg) 42 | yellow_block = lambda msg : Colour.colour_block(Colour.colour_code["yellow"], msg) 43 | yellow_underline = lambda msg : Colour.colour_underline(Colour.colour_code["yellow"], msg) 44 | 45 | 46 | 47 | B = Colour.blue 48 | BB = Colour.blue_block 49 | BU = Colour.blue_underline 50 | 51 | G = Colour.green 52 | GB = Colour.green_block 53 | GU = Colour.green_underline 54 | 55 | R = Colour.red 56 | RB = Colour.red_block 57 | RU = Colour.red_underline 58 | 59 | Y = Colour.yellow 60 | YB = Colour.yellow_block 61 | YU = Colour.yellow_underline 62 | -------------------------------------------------------------------------------- /Python/Wordle Game/colour_curses.py: -------------------------------------------------------------------------------- 1 | """ 2 | Can only be imported after the curses screen is intialised 3 | """ 4 | 5 | from utils import curses 6 | 7 | curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK) 8 | curses.init_pair(2, curses.COLOR_GREEN, curses.COLOR_BLACK) 9 | curses.init_pair(3, curses.COLOR_BLUE, curses.COLOR_BLACK) 10 | curses.init_pair(4, curses.COLOR_YELLOW, curses.COLOR_BLACK) 11 | curses.init_pair(5, curses.COLOR_CYAN, curses.COLOR_BLACK) 12 | curses.init_pair(6, curses.COLOR_MAGENTA, curses.COLOR_BLACK) 13 | 14 | 15 | W = curses.color_pair(0) 16 | WB = curses.color_pair(0) + curses.A_BOLD 17 | WU = curses.color_pair(0) + curses.A_UNDERLINE 18 | WBU = WUB = curses.color_pair(0) + curses.A_BOLD + curses.A_UNDERLINE 19 | 20 | 21 | R = curses.color_pair(1) 22 | RB = curses.color_pair(1) + curses.A_BOLD 23 | RU = curses.color_pair(1) + curses.A_UNDERLINE 24 | RBU = RUB = curses.color_pair(1) + curses.A_BOLD + curses.A_UNDERLINE 25 | 26 | G = curses.color_pair(2) 27 | GB = curses.color_pair(2) + curses.A_BOLD 28 | GU = curses.color_pair(2) + curses.A_UNDERLINE 29 | GBU = GUB = curses.color_pair(2) + curses.A_BOLD + curses.A_UNDERLINE 30 | 31 | B = curses.color_pair(3) 32 | BB = curses.color_pair(3) + curses.A_BOLD 33 | BU = curses.color_pair(3) + curses.A_UNDERLINE 34 | BBU = BUB = curses.color_pair(3) + curses.A_BOLD + curses.A_UNDERLINE 35 | 36 | Y = curses.color_pair(4) 37 | YB = curses.color_pair(4) + curses.A_BOLD 38 | YU = curses.color_pair(4) + curses.A_UNDERLINE 39 | YBU = YUB = curses.color_pair(4) + curses.A_BOLD + curses.A_UNDERLINE 40 | 41 | 42 | C = curses.color_pair(5) 43 | CB = curses.color_pair(5) + curses.A_BOLD 44 | CU = curses.color_pair(5) + curses.A_UNDERLINE 45 | CBU = CUB = curses.color_pair(5) + curses.A_BOLD + curses.A_UNDERLINE 46 | 47 | M = curses.color_pair(6) 48 | MB = curses.color_pair(6) + curses.A_BOLD 49 | MU = curses.color_pair(6) + curses.A_UNDERLINE 50 | MBU = MUB = curses.color_pair(6) + curses.A_BOLD + curses.A_UNDERLINE 51 | -------------------------------------------------------------------------------- /Python/Wordle Game/custom_exceptions.py: -------------------------------------------------------------------------------- 1 | 2 | class WordListNotAvailable(Exception): 3 | def __init__(self, message= None, file_name= "words-list.txt"): 4 | if message is None: 5 | message = f"Please create a new \"{file_name}\" inside \"Wordle Game\" folder to collect words for the game." 6 | 7 | self.message = message 8 | 9 | def __str__(self): 10 | return str(self.message) -------------------------------------------------------------------------------- /Python/Wordle Game/utils.py: -------------------------------------------------------------------------------- 1 | import curses 2 | import os 3 | import random 4 | import time 5 | -------------------------------------------------------------------------------- /Python/Youtube Opener/open_Youtube.py: -------------------------------------------------------------------------------- 1 | from lib2to3.pgen2 import driver 2 | from selenium import webdriver 3 | from webdriver_manager.chrome import ChromeDriverManager 4 | 5 | driver = webdriver.Chrome(ChromeDriverManager().install()) 6 | driver.maximize_window() 7 | driver.get("https://www.youtube.com/") 8 | -------------------------------------------------------------------------------- /Python/Youtube Video Downloader/Youtube Video Downloader.py: -------------------------------------------------------------------------------- 1 | # importing tkinter 2 | from tkinter import * 3 | # importing YouTube module 4 | from pytube import YouTube 5 | # initializing tkinter 6 | root = Tk() 7 | # setting the geometry of the GUI 8 | root.geometry("400x350") 9 | # setting the title of the GUI 10 | root.title("Youtube video downloader application") 11 | # defining download function 12 | def download(): 13 | # using try and except to execute program without errors 14 | try: 15 | myVar.set("Downloading...") 16 | root.update() 17 | YouTube(link.get()).streams.first().download() 18 | link.set("Video downloaded successfully") 19 | except Exception as e: 20 | myVar.set("Mistake") 21 | root.update() 22 | link.set("Enter correct link") 23 | 24 | # created the Label widget to welcome user 25 | Label(root, text="Welcome to youtube\nDownloader Application", font="Consolas 15 bold").pack() 26 | # declaring StringVar type variable 27 | myVar = StringVar() 28 | # setting the default text to myVar 29 | myVar.set("Enter the link below") 30 | # created the Entry widget to ask user to enter the url 31 | Entry(root, textvariable=myVar, width=40).pack(pady=10) 32 | # declaring StringVar type variable 33 | link = StringVar() 34 | # created the Entry widget to get the link 35 | Entry(root, textvariable=link, width=40).pack(pady=10) 36 | # created and called the download function to download video 37 | Button(root, text="Download video", command=download).pack() 38 | # running the mainloop 39 | root.mainloop() -------------------------------------------------------------------------------- /Python/bar graph/bar graph.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | def drawBar(t,height,color): 3 | t.fillcolor(color) 4 | t.begin_fill() 5 | t.left(90) 6 | t.forward(height) 7 | t.write(str(height)) 8 | t.right(90) 9 | t.forward(40) 10 | t.right(90) 11 | t.forward(height) 12 | t.left(90) 13 | 14 | t.end_fill() 15 | xs=[] 16 | n = int(input("Enter number of elements : ")) 17 | for i in range(0, n): 18 | ele = int(input()) 19 | xs.append(ele) 20 | #xs=[48,117,200,96,134,260,99] 21 | clrs=["green","red","yellow","black","pink","brown","blue"] 22 | 23 | maxheight=max(xs) 24 | numbers=len(xs) 25 | border=10 26 | 27 | wn=turtle.Screen() 28 | wn.setworldcoordinates(0-border,0-border,40*numbers+border,maxheight+border) 29 | 30 | tess=turtle.Turtle() 31 | tess.pensize(3) 32 | 33 | for i in range(len(xs)): 34 | drawBar(tess,xs[i],clrs[i]) 35 | wn.exitonclick() -------------------------------------------------------------------------------- /Python/count down timer/countdowntimer.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | # The countdown function is defined below 4 | 5 | def countdown(t): 6 | 7 | while t: 8 | 9 | mins, secs = divmod(t, 60) 10 | 11 | timer = '{:02d}:{:02d}'.format(mins, secs) 12 | 13 | print(timer, end="\r") 14 | 15 | time.sleep(1) 16 | 17 | t -= 1 18 | 19 | print('Lift off!') 20 | 21 | # Ask the user to enter the countdown period in seconds 22 | 23 | t = input("Enter the time in seconds: ") 24 | 25 | # function call 26 | 27 | countdown(int(t)) -------------------------------------------------------------------------------- /Python/dice rolling simulator/Dice rolling simulator.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | 4 | x = "y" 5 | 6 | while x == "y": 7 | 8 | # Generates a random number 9 | # between 1 and 6 (including 10 | # both 1 and 6) 11 | no = random.randint(1,6) 12 | 13 | if no == 1: 14 | print("[-----]") 15 | print("[ ]") 16 | print("[ 0 ]") 17 | print("[ ]") 18 | print("[-----]") 19 | if no == 2: 20 | print("[-----]") 21 | print("[ 0 ]") 22 | print("[ ]") 23 | print("[ 0 ]") 24 | print("[-----]") 25 | if no == 3: 26 | print("[-----]") 27 | print("[ ]") 28 | print("[0 0 0]") 29 | print("[ ]") 30 | print("[-----]") 31 | if no == 4: 32 | print("[-----]") 33 | print("[0 0]") 34 | print("[ ]") 35 | print("[0 0]") 36 | print("[-----]") 37 | if no == 5: 38 | print("[-----]") 39 | print("[0 0]") 40 | print("[ 0 ]") 41 | print("[0 0]") 42 | print("[-----]") 43 | if no == 6: 44 | print("[-----]") 45 | print("[0 0 0]") 46 | print("[ ]") 47 | print("[0 0 0]") 48 | print("[-----]") 49 | 50 | x=input("press y to roll again and n to exit:") 51 | print("\n") -------------------------------------------------------------------------------- /Python/draw any program in turtle/draw_any_program_in_turtle.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | 4 | # creating turtle pen 5 | 6 | t = turtle.Turtle() 7 | 8 | 9 | # taking input for the no of the sides of the polygon 10 | 11 | n = int(input("Enter the no of the sides of the polygon : ")) 12 | 13 | 14 | # taking input for the length of the sides of the polygon 15 | 16 | l = int(input("Enter the length of the sides of the polygon : ")) 17 | 18 | 19 | 20 | 21 | 22 | for _ in range(n): 23 | 24 | turtle.forward(l) 25 | 26 | turtle.right(360 / n) -------------------------------------------------------------------------------- /Python/mad_libs_generator/Untitled-1.lua: -------------------------------------------------------------------------------- 1 | name = input(“Enter your name:”) 2 | verb_1 = input("Enter a verb of choice, and press enter:") 3 | adj_1 = input("Enter a adjective of choice, and press enter:") 4 | verb_2 = input("Enter second verb of choice, and press enter:") 5 | body_part = input("Enter a body part name of choice, and press enter:") 6 | adverb = input("Enter an adverb of choice, and press enter:") 7 | body_part_2 = input("Enter any body name of your choice,and press enter:") 8 | noun = input("Enter a noun of choice, and press enter:") 9 | verb_3 = input("Enter the third verb of choice, and press enter:") 10 | animal = input("Enter name of any animal of choice, and press enter:") 11 | noub_2 = input("Enter an noun of choice , and press enter:") 12 | verb_4 = input("Enter the fourth verb of choice, and press enter:") 13 | adj_2 = input("Enter an adjective of chioce, and press enter:") 14 | color = input("Enter any color name, and press enter:") 15 | story = "Most doctors agree that bicycle of" + verb_1 + " is a/an " + adj_1 + " form of exercise." + verb_2 +" a bicycle enables you to develop your " + body_part + " muscles as well as " + adverb + " increase the rate of a " + body_part_2 + " beat. More " + noun + " around the world "+ verb_3 +" bicycles than drive "+ animal +". No matter what kind of "+ noun_2 +"you "+ verb_4 + ", always be sure to wear a/an " +adj_2+ " helmet.Make sure to have " + color + " reflectors too! " 16 | print(story) -------------------------------------------------------------------------------- /Python/mad_libs_generator/Untitled-1.py: -------------------------------------------------------------------------------- 1 | """ Mad Libs Generator 2 | 3 | ---------------------------------------- 4 | 5 | """ 6 | 7 | #Loop back to this point once code finishes 8 | 9 | loop = 1 10 | 11 | while (loop < 10): 12 | 13 | # All the questions that the program asks the user 14 | 15 | noun = input("Choose a noun: ") 16 | 17 | p_noun = input("Choose a plural noun: ") 18 | 19 | noun2 = input("Choose a noun: ") 20 | 21 | place = input("Name a place: ") 22 | 23 | adjective = input("Choose an adjective (Describing word): ") 24 | 25 | noun3 = input("Choose a noun: ") 26 | 27 | #Displays the story based on the users input 28 | 29 | print ("------------------------------------------") 30 | 31 | print ("Be kind to your",noun,"- footed", p_noun) 32 | 33 | print ("For a duck may be somebody's", noun2,",") 34 | 35 | print ("Be kind to your",p_noun,"in",place) 36 | 37 | print ("Where the weather is always",adjective,".") 38 | 39 | print () 40 | 41 | print ("You may think that is this the",noun3,",") 42 | 43 | print ("Well it is.") 44 | 45 | print ("------------------------------------------") 46 | 47 | # Loop back to "loop = 1" 48 | 49 | loop = loop + 1r -------------------------------------------------------------------------------- /Python/mad_libs_generator/mad_libs.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | #Loop back to this point once code finishes 4 | 5 | loop = 1 6 | 7 | while (loop < 10): 8 | 9 | # All the questions that the program asks the user 10 | 11 | noun = input("Choose a noun: ") 12 | 13 | p_noun = input("Choose a plural noun: ") 14 | 15 | noun2 = input("Choose a noun: ") 16 | 17 | place = input("Name a place: ") 18 | 19 | adjective = input("Choose an adjective (Describing word): ") 20 | 21 | noun3 = input("Choose a noun: ") 22 | 23 | #Displays the story based on the users input 24 | 25 | print ("------------------------------------------") 26 | 27 | print ("Be kind to your",noun,"- footed", p_noun) 28 | 29 | print ("For a duck may be somebody's", noun2,",") 30 | 31 | print ("Be kind to your",p_noun,"in",place) 32 | 33 | print ("Where the weather is always",adjective,".") 34 | 35 | print () 36 | 37 | print ("You may think that is this the",noun3,",") 38 | 39 | print ("Well it is.") 40 | 41 | print ("------------------------------------------") 42 | 43 | # Loop back to "loop = 1" 44 | 45 | loop = loop + 1 -------------------------------------------------------------------------------- /Python/palette with trackbars/main.py: -------------------------------------------------------------------------------- 1 | # Python program to create RGB color 2 | # palette with trackbars 3 | 4 | # importing libraries 5 | import cv2 6 | import numpy as np 7 | 8 | # empty function called when 9 | # any trackbar moves 10 | def emptyFunction(): 11 | pass 12 | 13 | def main(): 14 | 15 | # blackwindow having 3 color chanels 16 | image = np.zeros((512, 512, 3), np.uint8) 17 | windowName ="Open CV Color Palette" 18 | 19 | # window name 20 | cv2.namedWindow(windowName) 21 | 22 | # there trackbars which have the name 23 | # of trackbars min and max value 24 | cv2.createTrackbar('Blue', windowName, 0, 255, emptyFunction) 25 | cv2.createTrackbar('Green', windowName, 0, 255, emptyFunction) 26 | cv2.createTrackbar('Red', windowName, 0, 255, emptyFunction) 27 | 28 | # Used to open the window 29 | # till press the ESC key 30 | while(True): 31 | cv2.imshow(windowName, image) 32 | 33 | if cv2.waitKey(1) == 27: 34 | break 35 | 36 | # values of blue, green, red 37 | blue = cv2.getTrackbarPos('Blue', windowName) 38 | green = cv2.getTrackbarPos('Green', windowName) 39 | red = cv2.getTrackbarPos('Red', windowName) 40 | 41 | # merge all three color chanels and 42 | # make the image composites image from rgb 43 | image[:] = [blue, green, red] 44 | print(blue, green, red) 45 | 46 | cv2.destroyAllWindows() 47 | 48 | # Calling main() 49 | if __name__=="__main__": 50 | main() 51 | -------------------------------------------------------------------------------- /Python/pdf watermark/requirements.txt: -------------------------------------------------------------------------------- 1 | PyPDF4 -------------------------------------------------------------------------------- /Python/pdf watermark/watermark.py: -------------------------------------------------------------------------------- 1 | # Watermark PDF files 2 | # pip install PyPDF4 3 | import PyPDF4 4 | 5 | def Watermark(): 6 | pdf_file= "test.pdf" 7 | output_pdf= "output.pdf" 8 | watermark= "watermark.pdf" 9 | 10 | watermark_read = PyPDF4.PdfFileReader(watermark) 11 | watermark_page = watermark_read.getPage(0) 12 | pdf_reader = PyPDF4.PdfFileReader(pdf_file) 13 | pdf_writer = PyPDF4.PdfFileWriter() 14 | 15 | for page in range(pdf_reader.getNumPages()): 16 | page = pdf_reader.getPage(page) 17 | page.mergePage(watermark_page) 18 | pdf_writer.addPage(page) 19 | 20 | # writing output pdf file 21 | with open(output_pdf, 'wb') as pdf: 22 | pdf_writer.write(pdf) 23 | 24 | Watermark() -------------------------------------------------------------------------------- /Python/rock-paper-scissors/readme.md: -------------------------------------------------------------------------------- 1 | # ROCK PAPER SCISSORS 2 | 3 | #### Winning Rules of the Rock paper scissor game as follows: 4 | * Rock(🪨) vs Paper(📃) -> Paper(📃) wins 5 | * Rock(🪨) vs Scissor(✂️) -> Rock(🪨) wins 6 | * Paper(📃) vs Scissor(✂️) -> Scissor(✂️) wins 7 | ####The first one to win 3 rounds is the final winner. 8 | 9 | ### Usage: 10 | * clone the repo. 11 | * open the `rock-paper-scissors` folder. 12 | * run using cmd `python rps.py` -------------------------------------------------------------------------------- /Python/rock-paper-scissors/rps.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | name = input("Enter your name: ").upper() 4 | print("="*75+"\n") 5 | print(f"WELCOME {name} TO ROCK PAPER SCISSOR GAME!!!\n") 6 | print("Winning Rules of the Rock Paper Scissor game as follows: \n" 7 | +"Rock(🪨) vs Paper(📃) -> Paper(📃) wins \n" 8 | +"Rock(🪨) vs Scissor(✂️) -> Rock(🪨) wins \n" 9 | +"Paper(📃) vs Scissor(✂️) -> Scissor(✂️) wins \n") 10 | print("The first one to win 3 rounds is the final winner.") 11 | print("SO LET THE GAME BEGINS!!!") 12 | print("="*75+"\n") 13 | 14 | def getUser(): 15 | hand = input("Enter - R(for rock) | P(for paper) | S(for scissor): ").upper() 16 | while not (hand == "R" or hand == "P" or hand == "S"): 17 | hand = input("Enter - R(for rock) | P(for paper) | S(for scissor): ").upper() 18 | return hand 19 | 20 | def getPc(): 21 | list = ['Rock','Paper','Scissor'] 22 | return random.choice(list) 23 | 24 | def winner(user, pc): 25 | if user == "R" and pc == "Rock": 26 | return "DRAW" 27 | elif user == "R" and pc == "Paper": 28 | return "PC" 29 | elif user == "R" and pc == "Scissor": 30 | return f"{name}" 31 | elif user == "P" and pc == "Paper": 32 | return "DRAW" 33 | elif user == "P" and pc == "Rock": 34 | return f"{name}" 35 | elif user == "P" and pc == "Scissor": 36 | return "PC" 37 | elif user == "S" and pc == "Scissor": 38 | return "DRAW" 39 | elif user == "S" and pc == "Paper": 40 | return f"{name}" 41 | elif user == "S" and pc == "Rock": 42 | return "PC" 43 | else: 44 | return "DRAW" 45 | 46 | user_score = 0 47 | pc_score = 0 48 | 49 | while True: 50 | user = getUser() 51 | pc = getPc() 52 | print(f"PC choose {pc}.") 53 | win = winner(user, pc) 54 | if win == name or win == "PC": 55 | print(f"WINNER OF THIS ROUND : {win}") 56 | else: 57 | print(win) 58 | if win == name: 59 | user_score += 1 60 | if user_score == 3: 61 | break 62 | elif win == "PC": 63 | pc_score += 1 64 | if pc_score == 3: 65 | break 66 | 67 | if user_score > pc_score: 68 | print(f"CONGRATULATIONS YOU ARE THE WINNER!!!!") 69 | else: 70 | print("SORRY YOU LOST PLEASE TRY AGAIN!!!") 71 | -------------------------------------------------------------------------------- /Python/word guessing/wordguessing.py: -------------------------------------------------------------------------------- 1 | import random 2 | # library that we use in order to choose 3 | # on random words from a list of words 4 | 5 | name = input("What is your name? ") 6 | # Here the user is asked to enter the name first 7 | 8 | print("Good Luck ! ", name) 9 | 10 | words = ['rainbow', 'computer', 'science', 'programming', 11 | 'python', 'mathematics', 'player', 'condition', 12 | 'reverse', 'water', 'board', 'geeks'] 13 | 14 | # Function will choose one random 15 | # word from this list of words 16 | word = random.choice(words) 17 | 18 | 19 | print("Guess the characters") 20 | 21 | guesses = '' 22 | # any number of turns can be used here 23 | turns = 12 24 | 25 | 26 | while turns > 0: 27 | 28 | # counts the number of times a user fails 29 | failed = 0 30 | 31 | # all characters from the input 32 | # word taking one at a time. 33 | for char in word: 34 | 35 | # comparing that character with 36 | # the character in guesses 37 | if char in guesses: 38 | print(char, end=" ") 39 | 40 | else: 41 | print("_") 42 | print(char, end=" ") 43 | # for every failure 1 will be 44 | # incremented in failure 45 | failed += 1 46 | 47 | if failed == 0: 48 | # user will win the game if failure is 0 49 | # and 'You Win' will be given as output 50 | print("You Win") 51 | 52 | # this print the correct word 53 | print("The word is: ", word) 54 | break 55 | 56 | # if user has input the wrong alphabet then 57 | # it will ask user to enter another alphabet 58 | print() 59 | guess = input("guess a character:") 60 | 61 | # every input character will be stored in guesses 62 | guesses += guess 63 | 64 | # check input with the character in word 65 | if guess not in word: 66 | 67 | turns -= 1 68 | 69 | # if the character doesn’t match the word 70 | # then “Wrong” will be given as output 71 | print("Wrong") 72 | 73 | # this will print the number of 74 | # turns left for the user 75 | print("You have", + turns, 'more guesses') 76 | 77 | if turns == 0: 78 | print("You Loose") -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Stunning Scripts 2 | ![Stunning-Scripts](https://socialify.git.ci/Subhradeep10/Stunning-Scripts/image?description=1&font=KoHo&forks=1&issues=1&language=1&logo=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F70656957%3Fv%3D4&name=1&owner=1&pattern=Floating%20Cogs&pulls=1&stargazers=1&theme=Dark) 3 | 4 | ## About 5 | 6 | The main objective of this repository is to support both novice and seasoned contributors to open source programming. Scripts in Python, JavaScript, Bash, PowerShell, and other languages are found in Stunning Scripts. As a Developer, think of this repository as your personal area to discover or contribute any new scripts that can simplify life for us and the wider open source community, as well as find a use for coding to relieve boredom. 7 | 8 | ## How to Contribute 9 | 10 | - Read the [Contributing Guidelines](Contruibuting.md) before making a PR. 11 | - Check for existing issues or create your own issues and wait for it to be assigned to you. 12 | - Fork the repository 13 | - Clone the forked repository to your local machine 14 | - Create a folder with the name of the script to a question you want to add if it is not present. 15 | - Add the code to that folder 16 | - Add a README.md file to the folder explaining the code 17 | - Open the command prompt and cd into the repository folder 18 | - Run the following Commands 19 | 20 | ``` 21 | git add . 22 | git commit -m"" 23 | git push 24 | ``` 25 | 26 | - Come back to Github and Open a Pull Request 27 | - While making Pull Request maintain the template provided to you 28 | - We will check if its a valid pull request and merge it 29 | 30 | ## To get a detailed explanation of the above steps refer to the following videos 31 | 32 | - [Intro to GitHub](https://youtu.be/wTTek8P2VB4) 33 | - [How to Create a Repository](https://youtu.be/o6T5F7-SOAo) 34 | - [Cloning a Repository](https://youtu.be/oYselL5G280) 35 | - [Contributing to a Project](https://youtu.be/4vq07q7g2xE) 36 | 37 | ## Project Maintainers 38 | 39 | 40 | 41 | 47 | 48 |
42 | 43 |
44 | Subhradeep10 45 |
46 |
49 | 50 | ## Contributors 51 | 52 | 53 | 54 | 55 | 56 | ### If you find this repository Helpful consider leaving ⭐ 57 | -------------------------------------------------------------------------------- /Rust/Youtube_Downloader/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ytdl" 3 | version = "0.1.0" 4 | authors = ["Gokul Soumya "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | pico-args = "0.4.0" 11 | 12 | [dependencies.rustube] 13 | version = "0.2.10" 14 | features = ["blocking", "download", "regex", "std", "descramble"] 15 | -------------------------------------------------------------------------------- /Rust/Youtube_Downloader/README.md: -------------------------------------------------------------------------------- 1 | # ytdl 2 | 3 | Rust command line app to download youtube videos. 4 | 5 | ## Install 6 | 7 | `ytdl` requires the nightly compiler. Install `rustup` to manage multiple 8 | toolchains and run `rustup override set nightly` to use the nightly compiler 9 | for the current directory. 10 | 11 | ## Dependencies 12 | 13 | `ytdl` depends on the following crates (downloaded automatically by cargo): 14 | 15 | - `rustube` 16 | - `pico_args` 17 | 18 | ## Running 19 | 20 | Build the project using `cargo build`. The binary will be present in `./target/debug/ytdl`. 21 | Use `ytdl --help` to see all options. 22 | 23 | ![ytdl demo](https://i.imgur.com/pzvsmQn.jpg) 24 | -------------------------------------------------------------------------------- /Rust/Youtube_Downloader/src/cli.rs: -------------------------------------------------------------------------------- 1 | // for commandline argument parsing 2 | use pico_args::Arguments; 3 | 4 | const HELP: &str = "\ 5 | 6 | ytdl 7 | Download youtube videos from the commandline. Downloads to 8 | current directory by default. 9 | 10 | USAGE: 11 | ytdl [OPTIONS] 12 | 13 | FLAGS: 14 | -h, --help Prints help information 15 | --audio-only Download audio only 16 | --video-only Download video only 17 | 18 | ARGS: 19 | URL of the video to download 20 | "; 21 | 22 | #[derive(Debug)] 23 | pub struct AppArgs { 24 | pub url: String, 25 | pub audio_only: bool, 26 | pub video_only: bool, 27 | } 28 | 29 | pub fn parse_args() -> Result> { 30 | let mut cmdargs = Arguments::from_env(); 31 | 32 | // Help has a higher priority and should be handled separately. 33 | if cmdargs.contains(["-h", "--help"]) { 34 | print!("{}", HELP); 35 | std::process::exit(0); 36 | } 37 | 38 | let args = AppArgs { 39 | url: cmdargs.free_from_str()?, 40 | audio_only: cmdargs.contains("--audio-only"), 41 | video_only: cmdargs.contains("--video-only"), 42 | }; 43 | 44 | // extraneous additional argumetns 45 | let remaining = cmdargs.finish(); 46 | if !remaining.is_empty() { 47 | return Err("Additional arguments specifed".into()); 48 | } 49 | 50 | Ok(args) 51 | } 52 | -------------------------------------------------------------------------------- /Rust/Youtube_Downloader/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::error::Error; 2 | // for downlading the data from youtube 3 | use rustube::{block, Id, VideoFetcher}; 4 | 5 | mod cli; 6 | 7 | fn main() { 8 | let args = cli::parse_args().expect("Couldn't parse arguments"); 9 | run(args).expect("Failed to download video"); 10 | } 11 | 12 | // this fucntion handles all the program logic 13 | fn run(args: cli::AppArgs) -> Result<(), Box> { 14 | let id = Id::from_raw(&args.url)?; 15 | 16 | // block!() macro is provided by rustube library to run async functions synchronously 17 | let descrambler = block!(VideoFetcher::from_id(id.into_owned())?.fetch())?; 18 | println!(); 19 | println!("Downloading '{}'", descrambler.video_title()); 20 | 21 | let video = descrambler.descramble()?; 22 | 23 | let to_download = if args.audio_only { 24 | video.best_audio() 25 | } else if args.video_only { 26 | video.best_video() 27 | } else { 28 | video.best_quality() 29 | } 30 | .unwrap(); 31 | 32 | let path = block!(to_download.download())?; 33 | println!("Downloaded to {}", path.to_str().unwrap_or_default()); 34 | 35 | Ok(()) 36 | } 37 | -------------------------------------------------------------------------------- /Rust/email-validator/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aho-corasick" 7 | version = "0.7.18" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" 10 | dependencies = [ 11 | "memchr", 12 | ] 13 | 14 | [[package]] 15 | name = "atty" 16 | version = "0.2.14" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 19 | dependencies = [ 20 | "hermit-abi", 21 | "libc", 22 | "winapi", 23 | ] 24 | 25 | [[package]] 26 | name = "colored" 27 | version = "2.0.0" 28 | source = "registry+https://github.com/rust-lang/crates.io-index" 29 | checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" 30 | dependencies = [ 31 | "atty", 32 | "lazy_static", 33 | "winapi", 34 | ] 35 | 36 | [[package]] 37 | name = "email-validator" 38 | version = "0.1.0" 39 | dependencies = [ 40 | "colored", 41 | "regex", 42 | ] 43 | 44 | [[package]] 45 | name = "hermit-abi" 46 | version = "0.1.19" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 49 | dependencies = [ 50 | "libc", 51 | ] 52 | 53 | [[package]] 54 | name = "lazy_static" 55 | version = "1.4.0" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 58 | 59 | [[package]] 60 | name = "libc" 61 | version = "0.2.119" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" 64 | 65 | [[package]] 66 | name = "memchr" 67 | version = "2.4.1" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 70 | 71 | [[package]] 72 | name = "regex" 73 | version = "1.5.5" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" 76 | dependencies = [ 77 | "aho-corasick", 78 | "memchr", 79 | "regex-syntax", 80 | ] 81 | 82 | [[package]] 83 | name = "regex-syntax" 84 | version = "0.6.25" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" 87 | 88 | [[package]] 89 | name = "winapi" 90 | version = "0.3.9" 91 | source = "registry+https://github.com/rust-lang/crates.io-index" 92 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 93 | dependencies = [ 94 | "winapi-i686-pc-windows-gnu", 95 | "winapi-x86_64-pc-windows-gnu", 96 | ] 97 | 98 | [[package]] 99 | name = "winapi-i686-pc-windows-gnu" 100 | version = "0.4.0" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 103 | 104 | [[package]] 105 | name = "winapi-x86_64-pc-windows-gnu" 106 | version = "0.4.0" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 109 | -------------------------------------------------------------------------------- /Rust/email-validator/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "email-validator" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | regex = "1" 10 | colored = "2" -------------------------------------------------------------------------------- /Rust/email-validator/README.md: -------------------------------------------------------------------------------- 1 | # Email Validator 2 | 3 | This Rust Script will apply checks on the Email Addresses which in case turns out to be invalid then we can throw errors and add this feature wherever we think of using Rust as Backend. 4 | 5 | ## Install 6 | 7 | - Get the file on your System. 8 | - Setup Cargo 9 | - Run `Cargo run` and you are good to go. 10 | 11 | ## Dependencies 12 | 13 | Script depends on the following crates (downloaded automatically by cargo): 14 | 15 | - `regex` 16 | - `colored` 17 | 18 | ## Running 19 | 20 | Build the project using `cargo build`. The binary will be present in `./target/debug/ytdl`. 21 | 22 | ## Author 23 | 24 | Harshil Jani 25 | -------------------------------------------------------------------------------- /Rust/email-validator/src/main.rs: -------------------------------------------------------------------------------- 1 | extern crate regex; 2 | extern crate colored; 3 | use std::io; 4 | use regex::Regex; 5 | use colored::*; 6 | 7 | fn main() { 8 | println!("Enter your E-mail Address : "); 9 | let mut mail = String::new(); 10 | io::stdin().read_line(&mut mail).expect("Provide Valid Mail ID !"); 11 | let chunks: Vec<_> = mail.split('@').collect(); 12 | let mut count : u32 = 0; 13 | let mut pre; 14 | let mut post; 15 | for s in chunks{ 16 | if count==2 { 17 | println!("{}","Invalid Mail ID".red()); 18 | return 19 | } 20 | if count==0 { 21 | pre = s; 22 | let mut pre_check : bool; 23 | let pre_regex = Regex::new(r"^[A-Za-z]+").unwrap(); 24 | pre_check = pre_regex.is_match(pre); 25 | if pre_check == false { 26 | println!("{}","Email Address Must start with a character word only !".red()); 27 | return 28 | } 29 | }else{ 30 | post = s; 31 | let domains: Vec<_> = post.split('.').collect(); 32 | for domain in domains{ 33 | let post_regex = Regex::new(r"^[a-z]+$|\n$").unwrap(); 34 | let post_check = post_regex.is_match(domain); 35 | if post_check == false{ 36 | println!("{}","The Domain name is not allowed !".red()); 37 | return 38 | } 39 | } 40 | } 41 | count += 1; 42 | } 43 | println!("{}","The Email Address Provided is available".green()); 44 | } 45 | -------------------------------------------------------------------------------- /banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/banner.png -------------------------------------------------------------------------------- /container.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Subhradeep10/Stunning-Scripts/91d0ce33e6d28dec35c8f9cd3573f543230b311f/container.jpg --------------------------------------------------------------------------------