Git Product home page Git Product logo

node-takeaway's Introduction

Node.js Takeaway.com API

Unofficial JavaScript implementation of the Takeaway.com API.

Installation

yarn add takeaway

Endpoints

  • Banks
  • CheckVoucher
  • Config
  • CreateAccount
  • Discounts
  • GeoLocation
  • HistoryDetails
  • LoyaltyPoints
  • ImportOrder
  • Menucard
  • OnlinePaymentStatus
  • Order
  • OrderWithOnlinePayment
  • RecurringPayment
  • ResetPassword
  • RestaurantData
  • RestaurantList
  • Reviews
  • ServerTime
  • URLs
  • UserAddressList
  • UserLogin
  • UserOrderHistory
  • VietnamDeliveryArea

Example

import {Takeaway, TakeawayConfig} from 'takeaway';
import {inspect} from 'util';

(async () => {
    try {
        // Initialize configuration
        // See `src/config.js` for defaults
        const config = new TakeawayConfig({
            language: 'nl',
            url: 'https://nl.citymeal.com/android/android.php'
        });

        // Initialize Takeaway API
        const takeaway = new Takeaway(config);

        // Fetch country
        const country = await takeaway.getCountryById('NL');

        // Login to the country specific site
        const user = await country.login('[email protected]', 'testpassword123');
        console.log(inspect(user, false, null));

        // Request restaurants list for area
        const restaurants = await country.getRestaurants('7500', '52.0000000', '6.0000000');
        console.log(inspect(restaurants, false, null));
    } catch (err) {
        console.error(err);
    }
})();

Development

Setup

# Clone Git repository
git clone [email protected]:TakeawayAPI/node-takeaway.git
cd node-takeaway

# Install dependencies
yarn

node-takeaway's People

Contributors

daniellehuisman avatar davvos11 avatar dependabot[bot] avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

node-takeaway's Issues

Add tests

Tests should be added to easily confirm this project uses the latest Takeaway API.

Your app needs an update

Currently, this inoffical version doesn't work anymore:

<en>
      <ti>Your app needs an update</ti>
      <tx>This version of the app is no longer supported. Download the update now, or order on our website.</tx>
      <btn>No thanks</btn>
</en>

Is there a reliable method to get the link to the restaurant?

Hey there,

awesome work so far and great to see that you are still working on this project.

Is there are reliable method to get the restaurant link? Right now, i am kinda "guessing" the link by clearing the name of the restaurant and then trying some variations. This only works in 99% of the cases, but sometimes i end up in a completely different restaurant (same name, different city => different restaurant).

Is there something i am missing?

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.