Code Monkey home page Code Monkey logo

taobaoapi's Introduction

TaoBaoApi

通过淘宝或天猫商品链接获取商品信息,商品信息包括标题、价格、图片。

环境说明

当前版本0.0.6 ruby 1.9.3 2.0.0未测试,nokogiri版本可能会有些问题

依赖库

nokogiri, faraday, faraday_middleware

安装方法

在 Gemfile 文件中加入以下代码:

gem "TaoBaoApi"

然后执行:

$ bundle

或者你可以通过 gem installl 直接安装:

$ gem install TaoBaoApi

使用方法

require 'TaoBaoApi'

good = TaoBaoApi::Good.new 'http://item.taobao.com/item.htm?id=16434110195'

info  = good.get_info

p info #hash format,{:title => xxx, :price => xxx, :images => [], :url => url}

测试文件见test.rb

Todo

  • 获取促销价

update list

  • 改进价格获取失败的问题;

taobaoapi's People

Contributors

wikimo avatar gonjay avatar

Watchers

James Cloos avatar cedric avatar

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.