godfat / rest-gw2

A very simple Guild Wars 2 API client built with rest-core.

Home Page:https://gw2.godfat.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rest-gw2 Build Status Coverage Status Join the chat at https://gitter.im/godfat/rest-gw2

by Lin Jen-Shin (godfat)

LINKS:

DESCRIPTION:

A very simple Guild Wars 2 API client built with rest-core.

There's also a bundled web application showing your items, serving as an example using the client. There's also a demo site

FEATURES:

  • Caching from rest-core for the win.
  • Concurrency from rest-core for the win.

REQUIREMENTS:

  • Tested with MRI (official CRuby) and JRuby.
  • rest-core

REQUIREMENTS: (if you need the web application)

  • rack
  • jellyfish
  • dalli (optional for memcached)
  • lru_redux (optional for LRU cache)

INSTALLATION:

gem install rest-gw2

INSTALLATION: (if you need the web application)

gem install rest-gw2 rack jellyfish
gem install dalli     # if you have memcached
gem install lru_redux # if you don't have memcached
gem install puma      # for a faster server which also works for JRuby
gem install yahns rack-handlers # slightly faster than puma, CRuby only

SYNOPSIS:

require 'rest-gw2'
gw2 = RestGW2::Client.new(:access_token => '...')
gw2.get('v2/account/bank') # => list of items in your bank

SYNOPSIS: (if you need the web application)

If you would like to try it, run with:

env RESTGW2_SECRET=... rest-gw2

The secret would be used for encrypting the access token. If you don't set it then it would just use the default secret, which basically means no encrypting at all, because the default secret is hard coded in the source, which is publicly available because this is an open source project.

Or you could put your secret in a config file and point it with:

env RESTGW2_CONFIG=... rest-gw2

The format for the config file would be like:

RESTGW2_SECRET=...
RESTGW2_PREFIX=...

DVELOPMENT:

git clone git@github.com:godfat/rest-gw2.git
cd rest-gw2
gem install rack jellyfish dalli lru_redux rack-handlers rib
gem install httpclient mime-types timers
gem install yahns
rake server
rake console

Using JRuby:

git clone git@github.com:godfat/rest-gw2.git
cd rest-gw2
jruby -S gem install rack jellyfish dalli lru_redux rack-handlers rib
jruby -S gem install httpclient mime-types timers
jruby -S gem install jruby-openssl
jruby -S gem install torquebox-web --pre
jruby -S rake server
jruby -S rake console

Current production script:

jruby -Xcompile.invokedynamic=true -J-Xmx1536m -S rake server -- -p PORT -s trinidad

CONTRIBUTORS:

  • Lin Jen-Shin (@godfat)

LICENSE:

Apache License 2.0

Copyright (c) 2015-2019, Lin Jen-Shin (godfat)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A very simple Guild Wars 2 API client built with rest-core.

https://gw2.godfat.org/

License:Apache License 2.0


Languages

Language:Ruby 76.0%Language:HTML 24.0%