twitter


License

License

GroupId

GroupId

com.alexdupre
ArtifactId

ArtifactId

twitter_2.13
Last Version

Last Version

0.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

twitter
twitter
Project URL

Project URL

https://github.com/alexdupre/twitter-scala
Project Organization

Project Organization

com.alexdupre
Source Code Management

Source Code Management

https://github.com/alexdupre/twitter-scala

Download twitter_2.13

How to add to project

<!-- https://jarcasting.com/artifacts/com.alexdupre/twitter_2.13/ -->
<dependency>
    <groupId>com.alexdupre</groupId>
    <artifactId>twitter_2.13</artifactId>
    <version>0.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.alexdupre/twitter_2.13/
implementation 'com.alexdupre:twitter_2.13:0.1.1'
// https://jarcasting.com/artifacts/com.alexdupre/twitter_2.13/
implementation ("com.alexdupre:twitter_2.13:0.1.1")
'com.alexdupre:twitter_2.13:jar:0.1.1'
<dependency org="com.alexdupre" name="twitter_2.13" rev="0.1.1">
  <artifact name="twitter_2.13" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.alexdupre', module='twitter_2.13', version='0.1.1')
)
libraryDependencies += "com.alexdupre" % "twitter_2.13" % "0.1.1"
[com.alexdupre/twitter_2.13 "0.1.1"]

Dependencies

compile (7)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.13.5
com.softwaremill.sttp.client3 : core_2.13 jar 3.1.9
com.softwaremill.sttp.client3 : slf4j-backend_2.13 jar 3.1.9
com.softwaremill.sttp.client3 : play-json_2.13 jar 3.1.9
com.typesafe.play : play-json_2.13 jar 2.9.2
commons-codec : commons-codec jar 1.15
org.slf4j : slf4j-api jar 1.7.30

test (4)

Group / Artifact Type Version
com.typesafe : config jar 1.4.1
com.softwaremill.sttp.client3 : akka-http-backend_2.13 jar 3.1.9
com.typesafe.akka : akka-stream_2.13 jar 2.6.13
ch.qos.logback : logback-classic jar 1.2.3

Project Modules

There are no modules declared in this project.

twitter-scala

Build Status

A Scala library for the Twitter API: https://developer.twitter.com/en/docs/twitter-api

The library is in Early Access, as the Twitter API v2 that it supports, expect changes in the API/ABI.

The REST API can be used in both synchronous (blocking) and asynchronous (non-blocking) modes, thanks to the sttp backend's selection that is up to the library's user.

The library uses the new API v2 endpoints where possible, with fallback to v1 endpoints where required.

Only a small subset of the Twitter functionalities have been implemented:

  • REST API:

    • Get recent tweets
    • Login with Twitter flow
    • Get user by id/username
    • Send simple Direct Messages
    • Get/add/remove stream rules
  • Streaming API

    • Stream tweets in real-time

Artifacts

The latest release of the library is compiled with Scala 2.13 only and supports all sttp backends.

Version Artifact Id HTTP Provider Json Provider Scala
0.1.1 twitter sttp3 Play-Json 2.13

If you're using SBT, add the following line to your build file:

libraryDependencies += "com.alexdupre" %% "twitter" % "<version>"

Examples

You can find many examples on how to use this library in the src/test/scala directory, and you can directly run them, after entering your credentials in the application.conf file.

Two notable examples are:

  • GetAllRecentTweets, that shows how to handle paginated endpoints with a fold-like function
  • StreamTweets, that shows how to stream tweets with the akka-backend

Versions

Version
0.1.1
0.1