• Stars
    star
    119
  • Rank 287,544 (Top 6 %)
  • Language
    Ruby
  • License
    Other
  • Created about 11 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PubNub Ruby-based APIs

PubNub Ruby SDK

Tests Status

This is the official PubNub Ruby SDK repository.

PubNub takes care of the infrastructure and APIs needed for the realtime communication layer of your application. Work on your app's logic and let PubNub handle sending and receiving data across the world in less than 100ms.

Get keys

You will need the publish and subscribe keys to authenticate your app. Get your keys from the Admin Portal.

Configure PubNub

  1. Integrate PubNub into your project using RubyGems:

    gem install pubnub
  2. Create a new App.rb file and add the following code.

    require 'pubnub'
    
    pubnub = Pubnub.new(
        subscribe_key: :mySubscribeKey,
        publish_key: :myPublishKey,
        uuid: :myUniqueUUID
    )

    This is the minimum configuration you need to send and receive messages with PubNub.

Add event listeners

callback = Pubnub::SubscribeCallback.new(
    message: ->(envelope) {
        puts "MESSAGE: #{puts envelope.result[:data][:message]['msg']}"
    },
    presence: ->(envelope) {
        puts "PRESENCE: #{envelope.result[:data]}"
    }
)
pubnub.add_listener(callback: callback)

Publish and subscribe

pubnub.subscribe(
    channels: ['my_channel'],
    with_presence: true
)

pubnub.publish(
    channel: 'my_channel',
    message: { text: 'Hello world' }
) do |envelope|
    puts envelope.status
end

Documentation

API reference for Ruby

Support

If you need help or have a general question, contact [email protected].

More Repositories

1

eon

An open-source chart and map framework for realtime data.
Shell
879
star
2

pubnub-api

APIs for developers building secure realtime mobile, web, and IoT apps.
JavaScript
817
star
3

java

PubNub Java-based APIs for core Java, Android
Java
624
star
4

javascript

PubNub JavaScript SDK docs https://www.pubnub.com/docs/sdks/javascript
JavaScript
539
star
5

real-time-stocks

This repository includes full app code for streaming stock quote data from PHP to a JavaScript HTML5 app. The PubNub Real-time Network offers a Globally Distributed solution for streaming real-time data to millions of users in less than 0.25 seconds. This provides developers the capability to utilize the Service Mediation aspect of the PubNub network to stream data over TCP socket connections using WebSockets and other protocols. This repository is an HTML5 JavaScript and CSS3 example using live real-time data stream from a server. Where PubNub fits in is in the mediation and brokering of the message stream in real-time to millions of people. The PubNub Real-time Network provides highly reliable services for real-time data streams. The PubNub Real-Time Network Build real-time apps quickly and scale them globally.
HTML
205
star
6

objective-c

PubNub Objective-C based APIs for iOS and OS X
Objective-C
178
star
7

react-chat-components

Chat UI Components to build chat applications with PubNub on React with TypeScript support
TypeScript
156
star
8

python

PubNub Python-based SDK with Asyncio support
Python
154
star
9

paper-chat

A simple chat room in Material Design build with Polymer (Polymer 0.5)
HTML
152
star
10

eon-map

Realtime maps with PubNub and MapBox.
JavaScript
135
star
11

php

PubNub clients for PHP
PHP
124
star
12

eon-chart

Realtime animated graphs with PubNub and C3.
JavaScript
123
star
13

genetic-car-2

Genetic Cars 2 (Globally Distributed)
JavaScript
114
star
14

rltm.js

Easily swap realtime providers with a single code base
JavaScript
108
star
15

go

PubNub clients for Go
Go
104
star
16

arduino

The Official PubNub Arduino-based API!
C++
103
star
17

c-sharp

PubNub clients for C-Sharp based languages, including MS Windows C#/.net, Silveright, IIS, and Mono
C#
101
star
18

chat-engine

Object oriented event emitter based framework for building chat applications in Javascript.
JavaScript
95
star
19

typescript-ref-app-team-chat

Team Chat Reference Application for PubNub Chat With React, Redux and TypeScript
TypeScript
95
star
20

workshop-raspberrypi

IoT Hands On Workshop: Build a Realtime App with Raspberry Pi 2 and PubNub. Demo Web ->
Python
89
star
21

pubnub-angular

Official PubNub AngularJS SDK
JavaScript
84
star
22

