├── requirements.txt ├── assets └── favicon.ico ├── LICENSE ├── Fastlink.py └── README.md /requirements.txt: -------------------------------------------------------------------------------- 1 | tkinter 2 | pyshorteners 3 | -------------------------------------------------------------------------------- /assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alok-2002/FastLink-Tkinter-Project/HEAD/assets/favicon.ico -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Alok Sharma 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 | -------------------------------------------------------------------------------- /Fastlink.py: -------------------------------------------------------------------------------- 1 | import tkinter as tk 2 | import pyshorteners 3 | import os 4 | import sys 5 | 6 | def get_resource_path(relative_path): 7 | if getattr(sys, 'frozen', False): 8 | bundle_dir = sys._MEIPASS 9 | return os.path.join(bundle_dir, relative_path) 10 | base_path = os.path.abspath('.') 11 | return os.path.join(base_path, relative_path) 12 | 13 | 14 | def shorten(): 15 | shortener = pyshorteners.Shortener() 16 | short_url = shortener.tinyurl.short(longurl_entry.get()) 17 | shorturl_entry.delete(0, tk.END) 18 | shorturl_entry.insert(0, short_url) 19 | 20 | root = tk.Tk() 21 | root.title("URL Shortener") 22 | root.geometry("400x200") 23 | 24 | favicon_path = get_resource_path('assets/favicon.ico') 25 | root.iconbitmap(favicon_path) 26 | 27 | FONT = ("Arial", 12) 28 | LABEL_BG = "#ECECEC" 29 | ENTRY_BG = "white" 30 | BUTTON_BG = "#4CAF50" 31 | BUTTON_FG = "white" 32 | 33 | container_frame = tk.Frame(root, bg="white") 34 | container_frame.pack(fill=tk.BOTH, expand=True, padx=10, pady=10) 35 | 36 | longurl_label = tk.Label(container_frame, text="Enter Long URL", font=FONT, bg=LABEL_BG) 37 | longurl_entry = tk.Entry(container_frame, font=FONT, width=40, bg=ENTRY_BG) 38 | shorturl_label = tk.Label(container_frame, text="Output shortened URL", font=FONT, bg=LABEL_BG) 39 | shorturl_entry = tk.Entry(container_frame, font=FONT, width=40, bg=ENTRY_BG) 40 | shorten_button = tk.Button(container_frame, text="Shorten URL", font=FONT, bg=BUTTON_BG, fg=BUTTON_FG, command=shorten) 41 | 42 | longurl_label.pack(pady=(0, 5)) 43 | longurl_entry.pack(pady=(0, 10)) 44 | shorturl_label.pack(pady=(0, 5)) 45 | shorturl_entry.pack(pady=(0, 10)) 46 | shorten_button.pack() 47 | 48 | root.mainloop() 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FastLink-Tkinter-Project 2 | 3 | FastLink-Tkinter-Project is a Python application built with the Tkinter library that allows you to shorten URLs quickly and easily. 4 | 5 | ## Features 6 | 7 | - Enter a long URL and generate a shortened URL with just one click. 8 | - The application uses the pyshorteners library to shorten the URLs using popular URL shortening services. 9 | - The shortened URL is displayed in an entry field, ready to be copied and shared. 10 | 11 | ## Installation 12 | 13 | 1. Clone the repository: 14 | 15 | ``` 16 | git clone https://github.com/alok-2002/FastLink-Tkinter-Project.git 17 | ``` 18 | 19 | 2. Navigate to the project directory: 20 | 21 | ``` 22 | cd FastLink-Tkinter-Project 23 | ``` 24 | 25 | 3. Install the required dependencies: 26 | 27 | ``` 28 | pip install -r requirements.txt 29 | ``` 30 | 31 | ## Usage 32 | 33 | Run the following command to start the application: 34 | 35 | ``` 36 | python Fastlink.py 37 | ``` 38 | 39 | The application window will appear, allowing you to enter a long URL and generate a shortened URL. 40 | 41 | ## Screenshots 42 | 43 | ![image](https://github.com/Alok-2002/FastLink-Tkinter-Project/assets/93814546/84a62b8d-bb76-456f-bdb3-6f72d03cb9f7) 44 | 45 | Include any relevant screenshots of your application here to showcase its functionality. For example, you can include screenshots of the main window, inputting a URL, and generating a shortened URL. 46 | 47 | ## Contributing 48 | 49 | Contributions are welcome! If you would like to contribute to this project, please follow these steps: 50 | 51 | 1. Fork the repository. 52 | 2. Create a new branch for your feature or bug fix. 53 | 3. Make your changes and commit them. 54 | 4. Push your changes to your forked repository. 55 | 5. Submit a pull request to the main repository. 56 | 57 | ## License 58 | 59 | This project is licensed under the [MIT License](LICENSE). 60 | 61 | ## Acknowledgements 62 | 63 | - [Tkinter](https://docs.python.org/3/library/tkinter.html) - The Python standard GUI package. 64 | - [pyshorteners](https://github.com/ellisonleao/pyshorteners) - A Python library for URL shortening. 65 | 66 | ## Contact 67 | 68 | If you have any questions or suggestions, feel free to reach out to me at [sharmaalok02gwl@gmail.com](mailto:sharmaalok02gwl@gmail.com). 69 | --------------------------------------------------------------------------------