inquisitor/sources/example.py

18 lines
427 B
Python
Raw Normal View History

2019-05-16 02:40:14 +00:00
"""
An example itemsource that produces an item with the current date.
Fetch new items with `python inquisitor update --sources example`
2019-05-16 02:40:14 +00:00
"""
# Standard library imports
from datetime import date
import time
2019-12-17 08:39:04 +00:00
def fetch_new(state):
2019-05-16 02:40:14 +00:00
now = date.today()
2019-12-17 08:39:04 +00:00
item = {
'source': "example",
'id': '{}-{}-{}'.format(now.year, now.month, now.day),
'title': "Today is {}-{}-{}".format(now.year, now.month, now.day),
}
2019-05-16 02:40:14 +00:00
return [item]