Permalink
Browse files

HTTPS everywhere, especially when using the streaming API.

  • Loading branch information...
mdkent committed Feb 2, 2017
1 parent 77eca60 commit 2f7e500c927228b13f7bd36ba3e7c730c790681c
Showing with 12 additions and 12 deletions.
  1. +1 −1 sections/account.md
  2. +3 −3 sections/rooms.md
  3. +8 −8 sections/streaming.md
View
@@ -13,7 +13,7 @@ This endpoint includes:
* account id, subdomain, and name
* plan name (max, plus, etc.)
* owner’s user ID
-* time zone in [tz format](http://en.wikipedia.org/wiki/Zone.tab)
+* time zone in [tz format](https://en.wikipedia.org/wiki/Zone.tab)
* total storage used in bytes
* creation and last-update timestamps
View
@@ -35,7 +35,7 @@ Get rooms
Get room
--------
-* `GET /room/#{id}.xml` returns an existing room.
+* `GET /room/#{id}.xml` returns an existing room.
This endpoint also includes all the users currently inside the room.
@@ -60,7 +60,7 @@ This endpoint also includes all the users currently inside the room.
<id type="integer">1</id>
<name>Jason Fried</name>
<type>Member</type>
- <avatar-url>http://asset0.37img.com/global/.../avatar.png</avatar-url>
+ <avatar-url>https://asset0.37img.com/global/.../avatar.png</avatar-url>
</user>
...
</users>
@@ -71,7 +71,7 @@ This endpoint also includes all the users currently inside the room.
Update room
-----------
-* `PUT /room/#{id}.xml` updates an existing room.
+* `PUT /room/#{id}.xml` updates an existing room.
Only admins can rename a room, although any user (except guests) may set the topic. Omitting either tag results in that attribute being ignored. To remove a room topic, simply provide an empty `topic` tag.
View
@@ -42,34 +42,34 @@ The target host is always `streaming.campfirenow.com`.
Examples
--------
-Need to get started quickly with the Campfire Streaming API? Try one of our example scripts that use the [twitter-stream](http://github.com/voloko/twitter-stream) library or [YAJL Ruby C bindings](http://github.com/brianmario/yajl-ruby):
+Need to get started quickly with the Campfire Streaming API? Try one of our example scripts that use the [twitter-stream](https://github.com/voloko/twitter-stream) library or [YAJL Ruby C bindings](https://github.com/brianmario/yajl-ruby):
**twitter-stream**
``` ruby
# gem install twitter-stream
require 'twitter/json_stream'
-
+
token = 'xxx' # your API token
room_id = 111 # the ID of the room you want to stream
-
+
options = {
:path => "/room/#{room_id}/live.json",
:host => 'streaming.campfirenow.com',
:auth => "#{token}:x"
}
-
+
EventMachine::run do
stream = Twitter::JSONStream.connect(options)
-
+
stream.each_item do |item|
puts item
end
-
+
stream.on_error do |message|
puts "ERROR:#{message.inspect}"
end
-
+
stream.on_max_reconnects do |timeout, retries|
puts "Tried #{retries} times to connect."
exit
@@ -88,7 +88,7 @@ require "yajl/http_stream"
token = 'xxx' # your API token
room_id = 111 # the ID of the room you want to stream
-url = URI.parse("http://#{token}:x@streaming.campfirenow.com/room/#{room_id}/live.json")
+url = URI.parse("https://#{token}:x@streaming.campfirenow.com/room/#{room_id}/live.json")
Yajl::HttpStream.get(url) do |message|
puts message.inspect
end

0 comments on commit 2f7e500

Please sign in to comment.