twitter-stream 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of twitter-stream might be problematic. Click here for more details.

@@ -0,0 +1,2 @@
1
+ .rake_tasks~
2
+ /pkg
@@ -5,20 +5,32 @@ Uses [EventMachine](http://rubyeventmachine.com/) for connection handling. Adher
5
5
 
6
6
  JSON format only.
7
7
 
8
+ ## Install
9
+
10
+ sudo gem install twitter-stream -s http://gemcutter.org
11
+
8
12
  ## Usage
9
13
 
14
+ require 'rubygems'
15
+ require 'twitter/json_stream'
16
+
10
17
  EventMachine::run {
11
18
  stream = Twitter::JSONStream.connect(
12
19
  :path => '/1/statuses/filter.json?track=football',
13
- :auth => 'LOGIN:PASSWORD',
20
+ :auth => 'LOGIN:PASSWORD'
14
21
  )
15
22
 
16
23
  stream.each_item do |item|
17
- # do someting with unparsed JSON item
24
+ # Do someting with unparsed JSON item.
18
25
  end
19
26
 
20
27
  stream.on_error do |message|
21
- # log or something
28
+ # No need to worry here. It might be an issue with Twitter.
29
+ # Log message for future reference. JSONStream will try to reconnect after a timeout.
30
+ end
31
+
32
+ stream.on_max_reconnects do |timeout, retries|
33
+ # Something is wrong on your side. Send yourself an email.
22
34
  end
23
35
  }
24
36
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -186,6 +186,7 @@ module Twitter
186
186
  if ln =~ /\AHTTP\/1\.[01] ([\d]{3})/
187
187
  @code = $1.to_i
188
188
  @state = :headers
189
+ receive_error("invalid status code: #{@code}. #{ln}") unless @code == 200
189
190
  else
190
191
  receive_error('invalid response')
191
192
  close_connection
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{twitter-stream}
5
- s.version = "0.1.0"
5
+ s.version = "0.1.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Vladimir Kolesnikov"]
@@ -13,7 +13,8 @@ Gem::Specification.new do |s|
13
13
  "README.markdown"
14
14
  ]
15
15
  s.files = [
16
- "README.markdown",
16
+ ".gitignore",
17
+ "README.markdown",
17
18
  "Rakefile",
18
19
  "VERSION",
19
20
  "examples/reader.rb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Kolesnikov
@@ -22,6 +22,7 @@ extensions: []
22
22
  extra_rdoc_files:
23
23
  - README.markdown
24
24
  files:
25
+ - .gitignore
25
26
  - README.markdown
26
27
  - Rakefile
27
28
  - VERSION