Coder Social home page Coder Social logo

supermarket's Introduction

Supermarket

This is a thin JRuby wrapper for the Android Market API Java project (also mirrored on github: jberkel/android-market-api).

It's a new project and only some parts of the protocol have been implemented. I decided to build on top of Java/JRuby because the native Ruby Protocolbuffer implementation (ruby-protobuf) could not properly handle the .proto file used by the API.

Synopsis

require 'supermarket'
session = Supermarket::Session.new

# search apps for term 'foo' return results as json
puts session.search("foo").to_json

# retrieve comments for an app by app id as xml
puts session.comments("com.example.my.project").to_xml

Installation

$ gem install supermarket

You will need to provide your Google market credentials in ~/.supermarket.yml:

---
login: [email protected]
password: secret

Command line usage

Searching

$ market search ruboto | jsonpretty
{
  "app": [
    {
      "rating": "4.642857142857143",
      "title": "Ruboto IRB",
      "ratingsCount": 14,
      "creator": "Jan Berkel",
      "appType": "APPLICATION",
      "id": "9089465703133677000",
      "packageName": "org.jruby.ruboto.irb",
      "version": "0.1",
      "versionCode": 1,
      "creatorId": "\"Jan Berkel\"",
      "ExtendedInfo": {
        "category": "Tools",
        "permissionId": [
...

Comments

$ market comments org.jruby.ruboto.irb | jsonpretty
{
  "comments": [
    {
      "rating": 5,
      "creationTime": 1269710736815,
      "authorName": "Nate Kidwell",
      "text": "Tremendous application. More examples would be great (as would integrated rubydocs), but awesome all the same.",
      "authorId": "04441815096871118032"
    },
...

Screenshot

$ market imagedata org.jruby.ruboto.irb --image-out=image.jpg

Google spreadsheet import

Import market_comments_template.csv into a new spreadsheet, with CSV conversion. Open the imported document, rename as you like. In the menu, click on Forms / Create form. Add anything in the form description just to enable the Save button. If you are using a private Google Apps domain, make sure to uncheck the option "Require yourdomain.com sign-in to view this form." Save the form. Copy the formkey displayed in the link at the bottom of the form creation page

Run:

comments2form app_id form_key

The initial import of comments will take a while, but subsequent runs will only add new comments to the form. Just stick the command in a crontab somewhere.

Credits

This library would be impossible without the code from the Android Market API project. Serialization support handled by the protobuf-java-format library.

License

Copyright (c) 2010, Jan Berkel [email protected] All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

supermarket's People

Contributors

jberkel avatar moski avatar hryk avatar dexterthedragon avatar

Watchers

 avatar James Cloos avatar  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.