Git Product home page Git Product logo

node-500px's Introduction

node-500px's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

node-500px's Issues

has no method '_configure'

node: v0.6.17

is there sth wrong in my commands

myhost:software zhangbin$ node

API500px = require("500px").API500px
[Function: API500px]
consumer_key = 'xxx'
'xxx'
api500px = API500px(consumer_key)
TypeError: Object # has no method '_configure'
at API500px (/Users/zhangbin/software/node_modules/500px/lib/api500px.js:11:7)
at repl:1:13
at REPLServer.eval (repl.js:80:21)
at Interface. (repl.js:182:12)
at Interface.emit (events.js:67:17)
at Interface._onLine (readline.js:162:10)
at Interface._line (readline.js:426:8)
at Interface._ttyWrite (readline.js:603:14)
at ReadStream. (readline.js:82:12)
at ReadStream.emit (events.js:88:20)

Example not working

after running your sample code on

http://ro-ka.github.io/node-500px/

api500px.photos.getPopular({'sort': 'created_at', 'rpp': '100'},  function(error, results) {
    if (error) {
        // Error!
    } else {
        // Do something
    }
});

I get { code: undefined }

Under the if(error) part.

Simpler Export

Since this library only exports one thing, no reason to put it on an object like you do here -- you can just make it directly export. This way you could use the library with require('500px') instead of require('500px').API500px ๐Ÿ˜€

Better error handling

Hi, I've just submitted PR for that as for now -> your API returns error with code: undefined (that's due to the typo). Anyway - according to 500px docs, we can parse JSON on successful response anyway and then, by parsing responseCode value, we can decide whether to return an error or not. The good thing about that solution is that if we are going to parse JSON from 500px always, we will be able to return user readable error with error.message property that can explain what went wrong.

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.