Skip to content

Instantly share code, notes, and snippets.

@Hkazanci93
Created October 19, 2021 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hkazanci93/7a548bbf325e2e0158c1c0cd6f21ee71 to your computer and use it in GitHub Desktop.
Save Hkazanci93/7a548bbf325e2e0158c1c0cd6f21ee71 to your computer and use it in GitHub Desktop.
To track which awesome lists appear on a repository list, you can simply use a set. The Redis SADD command is used to add members to a set stored at the key. SADD commands return the number of elements that were added to the set. This does not include all of the elements already present in the set.
SADD resource:github:{owner}:{repo_name}:lists {list}
SET resource:github:{owner}:{repo_name}
{
'repo_name': resource['name'],
'lists': # SMEMBERS resource:github:{owner}:{repo_name}:lists
'body': resource['description'],
'stargazers_count': resource['stargazers_count'],
'language': resource['language'],
'svn_url': resource['svn_url']
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment