Giter Site home page Giter Site logo

nunohorta / mod_interact Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sanderhahn/mod_interact

0.0 2.0 0.0 91 KB

An ejabberd module to send a post request to an arbitrary url when an ejabberd user is offline and receives a message.

Shell 0.35% Erlang 99.65%

mod_interact's Introduction

Purpose:

Forward several types of messages as post requests to an arbitrary url.

mod_offline_post forwards messages that are sent to offline users through a post request to a configurable url mod_available_post sends a post request with information about a user that has become available mod_unavailable_post sends a post request with information about a user that has gone offline

Installing:

  • Run the build.sh script to build *.beam files
  • Copy the *.beam files from the ebin directory to the location where the other modules are for your server
  • Add the configuration shown below to your ejabberd.cfg file, providing the correct values for auth_token, and post_url

Example Configuration:

 {mod_offline_post, [
    {auth_token, "your-secret-token-here"},
    {post_url, "http://localhost:3000/your/custom/url"}
 ]}
 {mod_available_post, [
    {auth_token, "your-secret-token-here"},
    {post_url, "http://localhost:3000/your/custom/url"}
 ]}
 {mod_unavailable_post, [
    {auth_token, "your-secret-token-here"},
    {post_url, "http://localhost:3000/your/custom/url"}
 ]}

Results:

The application running at the post_url will receive a post http request with the following form parameters.

mod_offline_post
"to"=>"adam2@localhost"
"from"=>"adam1"
"body"=>"Does it still work?"
"access_token"=>"your-secret-token-here"

mod_available_post
"jabber_id"=>"adam2"
"access_token"=>"your-secret-token-here"

mod_unavailable_post
"jabber_id"=>"adam2"
"access_token"=>"your-secret-token-here"

License

The modules herein are almost entirely based on mod_offline_prowl written by Robert George [email protected] They retain the original author's license.

The original post about mod_offline_prowl can be found here

mod_interact's People

Contributors

adamvduke avatar sanderhahn avatar

Watchers

Neustradamus avatar Nuno Horta 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.