Extension:AmazonLookup

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
AmazonLookup
Release status: beta
Amazon icon.png
Implementation Tag
Description Allow quick formatted Amazon Product API ItemLookup
Author(s) Jason Reiche (JasonReichetalk)
Latest version 0.1 (2014-04-23)
MediaWiki 1.22+
PHP 5.3+
Database changes No
License GNU General Public License 2.0 or later
Download AmazonLookup.zip
  • $wgAmazonLookupAPIKey
  • $wgAmazonLookupSecretKey
  • $wgAmazonLookupAssociateTag
  • $wgAmazonLookupRegion
<al>
Translate the AmazonLookup extension if it is available at translatewiki.net
Check usage and version matrix.

The AmazonLookup extension adds a new tag which allows you to quickly and simply create a formatted box of information about a product on Amazon. It does this by connecting to the Amazon Product Advertising API.

Pre-Installation[edit]

  1. You will need to create an Amazon Product Advertising API account: Product Advertising API
  2. You will also need an Amazon Associates account and Associate Tag: Associates

Installation[edit]

  • Extract contents of AmazonLookup.zip to extensions/AmazonLookup/
  • Add the following code at the bottom of your LocalSettings.php:
require_once( "$IP/extensions/AmazonLookup/AmazonLookup.php" );
  • Done! Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.

Configuration[edit]

You will need to add the following parameters at the bottom of your LocalSettings.php:

$wgAmazonLookupAPIKey       = '';
$wgAmazonLookupSecretKey    = '';
$wgAmazonLookupAssociateTag = '';
$wgAmazonLookupRegion       = 'com';
Parameter Description
$wgAmazonLookupAPIKey Enter your Amazon Product API Public Key
$wgAmazonLookupSecretKey Enter your Amazon Product API Secret Key
$wgAmazonLookupAssociateTag Enter your Amazon Associates Tag / Tracking ID
$wgAmazonLookupRegion Amazon region ('com', 'ca', 'co.uk', 'de', 'fr' or 'co.jp')

Usage[edit]

See these usage instructions with examples on the [AmazonLookup Demo Page].

For the most basic use, you will need to get the ASIN from Amazon for the product you would to display. The ASIN is a 10 digital number found in all Amazon product URLs as shown in the following examples:

http://www.amazon.com/gp/product/0375833870/
http://www.amazon.com/dp/B008JFUQ3O/
Normally found after dp/ or gp/product/
Basic usage

<al>0375833870</al>

Custom title text

<al title='One Fish, Two Fish, Three, Four, Five Fish'>0375833870</al>

Just show linked title text

<al plainlink>0375833870</al>

Just show a linked image

<al imagelink>0375833870</al>

Change the image size

<al imagesize="Medium">0375833870</al>

Valid image sizes are: Swatch (30px), Small or Thumbnail (75px), Tiny (110px), Medium (160px), Large (500px). Pixels represent maximum height. Small is the default if emitted.
Just show a linked image with adjusted size

<al imagelink imagesize="Medium">0375833870</al>

Define Item ID type to retrieve

<al idtype="UPC">078742086644</al>

Valid Item IDs are: ASIN, ISBN, UPC, and EAN.