sharetary0.5.0 • Public • Published
Sharetary is a cross-origin events viewer. The name is neoterized from two terms "share" and "secretary".
This provides ability to watch various "events" stored into a Groonga server, in real time or analytically by two different views:
- Timeline view - You can watch events in real time, like Twitter or something. Newly added events will appear on the top of the view automatically.
- Archive view - You can watch events statically, with their relations. Related events are visible as a thread.
How to start the server?
$ sudo npm install -g sharetary $ sharetary-server
You must install Node.js and npm before installation. For example, on Ubuntu 14.04LTS:
$ sudo apt-get install nodejs nodejs-legacy npm
sharetary-server --help for more details.
How to crawl events?
Sharetary doesn't provide ability to crawl events from sources. You need to crawl and load events by something other way.
In other words, you can use any data source for Sharetary, if you load them to the database in a common format described at this section.
_key(any type): Something to identify each event uniquely. For example, URI string, hash string, or others.
ShortText): Indicates the type of each event. For example, an event indicating a "push" activity on the GitHub will have the string
ShortText): Indicates the magnitude of each event. Three possible values:
majorevents will be highlighted in the view.
Tags): Indicates tags associated to events. For example, events from GitHub activities will belong to any repository, so their repository name is suitable as a tag.
ShortText): Short description of each event. For example, an event indicating a "push" activity on the GitHub will have its
titlelike: "Pushed N commits to the repository".
ShortText): The main description of each event. For example, an event indicating a "commit" activity on the GitHub will have its commit message as its
ShortText): The extra description of each event. It won't be rendered in the view, but will be shown in the tooltip of events. For example, an event indicating a "commit" activity on the GitHub will have its "diff" as its
ShortText): The related URI of each event.
ShortText): URI of the icon for the source of the event. For example, events from Github activities will have favicon's URI as its
ShortText): The URI of an UI to post any reply for each event. For example, an event indicating a "commit" activity on the GitHub will have link to the comment form of the commit as its
reply_uri. If your crawler fetches posted comments from the UI also, then you'll see them as events related to the parent event.
Actors): Indicates the actor's name of each event. For example, an events from GitHub activity will have the account id as its
timestamp(`Time'): The time when the event was triggered at. Events are sorted by this field in the archive view.
created_at(`Time'): The time when the record of the event was loaded to the database. Events are sorted by this field in the timeline view.
_keyof another event. For example, an event indicating a "issue comment" activity on the GitHub will have the
_keyof the "issue opened" event as its
ShortText): URI of the icon for the tag.
ShortText): The related URI of the actor.
ShortText): URI of the icon for the actor.
ShortText): Indicates the magnitude of the actor. Two possible values:
minor. Events triggered by
minoractors will be shown with small text and lighter color in the view. For example, if you have events triggered by both students and teachers and you hope to see students' events mainly, then students are
majorand teachers are
See the example schema also.
Any other column can be defined at each table table, as you like. Moreover, of course, any other table is also allowed in the database. Sharetary simply ignores them.
Typical use case: watching users' activities on the GitHub
This section describes how to crawl GitHub activities by fluentd, on a Ubuntu 14.04 server.
Install Groonga with the instruction. (If you have your existing Groonga or Droonga, you can skip this step.)
Install fluentd and td-agent.
$ sudo apt-get install ntp $ sudo service ntp restart $ curl -L http://toolbelt.treasuredata.com/sh/install-ubuntu-trusty-td-agent2.sh | sudo sh $ sudo mkdir -p /var/spool/td-agent/buffer/ $ sudo chown -R td-agent:td-agent /var/spool/td-agent/
Install required fluentd plugins.
$ sudo td-agent-gem install fluent-plugin-github-activities $ sudo td-agent-gem install fluent-plugin-map $ sudo td-agent-gem install fluent-plugin-record-reformer
Install fluent-plugin-groonga. It requires some extra packages.
$ sudo apt-get install ruby ruby-dev build-essential $ sudo td-agent-gem install fluent-plugin-groonga
$ sudo vi /etc/td-agent/td-agent.conf
See also the example configuration to crawl and load GitHub activities. It includes rules to convert fetched GitHub activities to Sharetary events.
$ sudo service td-agent start
How to customize exporting columns in CSV?
By default the link "CSV" in "Export" menu exports only some major columns. If you need, you can customize columns of exported records. Steps to change exporting columns are:
- Copy the link location of the menu item.
- Paste it to the location bar of your browser.
- Add new query parameter
columnsand load it.
- Any columns of the
Eventstable can be specified, like:
- Multiple columns can be available as comma-separated list like:
- Special column name
all) is available to export all columns of the
- Any columns of the