|
8 years ago | |
---|---|---|
.. | ||
tests | 8 years ago | |
README.md | 8 years ago | |
__init__.py | 8 years ago | |
rss_reader.py | 8 years ago |
This neuron access to a RSS feed and gives their items.
parameter | required | default | choices | comment |
---|---|---|---|---|
feed_url | YES | Url of the feed. | ||
max_items | NO | 30 | Max items to returns. |
Name | Description | Type | sample |
---|---|---|---|
feed | Title of the feed | string | The Verge |
items | A List with feed items (see RSS spec) | list |
Simple example. This is based on a file_template
- name: "news-theVerge"
signals:
- order: "What are the news from the verge ?"
neurons:
- rss_reader:
feed_url: "http://www.theverge.com/rss/index.xml"
file_template: templates/en_rss.j2
A example with max items set to 10. This is based on a file_template
- name: "news-sport"
signals:
- order: "What are the sport news ?"
neurons:
- rss_reader:
feed_url: "https://sports.yahoo.com/top/rss.xml"
max_items: 10
file_template: templates/en_rss.j2
Here the content of the en_rss.j2
Here's the news from {{ feed }}
{% set count = 1 %}
{% for item in items %}
News {{ count }}. {{ item.title }}.
{% set count = count + 1 %}
{% endfor %}