angular-js

Example of AngularJS integration with the PubNub AngularJS SDK v1
CSS
78
star
23

webrtc-chat

A simple webrtc chatting application.
JavaScript
69
star
24

pubnub-xkcd

http://twitter.com/stephenlb - PubNub Powered xkcd MMO World Game. Live with WebSockets and rendered with HTML5 Canvas.
JavaScript
56
star
25

react

TypeScript
49
star
26

pi-house

A simplified version of Raspberry Pi House web interface.
CSS
47
star
27

webgl-visualization

A visualization of the PubNub traffic in WebGL.
JavaScript
47
star
28

c

PubNub clients for C, C++, and Raspberry Pi
C
46
star
29

d3-bubble

Showcasing d3 bubble chart using PubNub streaming data
CSS
43
star
30

c-core

PubNub for C and C-like platforms build home
C
43
star
31

open-growth

Open Growth - grow your business 10x by automating tedious workforce tasks with machines - rules-based "customer delighter" with MonkeyLearn ML/AI enriched customer profile building. A framework for Developers capable of delighting your customers with template generated multi-channel messages in realtime.
JavaScript
38
star
32

pubnub-chat-channel-presence

PubNub Chat with Channel Presence is a new and breakthrough technology that has never existed until now empowering you (the developer) to obtain details about a PubNub Channel's Occupants. Receive Server Sent Notifications World-wide from PubNub's 10 Data Centers regarding "Who's There?" - Who is online and who will receive PubNub messages.
JavaScript
37
star
33

pubnUber

PubNub Uber (phonegap)
JavaScript
35
star
34

transportation

PubNub Transportation Solution
CSS
33
star
35

video-sync

PubNub VideoSync SDK for YouTube Video Multi-user Playback
HTML
32
star
36

iot-push-demo

A simulated IoT panel desktop UI for Android (GCM) and iOS (APNS) push notification demo using Cordova
JavaScript
32
star
37

pubnub-angular2

JavaScript
32
star
38

unity

PubNub for Unity3D 5.x
C#
31
star
39

backbone

An example of BackboneJS integration with the PubNub library.
JavaScript
30
star
40

pubnub-jscourse

HTML
28
star
41

rust

PubNub Rust SDK.
Rust
27
star
42

dart

PubNub Dart SDK
Dart
27
star
43

super-simple-chat

A simple chat room demo for a PhoneGap tutorial
CSS
26
star
44

pubnub-android-chat

Java
25
star
45

Unity-Realtime-Chat-Room-Tutorial

A realtime unity chat room for iOS, Android, web and others.
C#
25
star
46

swift

PubNub native Swift SDK for iOS, MacOS, WatchOS, TvOS
Swift
24
star
47

oi-web-notifications

A simple realtime web notification demo
CSS
23
star
48

Realtime-RaspberryPi-Temperature-Humidity-Sensor

Stream live temperature and humidity readings from the Raspberry Pi and visualize through realtime charts and graphs
JavaScript
22
star
49

LeapMotionServoBots

LeapMotionServoBots
Java
21
star
50

pubnub-polymer

A Custom element to connect PubNub data stream.
HTML
19
star
51

eon-workshop

Hands on Exercises for the EON workshop
HTML
19
star
52

secure-key-exchange

Babel - Encrypted Self Destructing Messaging with Asymmetric Key Exchange Public-Private Crypto.
JavaScript
19
star
53

haskell

PubNub Haskell SDK
Haskell
18
star
54

pongnub

Realtime Multiplayer Online Pong
JavaScript
16
star
55

pubnub-rickshaw-memory

Publish the memory usage of a nodeJS instance in pubnub-rickshaw format
JavaScript
16
star
56

d3-wordcloud

Demo of a word cloud generated from messages from a chat room
JavaScript
15
star
57

pubnub-ember

PubNub Ember SDK
CoffeeScript
14
star
58

am-chat

A demo of using PubNub Access Manager to secure a public chatting experience.
JavaScript
14
star
59

pubstrap-chat

Bootstrap 3 Chat Plugin
JavaScript
14
star
60

flutter-ref-app-simple-chat

Dart
13
star
61

swift-radio-station

Swift
13
star
62

go-metrics-statsd

library for sending statsd messages via go-metrics https://github.com/rcrowley/go-metrics
Go
13
star
63

