Git Product home page Git Product logo

airapi's People

Contributors

siphamm avatar

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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

airapi's Issues

API key?

hi @phamtrisi
thanks for sharing this code! i have a quick question: you hard code an API key in here. how did you obtain that API key? i am planning to make a very large number of requests against that API, so I am worried that there might be a limit at some point? do you have any experience with such issues? thanks for your help.

Hosting id

Maybe a stupid question, but I just can't figure out, how to get hosting (client) id..

Connection Keep Alive

Sometimes when trying to retrieve reviews, there's an a connection error.
This is solved if adding: 'Connection': 'keep-alive' in configs.js

undefined:1 <!DOCTYPE html> ^ SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>)

When running an example from examples folder. I also have tried adding my credentials from airbnb and looked up for the issue.

Here is the full log:

undefined:1
<!DOCTYPE html>
^

SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at Request._callback (/Users/rostyslav/projects/airapi/api/search.js:52:22)
    at Request.self.callback (/Users/rostyslav/projects/airapi/node_modules/request/request.js:368:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/Users/rostyslav/projects/airapi/node_modules/request/request.js:1219:14)
    at emitOne (events.js:121:20)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/Users/rostyslav/projects/airapi/node_modules/request/request.js:1167:12)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Better error handling

request does not always have an err object when res.status !== 200

Using getInfo.js as an example:

request(requestConfigs, function(err, res, body) {
  if (!err && res.statusCode == 200) {
    resolve(JSON.parse(body));
  } else if (err) {
    reject(err);
  }
});

When calling this method with a listing ID that does not exist Airbnb return status = 404 with the body = {error_code:404, error: 'record_not_fond' ...} but err object in null.

Because of your "if else" statement neither resolve or reject is called... which is bad as this hangs and never returns.

Propose a change to something like:

request(requestConfigs, function(err, res, body) {
  if (res.statusCode == 200) {
    resolve(JSON.parse(body));
  } else {
    reject(JSON.parse(body));
  }
});

Release note and roadmap

Hello,

I have seen your great work and hope to contribute.
Can I know upcoming features and roadmap?

Thanks.

Search by geographical box

Search for apartments also can be done on a map.

"sw_lat" "sw_lng" "ne_lat" and "ne_lng" are the parameter names.

This is important as it allows to search for all apartements in a region: if many apartments are found for a region, then zoom in and search more in detail...

Integrate with jQuery

Hi!
I've found your awesome library. But I think it only works with node.js. But I want to integrate it with jQuery.

So, can you tell me how can I do that?
Thanks
Mobashir

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.