Skip to content

Commit

Permalink
Wrote README
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiahzs committed Jan 15, 2018
1 parent f4d7fa5 commit 6dcf408
Showing 1 changed file with 29 additions and 11 deletions.
40 changes: 29 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,46 @@
# Se::Api
# SE API

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/se/api`. To experiment with that code, run `bin/console` for an interactive prompt.
SE API is a ruby gem for interacting with the Stack Exchange API. It was designed with the [SE Realtime Fee](https://stackexchange.com) in mind (specifically interactions through [se-realtime](https://github.com/izwick-schachter/se-realtime)), and therefore it will only work with four route subsets:

TODO: Delete this and the text above, and describe your gem
- `/users/{ids}`
- `/posts/{ids}`
- `/questions/{ids}`
- `/answers/{ids}`

## Installation

Add this line to your application's Gemfile:
While a version of this gem does exist in rubygems, it's recommended to use it from git. The master branch should always work. You can add it to your Gemfile with:

```ruby
gem 'se-api'
gem 'se-api', git: 'https://github.com/izwick-schachter/se-api.git', branch: 'master'
```

And then execute:

$ bundle

Or install it yourself as:
## Usage

$ gem install se-api
First, initialize your client. You can omit the api key, but it's strongly recommended that you use one because it increases your request limit drastically. Also, any paramters that you pass on initialization will be passed with any request (but can be overridden later). It is recommended that you set the `site` this way.

## Usage
```ruby
require 'se/api'

cli = SE::API::Client.new(ENV['APIKey'], site: 'stackoverflow')
```

Now that you've initialized the client, you can use the instance methods provided:

> Note: All the routes below pass `**params` directly to the API.
TODO: Write usage instructions here
- `post(id, **params)`: Gets a post based on the ID passed.
- `posts(*ids, **params)`: Get posts based on either a semicolon delimited string of ids or an array of ids.
- `question(id, **params)`: Gets a question based on the ID passed.
- `questions(*ids, **params)`: Gets questions based on either a semicolon delimited string of ids or an array of ids.
- `answer(id, **params)`: Gets an answer based on the ID passed.
- `answers(*ids, **params)`: Gets answers based on either a semicolon delimited string of ids or an array of ids.
- `user(id, **params)`: Gets a user based on the ID passed.
- `users(*ids, **params)`: Gets users based on either a semicolon delimited string of ids or an array of ids.

## Development

Expand All @@ -32,12 +50,12 @@ To install this gem onto your local machine, run `bundle exec rake install`. To

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/se-api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
Bug reports and pull requests are welcome on GitHub at https://github.com/izwick-schachter/se-api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

## Code of Conduct

Everyone interacting in the Se::Api project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/se-api/blob/master/CODE_OF_CONDUCT.md).
Everyone interacting in the Se::Api project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/izwick-schachter/se-api/blob/master/CODE_OF_CONDUCT.md).

0 comments on commit 6dcf408

Please sign in to comment.