0.01
No release in over 3 years
Low commit activity in last 3 years
A RubyGem for ActivityStreams Publishers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.2.0
>= 0.8
>= 2

Runtime

>= 0
>= 1.4.3
 Project Readme

ActivityStreams¶ ↑

A RubyGem for ActivityStreams Publishers

Installation¶ ↑

gem install activitystreams

Resources¶ ↑

ActivityStreams Official Site (activitystrea.ms/) JSON Activity Streams 1.0 (activitystrea.ms/specs/json/1.0/)

Examples¶ ↑

Single Activity¶ ↑

You can see more examples in spec/serializations/*

actor = ActivityStreams::Object::Person.new(
  :id => 'example.com/nov',
  :display_name => 'Nov Matake'
)
place = ActivityStreams::Object::Place.new(
  :display_name => 'Starbacks Coffee Shibuya',
  :position => ActivityStreams::Object::Place::GeoLocation.new(
    :latitude => 35.0,
    :longitude => 140.0,
    :altitude => 100
  )
)
activity = ActivityStreams::Activity.new(
  :actor  => actor,
  :object => place,
  :verb   => ActivityStreams::Verb::Checkin.new,
  :published => Time.now.utc
)
activity.to_json

Stream (= collection of activities)¶ ↑

actor = ActivityStreams::Object::Person.new(
  :id => 'example.com/nov',
  :display_name => 'Nov Matake'
)
stream = ActivityStreams::Stream.new(
  :items => [
    ActivityStreams::Activity.new(
      :actor => actor,
      :object => ActivityStreams::Object::Bookmark.new(
        :url => 'http://bookmark.example.com/links/12345',
        :target_url => 'http://example.com/articles/12345'
      ),
      :verb => ActivityStreams::Verb::Post.new,
      :published => published
    ),
    ActivityStreams::Activity.new(
      :actor => actor,
      :object => ActivityStreams::Object::Place.new(
        :display_name => 'Starbacks Coffee Shibuya',
        :position => ActivityStreams::Object::Place::GeoLocation.new(
          :latitude => 35.0,
          :longitude => 140.0,
          :altitude => 100
        )
      ),
      :verb => ActivityStreams::Verb::Checkin.new,
      :published => published
    )
  ],
  :url => 'http://example.com/nov/stream',
  :total_count => 10
)
stream.to_json

Note on Patches/Pull Requests¶ ↑

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2011 nov matake. See LICENSE for details.