Skip to content

Commit 0e90460

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 84f4a88 + ec20ad0 commit 0e90460

File tree

3 files changed

+114
-0
lines changed

3 files changed

+114
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) [2024] [JawadSher]
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.
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Desktop Notifier - News Notifier
2+
3+
This Python script fetches news articles from various categories such as world, technology, sports, business, health, science, and entertainment from CNN's RSS feeds and displays toast notifications on Windows 10. Users can click on the notifications to open the corresponding news articles in their web browser.
4+
5+
## How it Works
6+
7+
1. **RSS Feeds Configuration**: The script is configured with RSS feed URLs for different news categories from CNN.
8+
9+
2. **Notification Setup**: It uses the `win10toast-click` library to create toast notifications on Windows 10. Notifications include the title and summary of news articles truncated to a maximum length.
10+
11+
3. **Fetching News**: The script fetches news articles from the provided RSS feed URL using the `feedparser` library.
12+
13+
4. **Truncating Strings**: A helper function is used to truncate long strings (title and summary) to a specified maximum length to fit within the notification window.
14+
15+
5. **Showing Notifications**: The `notify_news` function creates and displays toast notifications for each news article fetched. Clicking on a notification opens the corresponding news article in the default web browser.
16+
17+
6. **Main Loop**: An asynchronous main loop periodically fetches news articles from the selected category's RSS feed and displays notifications for new articles.
18+
19+
7. **User Interaction**: Users are prompted to select a news category from the available options. If an invalid category is selected, an error message is displayed.
20+
21+
## Usage
22+
23+
1. Clone the repository.
24+
3. Run the script using `python news_notifier.py`.
25+
4. Follow the on-screen instructions to select a news category.
26+
27+
## Requirements
28+
29+
- Python 3.x
30+
- `feedparser` library
31+
- `win10toast-click` library
32+
33+
## Example
34+
35+
```bash
36+
$ python news_notifier.py
37+
Please select a news category from the following options:
38+
- world
39+
- technology
40+
- sports
41+
- business
42+
- health
43+
- science
44+
- entertainment
45+
Enter the category: health

README.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<h1 align='center'>P Y T H O N - P R O J E C T S</h1>
2+
Welcome to the Python Projects repository, where you can find a collection of Python-based programming projects designed to enhance your coding skills from beginner to advanced levels.
3+
4+
## Table of Contents
5+
This repository includes various Python projects:
6+
7+
| Project Name | Description |
8+
|--------------------------------|---------------------------------------|
9+
| 1. [Number Guessing Game](https://github.com/JawadSher/Python-Projects-Beginner-to-Advance/tree/main/Project%201%20-%20Number%20Guessing%20Game) | A game where players guess a number |
10+
| 2. [Word Guessing Game](https://github.com/JawadSher/Python-Projects-Beginner-to-Advance/tree/main/Project%202%20-%20Word%20Guessing%20Game) | A game where players guess a word |
11+
| 3. [Hangman Game](https://github.com/JawadSher/Python-Projects-Beginner-to-Advance/tree/main/Project%203%20-%20Hungman%20Game) | The classic Hangman game implementation |
12+
| 4. [Rock Paper Scissors](https://github.com/JawadSher/Python-Projects-Beginner-to-Advance/tree/main/Project%204%20-%20Rock%20Paper%20Scissor) | Digital version of the popular game |
13+
| 5. [Taking Screenshot Application](https://github.com/JawadSher/Python-Projects-Beginner-to-Advance/tree/main/Project%205%20-%20Taking%20Screenshot%20Application) | Application to capture desktop screenshots |
14+
| 6. [Desktop Notifier](https://github.com/JawadSher/Python-Projects-Beginner-to-Advance/tree/main/Project%206%20-%20Desktop%20Notifier) | Application for displaying desktop notifications |
15+
16+
## Introduction
17+
18+
This repository contains a series of Python projects tailored to help beginners dive into Python programming and gradually advance their skills. Each project is carefully crafted to cover various aspects of Python programming, including basic syntax, data structures, algorithms, and popular libraries.
19+
20+
<img src="https://bensstats.wordpress.com/wp-content/uploads/2020/08/zero-to-hero.gif?w=900">
21+
22+
## Installation
23+
24+
To run these projects locally, follow these steps:
25+
26+
1. Clone the repository to your local machine:
27+
28+
```bash
29+
git clone https://github.com/JawadSher/Python-Projects-Beginner-to-Advance.git
30+
```
31+
32+
2. Navigate to the project directory:
33+
34+
```bash
35+
cd Python-Projects-Beginner-to-Advance
36+
```
37+
38+
## Usage
39+
40+
Each project directory contains its own README file with specific instructions on how to run and use the project. Follow the instructions provided in each project's README to get started.
41+
42+
## Contributing
43+
44+
Contributions to this project are welcome! If you have ideas for new projects or improvements to existing ones, feel free to open an issue or submit a pull request.
45+
46+
## License
47+
48+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)