Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orengrinker/slacknewsapi
SlackNewsBot is a Python application that automatically fetches and posts the latest Israeli news headlines to your Slack channel, keeping your team informed and engaged directly within your workspace.
https://github.com/orengrinker/slacknewsapi
news newsapi python slack slack-api
Last synced: 25 days ago
JSON representation
SlackNewsBot is a Python application that automatically fetches and posts the latest Israeli news headlines to your Slack channel, keeping your team informed and engaged directly within your workspace.
- Host: GitHub
- URL: https://github.com/orengrinker/slacknewsapi
- Owner: OrenGrinker
- Created: 2024-03-02T17:36:11.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-02T17:52:54.000Z (10 months ago)
- Last Synced: 2024-03-02T18:39:14.182Z (10 months ago)
- Topics: news, newsapi, python, slack, slack-api
- Language: Python
- Homepage:
- Size: 1.57 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SlackNewsBot
SlackNewsBot is a Python script that fetches the top news headlines from Israel using NewsAPI and posts them to a specified Slack channel.
## Setting Up
### Prerequisites
- Python 3.x
- `requests` library
- `slack_sdk` library### Installation
1. Clone this repository or download the files.
2. Install the required Python libraries:pip install -r requirements.txt
### Configuring Slack
1. Create a new Slack app at [Slack API](https://api.slack.com/apps).
2. Add permissions to the app: `chat:write`.
3. Install the app to your workspace and note the OAuth token (begins with `xoxb-`).
4. Find the ID of the Slack channel where you want to post the news.### Configuring NewsAPI
1. Sign up at [NewsAPI](https://newsapi.org/register) and get your API key.
#### Setting Up the Application
1. Navigate to the `config.py` file.
2. Replace `YOUR_NEWSAPI_KEY`, `YOUR_SLACK_BOT_TOKEN`, and `YOUR_SLACK_CHANNEL_ID` with your actual NewsAPI key, Slack bot token, and Slack channel ID, respectively.## Running the Application
To run the application, execute the following command in the terminal:
python main.py
The script will fetch the latest news from Israel and post it to the specified Slack channel.
## Screenshot
![SlackNewsBot Screenshot](https://github.com/OrenGrinker/SlackNewsAPI/blob/636ff9336802a598e95b44c8736c2a6a3487fbe0/Screenshot%202024-03-02%20at%2019.31.08.png)