openmymind

command module
v0.0.0-...-aa867fc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2024 License: Unlicense Imports: 11 Imported by: 0

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

  1. Looks for the required OPENMYMIND_RSS_URL environment variable.
  2. Connects to Redis at localhost:6379.
  3. Fetches the RSS feed from the URL set in OPENMYMIND_RSS_URL.
  4. Decodes the XML in the RSS feed.
  5. Ranges across every item found in the feed:
    1. Converts the entire item to JSON.
    2. Converts the publication date to a UNIX timestamp.
    3. Sets the value of Redis key item:<item guid> to the entire JSON payload.
    4. Adds the above key to a sorted set where the score is the publication date.
  6. Gets the keys of the three most recent items from the sorted set.
  7. For each of these keys:
    1. Gets the JSON payload back out of Redis.
    2. Decodes the JSON.
    3. Prints the item's title and publication date.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL