Coder Social home page Coder Social logo

abhaybd / twitter4j-webhook Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 11 KB

Addon for use with Twitter4J to allow for managing webhooks

License: MIT License

Java 100.00%
twitter twitter-api twitter-bot webhook twitter4j webhooks account-activity-api

twitter4j-webhook's Introduction

Twitter4J-Webhook

Manage the Twitter account activity API. This adds some classes that can be used with Twitter4J to manage webhooks, as well as subscriptions to those webhooks.

Installation

Install with maven

<dependency>
  <groupId>com.abhaybd</groupId>
  <artifactId>twitter4j-webhook</artifactId>
  <version>0.0.1</version>
</dependency>

Usage

Create a webhook manager

Twitter twitter = TwitterFactory.getSingleton();
WebhookManager manager = new WebhookManager(twitter.getConfiguration(), "ENV_NAME");

Register a webhook at the given URI

manager.addWebhook(URI.create("https://example.webhook.com/webhook"));

Unregister the currently registered webhook

manager.removeWebhook();

Get the information for the currently registered webhook

WebhookInfo info = manager.getWebhookInfo();
System.out.println(info.getID());
System.out.println(info.isValid());

Trigger a CRC check for the currently registered webhook

manager.triggerCRC();

Register the currently authenticated user to this webhook

manager.registerCurrentUser();

Unregister all users from this webhook

manager.unregisterAllUsers();

Unregister a specific user from this webhook

long userId = 1024L;
manager.unregisterUser(userId);

twitter4j-webhook's People

Contributors

abhaybd avatar

Stargazers

 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.