README.md in tweetstream-1.1.3 vs README.md in tweetstream-1.1.4

- old
+ new

@@ -1,19 +1,14 @@ -TweetStream -=========== +# TweetStream TweetStream provides simple Ruby access to [Twitter's Streaming API](https://dev.twitter.com/docs/streaming-api). -Installation ------------- +## Installation -To install: - gem install tweetstream -Usage ------ +## Usage Using TweetStream is quite simple: ```ruby require 'rubygems' @@ -53,12 +48,11 @@ ``` The methods available to TweetStream::Client will be kept in parity with the methods available on the Streaming API wiki page. -Using the Twitter Userstream ----------------------------- +## Using the Twitter Userstream Using the Twitter userstream works similarly to the regular streaming, except you use the userstream method. ```ruby # Use 'userstream' to get message from your stream @@ -83,12 +77,11 @@ end client.userstream ``` -Configuration and Changes in 1.1.0 ----------------------------------- +## Configuration and Changes in 1.1.0 As of version 1.1.0.rc1 TweetStream supports OAuth. Please note that in order to support OAuth, the `TweetStream::Client` initializer no longer accepts a username/password. `TweetStream::Client` now accepts a hash: @@ -122,12 +115,11 @@ TweetStream assumes OAuth by default. If you are using Basic Auth, it is recommended that you update your code to use OAuth as Twitter is likely to phase out Basic Auth support. -Swappable JSON Parsing ----------------------- +## Swappable JSON Parsing As of version 1.1, TweetStream supports swappable JSON backends via MultiJson. You can specify a parser during configuration: ```ruby @@ -137,12 +129,11 @@ end ``` Available options are `:yajl`, `:json_gem`, `:json_pure`, and `:ok_json`. -Handling Deletes and Rate Limitations -------------------------------------- +## Handling Deletes and Rate Limitations Sometimes the Streaming API will send messages other than statuses. Specifically, it does so when a status is deleted or rate limitations have caused some tweets not to appear in the stream. To handle these, you can use the on_delete and on_limit methods. Example: @@ -187,12 +178,11 @@ Twitter recommends honoring deletions as quickly as possible, and you would likely be wise to integrate this functionality into your application. -Errors and Reconnecting ------------------------ +## Errors and Reconnecting TweetStream uses EventMachine to connect to the Twitter Streaming API, and attempts to honor Twitter's guidelines in terms of automatic reconnection. When Twitter becomes unavailable, the block specified by you in `on_error` will be called. Note that this does not @@ -219,12 +209,11 @@ end.track('term') do |status| # Do things when nothing's wrong end ``` -Terminating a TweetStream -------------------------- +## Terminating a TweetStream It is often the case that you will need to change the parameters of your track or follow tweet streams. In the case that you need to terminate a stream, you may add a second argument to your block that will yield the client itself: @@ -240,12 +229,11 @@ When `stop` is called, TweetStream will return from the block the last successfully yielded status, allowing you to make note of it in your application as necessary. -Daemonizing ------------ +## Daemonizing It is also possible to create a daemonized script quite easily using the TweetStream library: ```ruby @@ -256,29 +244,30 @@ ``` If you put the above into a script and run the script with `ruby scriptname.rb`, you will see a list of daemonization commands such as start, stop, and run. -TODO ----- +## TODO * SiteStream support -Note on Patches/Pull Requests ------------------------------ +## <a name="dependencies"></a>Dependency Status +[![Dependency Status](https://gemnasium.com/intridea/tweetstream.png?travis)][gemnasium] +[gemnasium]: https://gemnasium.com/intridea/tweetstream + +## Contributing + * Fork the project. * Make your feature addition or bug fix. * Add tests for it. This is important so I don't break it in a future version unintentionally. * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull) * Send me a pull request. Bonus points for topic branches. -Contributors ------------- +## Contributors * Michael Bleigh (initial gem) * Steve Agalloco (current maintainer) -Copyright ---------- +## Copyright Copyright (c) 2011 Intridea, Inc. (http://www.intridea.com/). See [LICENSE](https://github.com/intridea/tweetstream/blob/master/LICENSE.md) for details.