KO
|
EN
gitlite — search
Search
#typescript
#ai-agents
#ai
#dsh-plugin
#deepseek-harness
#open-source
#cli
#claude-code
#codex
#developer-tools
#react
#windows
open_taobao
★ 28
Open GitHub ↗
淘宝开放平台客户端ruby版,支持Rails3+
Download README (.md)
Explore Similar Repositories
TUIOsharp
:
No description available.
Open-GPS-tracker
:
A web based GPS-tracker.
appengine-i18n-sample-python
:
A small sample showing how to build an internationalized app with App Engine
LeafSnap
:
computer vision-based mobile plant classification application(Android)
Scarlet
:
An HTTP frontend for Redis
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
open_taobao
?
Download (.md)
OpenTaobao [](https://travis-ci.org/wongyouth/open_taobao) [](https://codeclimate.com/github/wongyouth/open_taobao) ========== Taobao Open Platform client for ruby. Rails3+ is supported. ## NOTICE * `pid` is removed from config file, it's not required any more. * Change OpenTaobao::Error message to json string from v0.2.1. ## Installation Add this line to your application's Gemfile: gem 'open_taobao' If you want to use [patron][] as http client instead of Net::HTTP, add line below to your Gemfile gem 'patron' And then execute: $ bundle Or install it yourself as: $ gem install open_taobao ## Usage ### Rails with yaml file configured Run generator to generate config file: $ rails g open_taobao:install It will generate a `taobao.yml` file under your Rails' config dir. Open the file and configure it with your taobao info. Notice: `app_key`, `secret_key`, `endpoint` must be included in your YAML file, otherwise OpenTaobao.load will fail. The `app_key` and `secret_key` are avaliable by `ENV['TAOBAO_API_KEY']`, `ENV['TAOBAO_SECRET_KEY']` out of the box if you use same keys for other taobao related gems, e.g. omniauth-taobao. call `OpenTaobao.get` or `OpenTaoboa.post`,with taobao parameters: hash = OpenTaobao.get( :method => "taobao.itemcats.get", :fields => "cid,parent_id,name,is_parent", :parent_cid => 0 ) The return data will be converted to a Hash automatically. Also `OpenTaobao.get!` and `OpenTaobao.post!` are avaliable, which will raise an `OpenTaobao::Error` if a `error_response` receieved. ### plain ruby OpenTaobao.config = { 'app_key' => 'test', 'secret_key' => 'test', 'endpoint' => "http://gw.api.tbsandbox.com/router/rest" } OpenTaobao.initialize_session hash = OpenTaobao.get( :method => "taobao.itemcats.get", :fields => "cid,parent_id,name,is_parent", :parent_cid => 0 ) ### get query string If you want the query string with some params just pass the params to OpenTaobao.url() the same as OpenTaobao.get(). The query string will change every time your executed because timestamps changed. OpenTaobao.url( :method => "taobao.itemcats.get", :fields => "cid,parent_id,name,is_parent", :parent_cid => 0 ) ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Added some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request [patron]: https://github.com/toland/patron