Giter Club home page Giter Club logo

tinder4j's Introduction

Java CI Documentation license-shield

logo

Tinder4j

comprehensive and feature rich wrapper of the Tinder API


Note: This is an unofficial project, and I have nothing to do with Tinder nor their API. I take no responsibility for any potential damage, banned accounts or other troubles related to this project!


Features

  • asynchronous and intuitive interface
  • completely wrapped Tinder models
  • rate limiting
  • caching

Example

TinderClient client = new TinderClient("X-Auth-Token");
client.getRecommendations().queue(recommendations -> recommendations.forEach(recommendation -> {
    recommendation.like().queue();
    System.out.println("Liked user " + recommendation.getName());
});

Authentication

Tinder uses Basic Authentication with UUID strings. To get your token, first login to Tinder in your browser. Then, open the network tab and filter for api.gotinder.com. Choose any GET or POST request and go to the Request Headers. There, you'll find the X-Auth-Token header containing the auth token. Please note: you might need to perform some actions first (for example liking a user) before you see any requests.

Rate Limiting

The Tinder API has no official rate limiting, but API spamming results in extra verification needed, shadow-bans or complete account suspension. Thus, the default Ratelimiter of the library is pretty restrictive. However, you can implement your own Ratelimiter:

public class CustomRatelimiter implements Ratelimiter {
    @Override
    public boolean shouldDelay(Request<?> request) {
        return true; // your delay calculation 
    }

    @Override
    public long getDelay(Request<?> request) {
        return 1000L; // your delay
    }
}

Then pass it to the TinderClient instance:

client.setRatelimiter(new CustomRatelimiter());

Lifetime

The client will terminate as soon as all pending API requests where sent. If you want to use this library for bots or similar you have to keep the JVM or respectively the client alive by yourself. This also results in callback threads being killed before their execution is finished. Call TinderClient#awaitShutdown to prevent this behaviour.

Download

Maven

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>
<dependency>
    <groupId>com.github.rednit-team</groupId>
    <artifactId>tinder4j</artifactId>
    <version>VERSION</version>
</dependency>

Gradle

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
    implementation 'com.github.rednit-team:tinder4j:VERSION'
}

tinder4j's People

Contributors

kaktushose avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tinder4j's Issues

Improve caching

  • cache matches and messages id based
  • add matches and messages after fetching a single one with getX(id)
  • cache the user profile after the login request

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.