Download the PHP package promoqui/promoqui-api-php without Composer

On this page you can find all versions of the php package promoqui/promoqui-api-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package promoqui-api-php

 PromoQui API Wrapper for PHP

This library is for internal use only. It serves as an helper for Ruby developers when interacting with the PromoQui REST API for Crawlers.

The Settings class allows you to set the URL of the API domain.

You should not attempt to use this library against the official PromoQui API domain without permission from PromoQui SPA. Feel free however, to use it for your own projects and to report any problem you may find.

Setup

We are using composer to manage our PQSDK wrapper so you have to install composer based on your operating system.

Once you installed composer, to install PQSDK wrapper create a new folder and inside it run from a terminal:

First of all, you have to declare the Crawlers namespace and import the composer's autoload.php loader using php's require function:

Configure the library to use your provided api host, key, schema and country:

The PromoQui REST API requires the app secret to be exchanged with a token with a duration of 3 hours. All the Token exchange and renovation is handled internally by the library, so that you can completely ignore it.

Working with brands

That line of code will interrogate the PromoQui database for that Brand and will return a Brand object, containing details like: id, name, slug.

That line of code will interrogate the PromoQui database for that all brands and will return Brand objects array.

Working with cities

That line of code will interrogate the Promoqui database for the given city. If the city exists on our database, it will return a City object all details about the given city such as: name, latitude, longitude, inhabitants and most importantly the City ID.

That line of code will interrogate the PromoQui database for that City, eventually creating it if not found, and will return a City object, containing all the details like: latitude, longitude, inhabitants and most importantly the City ID.

To get only cities from a specific country you have to use something like this:

Working with stores

Note!

The opening hours array must be as follow:

That code will interrogate the database for a store at that address, with that zipcode, among the stores for the retailer we were assigned. If the store was not found then we will set all data of store and then save it.

Note about Geocoder use

If you can't find the store's latitude/longitude coordinates then you have to skip setting latitude/longitude to PQSDK::Store object. Our server will set them using geocoder only the first time.

Working with leaflets

That code will try to find a leaflet with the same url (to avoid inserting it again). If it is not found it will create a new leaflet. Pay attention at the store_ids field. It must be an array of valid store ids, for which the leaflet is valid.

A few seconds after the creation, the PromoQui infrastructure will begin to parse and upload the leaflet pages to the website.

If you do not dispose of a valid GET url from which the leaflet can be taken, but you are however able to obtain a binary version of the leaflet (raw PDF data bytes), you can still upload it like this:

If you have lealfet pages instead of leaflet's pdf url or leaflet's raw data, you can send an array of images urls such as:

Working with offers

For each offer we need to parse:

Suppose we have all offers saved in an array called offers and an array called storeIds that contains all store ids:

With the above code we scroll all offers, asing storeIds to offer and save it.

Support Libraries

For convenience we have included in the "libraries" folder the PHP library "simplehtmldom" (http://simplehtmldom.sourceforge.net/) for parsing HTML pages.

This is the most common external library for parsing HTML pages. It is written in PHP5 + and allows you to manipulate HTML in a very simple way.

The documentation can be found at this URL: http://simplehtmldom.sourceforge.net/manual.htm

You have to include in your crawler PHP script the follow inclusion code:

Example:

Have a nice day


All versions of promoqui-api-php with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package promoqui/promoqui-api-php contains the following files

Loading the files please wait ....