Skip to content

Commit

Permalink
Tidied up readme documentation references and added Stream to copyrig…
Browse files Browse the repository at this point in the history
…ht holders
  • Loading branch information
dwightgunning committed Apr 26, 2017
1 parent dfe3baa commit 345da21
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 98 deletions.
48 changes: 27 additions & 21 deletions LICENSE
@@ -1,21 +1,27 @@
The MIT License (MIT)

Copyright (c) 2015 Shawn Beach

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Copyright (c) 2015-2017 Shawn Beach, Stream.io Inc, and individual contributors.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific prior
written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
164 changes: 87 additions & 77 deletions README.md
@@ -1,77 +1,87 @@
stream-net
===========

[![Build status](https://ci.appveyor.com/api/projects/status/9eh9kvhai6aj7p1q?svg=true)](https://ci.appveyor.com/project/shawnspeak/stream-net)
[![Coverage Status](https://coveralls.io/repos/shawnspeak/stream-net/badge.svg)](https://coveralls.io/github/shawnspeak/stream-net)

### Installation via Nuget

```sh
PM> Install-Package stream-net
```

### Usage

```c#
// Create a client, find your API keys here https://getstream.io/dashboard/
var client = new StreamClient("YOUR_API_KEY","API_KEY_SECRET");

// Reference a feed
var userFeed1 = client.Feed("user", "1");

// Get 20 activities starting from activity with id last_id (fast id offset pagination)
var results = await userFeed1.GetActivities(0, 20, FeedFilter.Where().IdLessThan(last_id));

// Get 10 activities starting from the 5th (slow offset pagination)
var results = await userFeed1.GetActivities(5, 10);

// Create a new activity
var activity = new Activity("1", "like", "3")
{
ForeignId = "post:42"
};
userFeed1.AddActivity(activity);

// Create a complex activity
var activity = new Activity("1", "run", "1")
{
ForeignId = "run:1"
};
var course = new Dictionary<string,objects>();
course["name"] = "Shevlin Park";
course["distance"] = 10;
activity.SetData("course", course);
userFeed1.AddActivity(activity);

// Remove an activity by its id
userFeed1.RemoveActivity("e561de8f-00f1-11e4-b400-0cc47a024be0");

// Remove activities by their foreign_id
userFeed1.RemoveActivity("post:42", true);

// Let user 1 start following user 42's flat feed
userFeed1.FollowFeed("flat", "42");

// Let user 1 stop following user 42's flat feed
userFeed1.UnfollowFeed("flat", "42");

// Delete a feed (and its content)
userFeed1.Delete();

// Retrieve first 10 followers of a feed
userFeed1.Followers(0, 10);

// Retrieve 2 to 10 followers
userFeed1.Followers(2, 10);

// Retrieve 10 feeds followed by $user_feed_1
userFeed1.Following(0, 10);

// Retrieve 10 feeds followed by $user_feed_1 starting from the 10th (2nd page)
userFeed1.Following(10, 20);

// Check if $user_feed_1 follows specific feeds
userFeed1.Following(0, 2, new String[] { "user:42", "user:43" });


```
stream-net
===========

[![Build status](https://ci.appveyor.com/api/projects/status/9eh9kvhai6aj7p1q?svg=true)](https://ci.appveyor.com/project/shawnspeak/stream-net)
[![Coverage Status](https://coveralls.io/repos/shawnspeak/stream-net/badge.svg)](https://coveralls.io/github/shawnspeak/stream-net)

[stream-net](https://github.com/GetStream/stream-net) is a .Net client for [Stream](https://getstream.io/).

You can sign up for a Stream account at https://getstream.io/get_started.

### Installation via Nuget

```sh
PM> Install-Package stream-net
```

### Usage

```c#
// Create a client, find your API keys here https://getstream.io/dashboard/
var client = new StreamClient("YOUR_API_KEY","API_KEY_SECRET");

// Reference a feed
var userFeed1 = client.Feed("user", "1");

// Get 20 activities starting from activity with id last_id (fast id offset pagination)
var results = await userFeed1.GetActivities(0, 20, FeedFilter.Where().IdLessThan(last_id));

// Get 10 activities starting from the 5th (slow offset pagination)
var results = await userFeed1.GetActivities(5, 10);

// Create a new activity
var activity = new Activity("1", "like", "3")
{
ForeignId = "post:42"
};
userFeed1.AddActivity(activity);

// Create a complex activity
var activity = new Activity("1", "run", "1")
{
ForeignId = "run:1"
};
var course = new Dictionary<string,objects>();
course["name"] = "Shevlin Park";
course["distance"] = 10;
activity.SetData("course", course);
userFeed1.AddActivity(activity);

// Remove an activity by its id
userFeed1.RemoveActivity("e561de8f-00f1-11e4-b400-0cc47a024be0");

// Remove activities by their foreign_id
userFeed1.RemoveActivity("post:42", true);

// Let user 1 start following user 42's flat feed
userFeed1.FollowFeed("flat", "42");

// Let user 1 stop following user 42's flat feed
userFeed1.UnfollowFeed("flat", "42");

// Delete a feed (and its content)
userFeed1.Delete();

// Retrieve first 10 followers of a feed
userFeed1.Followers(0, 10);

// Retrieve 2 to 10 followers
userFeed1.Followers(2, 10);

// Retrieve 10 feeds followed by $user_feed_1
userFeed1.Following(0, 10);

// Retrieve 10 feeds followed by $user_feed_1 starting from the 10th (2nd page)
userFeed1.Following(10, 20);

// Check if $user_feed_1 follows specific feeds
userFeed1.Following(0, 2, new String[] { "user:42", "user:43" });


```

### Copyright and License Information

Copyright (c) 2015-2017 Shawn Beach, Stream.io Inc, and individual contributors. All rights reserved.

See the file "LICENSE" for information on the history of this software, terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.

0 comments on commit 345da21

Please sign in to comment.