Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sidraval/pusher-haskell
A Pusher.com server client in Haskell
https://github.com/sidraval/pusher-haskell
Last synced: 4 months ago
JSON representation
A Pusher.com server client in Haskell
- Host: GitHub
- URL: https://github.com/sidraval/pusher-haskell
- Owner: sidraval
- License: mit
- Created: 2015-03-14T19:04:01.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-13T15:18:04.000Z (almost 9 years ago)
- Last Synced: 2024-10-11T23:42:32.355Z (4 months ago)
- Language: Haskell
- Homepage: http://hackage.haskell.org/package/pusher-haskell
- Size: 59.6 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#
A [Pusher](http://www.pusher.com) server client written in Haskell.Currently, the package allows:
* Triggering events on single or multiple channels
* Fetching basic information about single or multiple channelsUp next:
* Fetching a list of channels with active subscriptions
* Fetching a list of users present for a particular channel## Usage
If you go to https://app.pusher.com/apps/YOUR_APP_ID/api_access and run the
following code after filling in your `app-id`, `app-key`, and `app-secret`, you
should see an alert popup on screen.```haskell
> import Network.Pusher> let pusher = Pusher "app-id" "app-key" "app-secret"
> let channel = "test_channel"
> let event = Event "my_event" "{\"message\":\"hello world\"}"> triggerEvent (pusher, channel, event)
"{}"> getChannelInfo (pusher, channel, [])
Right (ChannelInfo {occupied = True, userCount = Nothing, subscriptionCount = Nothing})
```You can also trigger events across multiple channels:
```haskell
> ...
> let channels = ["first_channel", "second_channel"]
> ...> triggerMultiChannelEvent (pusher, channels, event)
"{}"
```And fetch information about all channels:
```haskell
> ...> getMultiChannelInfo (pusher, [], Nothing)
Right (ChannelList [Channel {name = "test_channel", cUserCount = Nothing}])
```## Documentation
Documentation for the individual modules is available on
[hackage][hackage-pusher-haskell].License
-------pusher-haskell is Copyright (c) 2015 Sid Raval. It is free software, and may be
redistributed under the terms specified in the [LICENSE] file.[LICENSE]: /LICENSE
[hackage-pusher-haskell]: http://hackage.haskell.org/package/pusher-haskell