Skip to content

Instantly share code, notes, and snippets.

Sitemap Service

Collects SNS messages from Westfield API's, stores them in redis, and then get requests to the service generate url's on the fly.

Running in development

Sitemap service uses Redis to store records for all products, events, stores, retailers, and deals. You will need redis installed. Easiest with brew.

$ brew install redis
@jreece1567
jreece1567 / LoadTest.xml
Created February 19, 2016 03:08
Simple test suite - all-stores and all-deals
<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project id="c81811bc-3f60-45c7-8df0-063ce101e0c5" activeEnvironment="Default" name="API Performance Project" resourceRoot="" soapui-version="5.2.1" abortOnError="false" runType="SEQUENTIAL" xmlns:con="http://eviware.com/soapui/config"><con:settings/><con:interface xsi:type="con:RestService" id="ebf3dd75-0ff5-42cc-a2a4-580a60bad673" wadlVersion="http://wadl.dev.java.net/2009/02" name="https://api.uat.westfield.io" type="rest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:settings/><con:endpoints><con:endpoint>https://api.uat.westfield.io</con:endpoint></con:endpoints><con:resource name="Stores" path="/v1/stores" id="ce413ae8-3bfe-4297-bdcd-f41369f934a2"><con:settings/><con:parameters><con:parameter><con:name>api_key</con:name><con:value>BEPH3JFgNsYetXCBx6tOdHGJzA6rwjgY</con:value><con:style>QUERY</con:style><con:default>BEPH3JFgNsYetXCBx6tOdHGJzA6rwjgY</con:default><con:path xsi:nil="true"/><con:description xsi:nil="true"/></con:parameter><con:par
@jreece1567
jreece1567 / Main.java
Created February 11, 2016 00:00
Example of getting store-details for all stores in a country.
/**
*
*/
package com.westfieldlabs.loadtest;
import java.util.ArrayList;
import java.util.List;
import com.westfieldlabs.restsdk.model.store.StoreInstance;
import com.westfieldlabs.restsdk.model.store.StoresListResponse;
/**
*
*/
package com.westfieldlabs.restsdk.example;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
private Date adjustDateTimezone(final Date rawDate, final TimeZone tz) {
// the 'rawDate' was passed by the API as a 'local' date,
// and this date has been parsed as if it were in UTC, so it needs to be
// adjusted
// to the 'local' time indicated by the TimeZone param.
// get the 'raw' GMT-offset for the timezone (not accounting for DST)
final Long tzOffset = (tz.getRawOffset() * -1L);
int dstOffset;
@jreece1567
jreece1567 / foo,yml
Created April 15, 2015 22:04
Stripped-down YML for Jibestream stuff ... DO NOT MERGE, just an example for use with swagger-editor ...
swagger: "2.0"
info:
version: "1"
title: Westfield Store Service
schemes:
- http
- https
consumes:
- application/json
produces:
@jreece1567
jreece1567 / gist:9250967da6ca341ef1c0
Created November 14, 2014 04:33
Example/template for RestSDK asynchronous calls
public Map<String, List<StoreTradingHours>> storeTradingHoursAsync(
final String centre_id, final Locale locale) {
// get the list of 'major' stores for which we want to get trading hours
final List<Store> stores = service.retailers.getCentreStores(centre_id,
null, null, null, null, true, null, null, null, 100, 1);
// count of 'get-trading-hours' calls that we need to make
int count = stores.size();