ios-swift-todo-app

Collaborative to-do app in swift
Swift
13
star
64

swift-ref-app-team-chat

Team Chat Reference Application for PubNub Chat With SwiftUI and ReSwift
Swift
13
star
65

webgl-stackhack

A collaborative block painting game.
JavaScript
12
star
66

eon-builder

CSS
12
star
67

chat-engine-examples

Examples for angular, react, jQuery, and NodeJS
HTML
12
star
68

collab-notes-react

A collaborative stickie note web app with React.js, ES6, and PubNub
CSS
12
star
69

swift-apple-watch-heart-rate-pubnub-eon

Objective-C
12
star
70

easy-hacker-news-stream

The Easiest Way to Create a Hacker News Feed using Python and JavaScript - We’ve all been sitting in the back of a CS lecture or class and looked up from our laptop to actually listen and taken a quick peek around at everyone’s laptops. More likely than not, quite a few of those screens were displaying the all too familiar Hacker News orange. While maybe we should all pay attention more to the speaker, it seems new, cool news always takes precedence. So what if you were determined to never miss a single article? Or what if you wanted to get every update from the site and automate based off that new information? By leveraging the power of PubNub’s real time global network and scraping a little RSS everyone will never miss a new Hacker News article again.
HTML
12
star
71

chat-examples-javascript

Sample code and apps for PubNub’s Chat Resource Center
JavaScript
11
star
72

lua

lua
Lua
11
star
73

flutter-demo-app

Dart
11
star
74

kotlin-telemedicine-demo

A sample application that demonstrates how to build a feature-rich chat app for telemedicine using PubNub Chat and PubNub Kotlin SDK
Kotlin
11
star
75

pubnub-drone

Parrot AR 2.0 Drone Controlled with PubNub
JavaScript
10
star
76

auth-chat-demo

A simple chat room demo using PubNub JavaScript pub/sub API for both client and server, combined with PubNub Access Manager APIs and OAuth.
JavaScript
10
star
77

chat-engine-tutorial

JavaScript
10
star
78

moderation-dashboard

Moderation Dashboard is a React application that provides moderation capabilities to Chat applications built using PubNub and PubNub Chat Components
JavaScript
9
star
79

chat-examples-java

Sample code and apps for PubNub’s Chat Resource Center
Java
9
star
80

pubnub-tessel

Getting Started Guide and Example Programs for Tessel.io / PubNub integration
CoffeeScript
9
star
81

polymer-cat-chat-v1

A simple chat room in Material Design build with Polymer (Polymer 1.0)
HTML
9
star
82

LinkItONE

PubNub LinkIt ONE Library
C++
8
star
83

redux

Redux based Client State Management for interacting with PubNub Realtime APIs
TypeScript
8
star
84

vue

JavaScript
8
star
85

pubnub-rickshaw

HTML
8
star
86

pubnub-bluetooth

Connect PubNub to tiny-circuits bluetooth module (nrf8001)
JavaScript
8
star
87

chat-engine-apple

Objective-C
7
star
88

javascript-quickstart-platform

JavaScript
HTML
7
star
89

kafka-bridge

Messages from your Kafka cluster can be received on a target mobile device.
Rust
7
star
90

tutorial-app-react-native

JavaScript
7
star
91

rabbitmq

Adapter to connect PubNub's real-time network with RabbitMQ deployments behind an enterprise's firewall
Java
7
star
92

bitcoin

Real-time BitCoin graphs with PubNub and D3.js
CSS
7
star
93

johnnyfive-eon

Realtime data visualization with PubNub EON Demo & Arduino: Displaying the data sent by Arduino with DS18B20 temperature sensor using Johnny-Five
HTML
7
star
94

kotlin

PubNub Kotlin SDK
Kotlin
7
star
95

bootstrap-content-curator

A real-time feed management system using Bootstrap UI that enables the rapid authoring of feed headlines for applications in social news, social TV, social music, social sports, social commerce and social finance.
HTML
7
star
96

pubnub-chatterbox-ios

Objective-C
6
star
97

brightscript

Brightscript
6
star
98

graphql-pubnub-subscriptions

TypeScript
6
star
99

chat-examples-swift

Sample code and apps for PubNub’s Chat Resource Center
Swift
5
star
100

catchpoint-api

JS based API wrapper to call catchpoint functionality
JavaScript
5
star