twitter-client

java client for twitter API

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

com.github.redouane59.twitter
ArtifactId

ArtifactId

twitter-client
Last Version

Last Version

1.5
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

twitter-client
java client for twitter API
Project URL

Project URL

http://github.com/Redouane59/twitter-client
Source Code Management

Source Code Management

http://github.com/Redouane59/twitter-client

Download twitter-client

Dependencies

compile (8)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-databind jar 2.10.0.pr1
com.fasterxml.jackson.dataformat : jackson-dataformat-yaml jar 2.9.9
org.jacoco : jacoco-maven-plugin jar 0.8.5
com.squareup.okhttp3 : okhttp jar 3.14.2
io.vavr : vavr jar 0.10.2
org.codehaus.sonar : sonar-maven-plugin jar 5.1
com.google.api-client : google-api-client jar 1.23.0
ch.qos.logback : logback-classic jar 1.2.3

provided (1)

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

test (1)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-params jar 5.4.2

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

In your pom.xml, add the following dependency :

<dependency>
  <groupId>com.github.redouane59.twitter</groupId>
  <artifactId>twittered</artifactId>
  <version>1.11</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.

/!\ JDK 12 is needed to run the project /!\

External Resources

Twitter Developers docs

Special thanks

@hypr2771 @mmornati @andypiper @igorbrigadir @sparack

com.github.redouane59.twitter

simpligility

Versions

Version
1.5
1.4
1.3
1.2
1.1
1.0