Friday, February 11, 2011

Javascript trickery: direct links to Fredericton Sobeys/Superstore Flyers

I've been really hankering for a simple grocery shopping comparison tool, but haven't come across one yet.

At one point I started working on one without really getting very far, but after some investigation, I discovered that most of the handling for the Sobeys and (Atlantic) Superstore flyers is Javascript-based. This could probably lead to some easy-to-parse lists of sales and prices.

One useful feature in the meantime is the ability to get to the accessible flyers for my stores quickly by looking at the "publication.aspx" source code. If you open that file up in some developer tools, you can build your own links in this format:

My Superstore

My Sobeys

The links look like this:

http://director.flyerservices.com/{CUSTOMER_NAME}/PublicationDirector.ashx?OrganizationId={ORGANIZATION_ID}&BannerId={BANNER_ID}&BannerName={BANNED_NAME}&pubtype={PUBLICATION_TYPE}&Language=en&Version=Text&PostalCode=e3a2l4&SessionId=nkg4olv1s3brluuc2cntid45&StoreId={STORE_ID}

Hopefully that session ID won't let you guys exploit anything, I'm not sure if it's required.

No comments: