Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scrogson/romeo
An XMPP Client for Elixir
https://github.com/scrogson/romeo
client elixir xmpp
Last synced: 2 days ago
JSON representation
An XMPP Client for Elixir
- Host: GitHub
- URL: https://github.com/scrogson/romeo
- Owner: scrogson
- License: mit
- Created: 2015-11-15T20:42:26.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-19T07:02:16.000Z (about 5 years ago)
- Last Synced: 2024-12-15T00:53:52.925Z (12 days ago)
- Topics: client, elixir, xmpp
- Language: Elixir
- Homepage:
- Size: 150 KB
- Stars: 81
- Watchers: 9
- Forks: 61
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Romeo
> XMPP Client
[![Build Status](https://travis-ci.org/scrogson/romeo.svg?branch=master)](https://travis-ci.org/scrogson/romeo)
[![Coverage Status](https://coveralls.io/repos/scrogson/romeo/badge.svg?branch=master&service=github)](https://coveralls.io/github/scrogson/romeo?branch=master)## Installation
1. Add romeo to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:romeo, "~> 0.7"}]
end
```2. Ensure romeo is started before your application:
```elixir
def application do
[applications: [:romeo]]
end
```## Usage
```elixir
alias Romeo.Stanza
alias Romeo.Connection, as: Conn
alias Romeo.Roster# Minimum configuration options
opts = [jid: "[email protected]", password: "iL0v3JuL137"]# Start the client
{:ok, pid} = Conn.start_link(opts)# Send presence to the server
:ok = Conn.send(pid, Stanza.presence)# Request your roster
:ok = Conn.send(pid, Stanza.get_roster)# Join a chat room
:ok = Conn.send(pid, Stanza.join("[email protected]", "romeo"))# Send a message to the room
msg = "See how she leans her cheek upon her hand! " <>
"O that I were a glove upon that hand, that " <>
"I might touch that cheek!"
:ok = Conn.send(pid, Stanza.groupchat("[email protected]", msg))# Get roster items as tuple of %Romeo.Roster.Items{} struct
items = Roster.items(pid)# Add jid to roster
:ok = Roster.add(pid, "[email protected]")# Remove jid from roster
:ok = Roster.remove(pid, "[email protected]")
```## Documentation
Documentation is available on [hexdocs](http://hexdocs.pm/romeo/)
## Naming
It follows the great tradition to use characters of William Shakespeare's Romeo
and Juliet in the XMPP specifications.## License
The MIT License (MIT)
Copyright (c) 2015 Sonny Scroggin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.------------
![Romeo and Juliet](https://upload.wikimedia.org/wikipedia/commons/c/cc/Picou%2C_Henri_Pierre_-_Romeo_and_Juliet.jpg
"Henri-Pierre Picou [Public domain], via Wikimedia Commons")
**Image credit:** Henri-Pierre Picou [Public domain], via Wikimedia Commons