Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marado/hattai-fortune
Hattai's Fortune: a script that gives news
https://github.com/marado/hattai-fortune
feed news python script
Last synced: about 2 months ago
JSON representation
Hattai's Fortune: a script that gives news
- Host: GitHub
- URL: https://github.com/marado/hattai-fortune
- Owner: marado
- License: gpl-3.0
- Created: 2013-09-24T13:51:51.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-11-11T18:01:49.000Z (about 2 months ago)
- Last Synced: 2024-11-11T19:18:27.154Z (about 2 months ago)
- Topics: feed, news, python, script
- Language: Python
- Homepage:
- Size: 534 KB
- Stars: 2
- Watchers: 2
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
hattai-fortune
==============Hattai's Fortune: a script to be used by a bot, that gives news.
This script depends on feedparser, which should be installed on your system.
This script depends on python 3.2 or above.
## Script's behaviour
When run the script will:
1. Read the given (hardcoded) RSS feed:
(at this moment, Google News' feed for in-Portuguese Portugal News)
2. Exclude the articles which contain any word from a given list of "bad words"
(the match is case **insensitive**)
3. Exclude articles which have an empty title
4. Add new articles to the article list
5. Trim the article list up to a given maximum size
6. Pick the "best" article from the article list and:
1. Store the title in a file called _title_
2. Store the URL in a file called _link_
2. Store the description in a file called _desc_
3. Print out the title to STDOUT
7. Save the current article list for the next runThe way the "best article" is chosen is roughly like this:
- Look for the articles which have been used the least (ideally never)
- Pick the most recent oneWe assume the feed delivers the articles ordered by date, so no check is done
on the script.