Code Monkey home page Code Monkey logo

somen's Introduction

Somen

Somen provides a way to receive data from streaming API of Twitter with RxSwift observable.

NOTICE: This library is still version 0 and under development. I do not recommend to use this library in production environment until version 1 release.

Example

  1. Initialize Somen instance with your authorization tokens.
var somen = Somen.init(consumerKey: "YOUR_CONSUMER_KEY",
                         consumerSecret: "YOUR_CONSUMER_SECRET",
                         accessToken: "YOUR_ACCESS_TOKEN",
                         accessTokenSecret: "YOUR_ACCESS_TOKEN_SECRET")
  1. Subscribe UserStream API
somen.home().subscribe(onNext: { (event) in
  switch event {
  case .newStatus(rawEvent: let e):
    // process new status event
    break
  case .favorite(rawEvent: let e):
    // process favorite event
    break
  default:
    break
  }
})

Supported streams and events

Curently Somen supports User streams. And following types of events are supported.

  • newStatus
  • deleteStatus
  • deleteLocation
  • limitNotice
  • statusWithheld
  • userWithheld
  • stallWarning
  • userUpdate
  • friends
  • directMessage
  • block
  • unblock
  • favorite
  • unfavorite
  • follow
  • unfollow
  • listCreated
  • listDestroyed
  • listUpdated
  • listMemberAdded
  • listMemberRemoved
  • listUserSubscribed
  • listUserUnsubscribed
  • quotedTweet

If unsupported event was received, the event is processed as unsupportedEvent and it has raw event dictionary as the associated value.

Installation

Using Carthage:

Write as follows in Cartfile

github "hiragram/Somen"

then

$ carthage update

somen's People

Contributors

hiragram avatar

Watchers

James Cloos avatar Dueno avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.