twittered

java client for twitter API

License

License

GroupId

GroupId

com.github.redouane59.twitter
ArtifactId

ArtifactId

twittered-jdk8
Last Version

Last Version

1.17
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

twittered
java client for twitter API
Project URL

Project URL

http://github.com/Redouane59/twittered
Source Code Management

Source Code Management

http://github.com/Redouane59/twittered

Download twittered-jdk8

Dependencies

compile (7)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-databind jar 2.11.2
com.fasterxml.jackson.dataformat : jackson-dataformat-yaml jar 2.11.2
com.squareup.okhttp3 : okhttp jar 4.8.1
io.vavr : vavr jar 0.10.3
org.slf4j : slf4j-api jar 1.7.30
org.apache.httpcomponents : httpclient jar 4.3.6
se.akerfeldt : okhttp-signpost jar 1.1.0

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.18.12

test (3)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.6.2
org.junit.jupiter : junit-jupiter-params jar 5.6.2
ch.qos.logback : logback-classic jar 1.2.3

Project Modules

There are no modules declared in this project.

This project is a JAVA library which allows you to consume the Twitter API.

v2

Standard

Premium

/!\ Development in progress... Any feedback is welcome :) /!\

Configuration

Maven Central

In your pom.xml, add the following dependency and replace VERSION with the version you wish:

<dependency>
  <groupId>com.github.redouane59.twitter</groupId>
  <artifactId>twittered</artifactId>
  <version>VERSION</version>
</dependency>

In order to use your own developer credentials, you have several options :

Using a json file

File example :

{
  "apiKey": "xxx",
  "apiSecretKey": "xxx",
  "accessToken": "xxx",
  "accessTokenSecret": "xxx"
}
With program argument

Pass through java argument your file path like -Dtwitter.credentials.file.path=/your/path/to/json . Then instantiate the client like

TwitterClient client = new TwitterClient();

or

Using deserialization in your code
TwitterClient twitterClient = new TwitterClient(TwitterClient.OBJECT_MAPPER
                                                    .readValue(new File("/your/path/to/json"), TwitterCredentials.class));

With hard-coded values

TwitterClient twitterClient = new TwitterClient(TwitterCredentials.builder()
                                                            .accessToken("<access_token>")
                                                            .accessTokenSecret("<secret_token>")
                                                            .apiKey("<api_key>")
                                                            .apiSecretKey("<secret_key>")
                                                            .build());

NB : Your twitter credentials can be found in your twitter app page in the Key and tokens page.

Available methods

See :

Code samples

See :

Contribution

If you want to contribute to the project, don't hesitate to submit pull requests. To add a new feature :

  • Create the interface method in the related interface (e.g ITwitterClientV2.java)
  • If needed, add the endpoint URL in URLHelper.java
  • Implement your method in the child class (e.g TwitterClient.java)
  • Don't forget to add your unit tests in src/test/java/com/github/redouane59/twitter/unit

Code style is also available in .idea/codeStyles/GoogleStyle.xml file.

External Resources

Twitter Developers docs

Special thanks

@hypr2771 @mmornati @andypiper @igorbrigadir @sparack

Versions

Version
1.17
1.15