Rx-Tweet-Stream

A RxJava Observable wrapper around Twitter Streaming API

Лицензия

Лицензия

MIT
Категории

Категории

React Взаимодействие с пользователем Веб-фреймворки
Группа

Группа

com.shekhargulati.reactivex
Идентификатор

Идентификатор

rx-tweet-stream
Последняя версия

Последняя версия

0.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Rx-Tweet-Stream
A RxJava Observable wrapper around Twitter Streaming API
Ссылка на сайт

Ссылка на сайт

https://github.com/shekhargulati/rx-tweet-stream
Система контроля версий

Система контроля версий

https://github.com/shekhargulati/rx-tweet-stream.git

Скачать rx-tweet-stream

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.shekhargulati.reactivex/rx-tweet-stream/ -->
<dependency>
    <groupId>com.shekhargulati.reactivex</groupId>
    <artifactId>rx-tweet-stream</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.shekhargulati.reactivex/rx-tweet-stream/
implementation 'com.shekhargulati.reactivex:rx-tweet-stream:0.1.0'
// https://jarcasting.com/artifacts/com.shekhargulati.reactivex/rx-tweet-stream/
implementation ("com.shekhargulati.reactivex:rx-tweet-stream:0.1.0")
'com.shekhargulati.reactivex:rx-tweet-stream:jar:0.1.0'
<dependency org="com.shekhargulati.reactivex" name="rx-tweet-stream" rev="0.1.0">
  <artifact name="rx-tweet-stream" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.shekhargulati.reactivex', module='rx-tweet-stream', version='0.1.0')
)
libraryDependencies += "com.shekhargulati.reactivex" % "rx-tweet-stream" % "0.1.0"
[com.shekhargulati.reactivex/rx-tweet-stream "0.1.0"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.twitter4j : twitter4j-stream jar 4.0.4
org.slf4j : slf4j-api jar 1.7.18
io.reactivex : rxjava jar 1.1.1

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.11
org.slf4j : slf4j-simple jar 1.7.18

Модули Проекта

Данный проект не имеет модулей.

rx-twitter-stream Build Status License

RxJava observable for tweet stream. It is a wrapper around Twitter4J Streaming Library. rx-twitter-stream API uses JDK 8.

Getting Started

To use rx-tweet-stream in your application, you have to add rx-tweet-stream in your classpath. rx-tweet-stream is available on Maven Central so you just need to add dependency to your favorite build tool as show below.

For Apache Maven users, please add following to your pom.xml.

<dependencies>
    <dependency>
        <groupId>com.shekhargulati.reactivex</groupId>
        <artifactId>rx-tweet-stream</artifactId>
        <version>0.1.0</version>
        <type>jar</type>
    </dependency>
</dependencies>

Gradle users can add following to their build.gradle file.

compile(group: 'com.shekhargulati.reactivex', name: 'rx-tweet-stream', version: '0.1.0', ext: 'jar')

Usage

The example shown below uses the Twitter4j environment variables

export twitter4j.debug=true
export twitter4j.oauth.consumerKey=*********************
export twitter4j.oauth.consumerSecret=******************************************
export twitter4j.oauth.accessToken=**************************************************
export twitter4j.oauth.accessTokenSecret=******************************************
import com.shekhargulati.reactivex.twitter.TweetStream;

TweetStream.of("java").map(Status::getText).take(10).subscribe(System.out::println);

If you don't want to use environment variables, then you can use the overloaded method that allows you to pass configuration object.

ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true)
        .setOAuthConsumerKey("*********************")
        .setOAuthConsumerSecret("******************************************")
        .setOAuthAccessToken("**************************************************")
        .setOAuthAccessTokenSecret("******************************************");

TweetStream.of(cb.build(), "java").map(Status::getText).take(10).subscribe(System.out::println);

The other of factory methods present in TweetStream are:

Observable<Status> of(final long... usersToFollow)
Observable<Status> of(final String[] languages, final String[] searchTerms)
Observable<Status> of(final Configuration configuration, final String[] languages, final String[] searchTerms)
Observable<Status> of(final Configuration configuration, final String... searchTerms)
Observable<Status> of(final Configuration configuration, final long... usersToFollow)
Observable<Status> of(final Configuration configuration, final String[] languages, final String[] searchTerms, final long[] usersToFollow)

License

rx-tweet-stream is licensed under the MIT License - see the LICENSE file for details.

Credits

TweetSubscriber is inspired by the TwitterObservable of yarn starter.

Версии библиотеки

Версия
0.1.0