command
module
Version:
v0.0.0-...-aa867fc
Opens a new window with list of versions in this module.
Published: Mar 10, 2024
License: Unlicense
Opens a new window with license information.
Imports: 11
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Redis: Zero to Master in 30 minutes
From here and
here.
Order of operations
NOTE: failure at any point will simply exit with a status of zero
- Looks for the required
OPENMYMIND_RSS_URL
environment variable.
- Connects to Redis at
localhost:6379
.
- Fetches the RSS feed from the URL set in
OPENMYMIND_RSS_URL
.
- Decodes the XML in the RSS feed.
- Ranges across every item found in the feed:
- Converts the entire item to JSON.
- Converts the publication date to a UNIX timestamp.
- Sets the value of Redis key
item:<item guid>
to the entire JSON payload.
- Adds the above key to a sorted set where the score is the publication date.
- Gets the keys of the three most recent items from the sorted set.
- For each of these keys:
- Gets the JSON payload back out of Redis.
- Decodes the JSON.
- Prints the item's title and publication date.
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.