{"id":15657329,"url":"https://github.com/rossta/seymour","last_synced_at":"2025-05-05T15:44:32.629Z","repository":{"id":1743648,"uuid":"2569433","full_name":"rossta/seymour","owner":"rossta","description":"Activity feed audiences, backed by Redis.","archived":false,"fork":false,"pushed_at":"2014-05-22T18:33:52.000Z","size":356,"stargazers_count":23,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-26T06:18:21.659Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rossta.github.com/seymour","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rossta.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-10-13T13:28:56.000Z","updated_at":"2023-04-20T15:47:45.000Z","dependencies_parsed_at":"2022-09-03T21:30:35.547Z","dependency_job_id":null,"html_url":"https://github.com/rossta/seymour","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossta%2Fseymour","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossta%2Fseymour/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossta%2Fseymour/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossta%2Fseymour/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rossta","download_url":"https://codeload.github.com/rossta/seymour/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252525590,"owners_count":21762329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T13:06:21.348Z","updated_at":"2025-05-05T15:44:32.601Z","avatar_url":"https://github.com/rossta.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Seymour\n\n*Activities for those that care*. Seymour is a library for distributing activity items to Redis-backed activity feeds. Compatible with Rails application and other Ruby web frameworks.\n\n[![Build Status](https://secure.travis-ci.org/rossta/seymour.png)](http://travis-ci.org/rossta/seymour)\n\n\n## Install\n\nIn your Gemfile\n\n    gem \"seymour\"\n\nOr via command line\n\n    gem install seymour\n\n\n## Overview\n\nLet's say you want to display a list of activities, where an activity is something like \"Coach Bob commented 'Great game, yesterday'\". You may be using a gem like [public_activity](https://github.com/pokonski/public_activity) to generate activity items. \n\nDepending on the context, deciding which activities to display can be complicated to determine during the request. The set of people who care about Coach Bob's comment may include his players, the parents of those players and other fans of the team.\n\nSeymour allows the application to distribute activities to \"feeds\" ahead of time, where a feed belongs to an interested party, like an individual profile or a team page.\n\n## Usage\n\nActivities can have any number of audiences. Each audience should be represented as instance method that returns a set of records (things with ids). For example, comment activities in a sports-themed application may look like the following.\n\n``` ruby\nclass CommentActivity\n  include Seymour::HasAudience\n  \n  # context\n  belongs_to :author, class_name: 'User'\n  belongs_to :subject, polymorphic: true\n\n  # declare audiences\n  audience :team      # distributes to TeamFeed by default\n  audience :members,  :feed =\u003e \"DashboardFeed\"\n\n  # define methods for `team` and `members`\n  def team\n    self.subject\n  end\n  \n  def members\n    team.members\n  end \nend\n```\n\nEach audience must be backed by a feed, which is a class that inherits from `Seymour::Feed`. Add these classes to `app/models`, `app/feeds`, or wherever makes sense for your application.\n\n``` ruby\nclass TeamFeed \u003c Seymour::Feed\nend\n\nclass DashboardFeed \u003c Seymour::Feed\nend\n\n```\n\nCall `#distribute` to send the activity to its audience(s). This will add the id of the activity to a Redis list associated with each audience feed.\n\n```ruby\nclass CommentActivity\n  # ...\n  \n  # deliver activity to audiences\n  after_create :distribute\nend\n```\n\n## Background\n\nThis library is based on the feed architecture used to distribute activity items at [Weplay](http://weplay.com). Weplay supports activity distribution to a variety of feeds: user dashboards, game day comment pages, global points leaders, etc. The html for each activity item is pre-rendered in a background job. To build a user's dashboard activities, the activity feed needs only to select the activities at the top of the list and output the pre-rendered html for each item, reducing the extra includes and joins needed in-process.\n\n## TODO\n\n* generator for activity model + migration\n* generator for activity feed\n* support rollup\n* relevance/affinity sorting\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frossta%2Fseymour","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frossta%2Fseymour","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frossta%2Fseymour/lists"}