
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
io.github.redouane59.twitter:twittered
Advanced tools
This project is a JAVA library which allows you to consume the Twitter API.
In your pom.xml, add the following dependency and replace VERSION
with the version you wish:
<dependency>
<groupId>io.github.redouane59.twitter</groupId>
<artifactId>twittered</artifactId>
<version>VERSION</version>
</dependency>
If you are using Gradle Kotlin DSL, make sure you have MavenCentral among the available repositories:
repositories {
mavenCentral()
// [...]
}
Then add the following line to your dependencies
block:
implementation("io.github.redouane59.twitter:twittered:VERSION")
To be able to see library logs, also add sl4j references :
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.30</version>
</dependency>
In order to use your own developer credentials, you have several options :
File example :
{
"apiKey": "xxx",
"apiSecretKey": "xxx",
"accessToken": "xxx",
"accessTokenSecret": "xxx"
}
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
TwitterClient twitterClient = new TwitterClient(TwitterClient.OBJECT_MAPPER
.readValue(new File("/your/path/to/json"), TwitterCredentials.class));
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.
See :
See :
TwitterClient twitterClient = new TwitterClient(TwitterClient.OBJECT_MAPPER
.readValue(new File("/your/path/to/json"), TwitterCredentials.class));
Tweet tweet = twitterClient.getTweet("1224041905333379073");
System.out.println(tweet.getText());
System.out.println(tweet.getCreatedAt());
System.out.println(tweet.getLang());
System.out.println(tweet.getLikeCount());
System.out.println(tweet.getRetweetCount());
System.out.println(tweet.getReplyCount());
System.out.println(tweet.getUser().getName());
User user = twitterClient.getUserFromUserName("RedouaneBali");
System.out.println(user.getName());
System.out.println(user.getDisplayedName());
System.out.println(user.getDateOfCreation());
System.out.println(user.getDescription());
System.out.println(user.getTweetCount());
System.out.println(user.getFollowersCount());
System.out.println(user.getFollowingCount());
System.out.println(user.getPinnedTweet());
System.out.println(user.getPinnedTweet());
System.out.println(user.getLocation());
System.out.println(user.getId());
System.out.println(user.getUrl());
If you want to contribute to the project, don't hesitate to submit pull requests. To add a new feature :
src/test/java/io/github/redouane59/twitter/unit
Code style is also available in .idea/codeStyles/GoogleStyle.xml
file.
I would like to give special thanks to @hypr2771 @mmornati @andypiper @igorbrigadir @sparack for having helped me building this Twitter API library for Java. The tool is now working and I hope that students, junior and senior developers will enjoy it, being able to play easily with twitter data using Java programming language.
FAQs
Unknown package
We found that io.github.redouane59.twitter:twittered demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.