Giter Site home page Giter Site logo

toby's Introduction

Toby Build Status Dependency Status

Ruby 版淘宝 API SDK,目前只实现了几个我自己需要用到的接口,不过要扩展也很容易,欢迎 fork。

安装

gem install toby

示例

taobao.item.get 得到单个商品信息

require "toby"

client = Toby::Client.new(:app_key => APP_KEY, :app_secret => APP_SECRET)
request = Toby::Request.create("taobao.item.get")
request.num_iid = 13364998803
# 默认获取所有 fields
request.fields = "detail_url,num_iid,title,nick,type,cid,seller_cids,pic_url,num,location,price"
item = client.execute(request)
=> #<Hashie::Mash cid=50010368 detail_url="http://item.taobao.com/item.htm?id=13364998803&spm=2014.12350568.0.0" location=#<Hashie::Mash city="嘉兴" state="浙江"> nick="勍杰旗舰店" num=992342 num_iid=13364998803 pic_url="http://img01.taobaocdn.com/bao/uploaded/i1/T1NV6JXltiXXbNURc1_042147.jpg" price="100.00" seller_cids=",469730817,437939819,437939818,441075878,437938900,437938899,437938898," title="正品开车防炫目司机墨镜太阳镜夜视镜偏光镜夹片钓鱼近视眼镜男女" type="fixed">

更多例子可以看 spec

License

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004

Copyright (C) 2004 Sam Hocevar [email protected]

Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  1. You just DO WHAT THE FUCK YOU WANT TO.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.