Giter Club home page Giter Club logo

matchmaker's Introduction

MatchMaker

MatchMaker is a lightweight, easy-to-use Go library for interacting with Tinder's API.

Features

  • Simple, idiomatic interface for interacting with Tinder's API. here
  • Full Go module compatibility and support for Semantic Versioning.
  • Helpful debug logging to assist with troubleshooting.

Installation

Use the package manager to install matchmaker.

go get github.com/0xzer/matchmaker

Usage

For more usage examples you can check here, it should contain everything.

package main

import (
	"github.com/0xzer/matchmaker"
	"github.com/0xzer/matchmaker/debug"
)

var client *matchmaker.Client
func main() {
    // nil for new device
    // alternatively pass an empty instance of zerolog.Logger{} to disable logging
    client = matchmaker.NewClient(nil, debug.NewLogger(), nil)
    client.SetEventHandler(evHandler)

    smsSent, err := client.Authenticator.SendSMS("someNumber...")
    if err != nil {
       client.Logger.Fatal().Err(err).Msg("Failed to send sms")
    }
    client.Logger.Info().Any("data", smsSent).Msg("Sent sms")
    // there is a possibility for this to not return the loginresult, that is if the device is not recognized and needs email validation aswell.
    verifiedOTP, err2 := client.Authenticator.VerifyOTP("OTP...")
    if err2 != nil {
	client.Logger.Fatal().Err(err2).Msg("Failed to verify OTP")
    }
    client.Logger.Info().Any("data", verifiedOTP).Msg("Verified OTP")

    socketErr := client.Connect()
    if socketErr != nil {
	client.Logger.Fatal().Err(socketErr).Msg("Failed to connect to socket")
    }
}

func evHandler(rawEvt interface{}) {
	switch evt := rawEvt.(type) {
        case matchmaker.Event_NewMessage:
            msg := evt.Message
            client.Logger.Info().
            Any("from", msg.From).
            Any("from_me", evt.IsMe()).
            Any("content", msg.Message).
            Any("message_id", msg.ID).
            Any("type", msg.Type).
            Msg("New Message!")
	case matchmaker.Event_ClientReady:
	    client.Logger.Info().Any("data",evt).Msg("Client is ready and connected!")
    }
}

Documentation

See the GoDoc page for this.

matchmaker's People

Contributors

0xzer avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.