Live data from Hacker News

Reversing Safeway's private APIs to automate coupon collection

blog.jonlu.ca

61–70 of 148 posts

Re: Reversing Safeway's private APIs to automate coupon collection

#61
post #19

This is cool but I'm not sure the purpose. I use the Safeway app every time I go to Safeway. I scan all the offers and just add the ones I want, which builds a shopping list for me. This gives me a list of things to buy but more importantly I know what's on sale . If I just added all the coupons I'd still have to scan the list of things to find what I want to buy, but then I'd have to track them elsewhere, because th…

Coupons have two purposes, which seem contrary, but are essential to understand how coupons are a form of advertising: 1) Saves you money (versus the retail price of the item) 2) Makes you more likely to buy the product on the coupon. Your use of coupons adheres to both value #1 (saves you money, because you know what's on sale) and value #2 (advertises products on sale, increasing your chances of buying them). This…

> They also have perfect tracking

They have perfect tracking of completed purchases, but have no idea how effective their ad was for the people who didn't buy it. Did they miss the ad entirely because of poor placement? Did they see the ad but not value the deal? Did they clip the coupon but not make it to the store before expiration? Did they clip the coupon but find a better deal in the store? Did they clip the coupon, find the store was out of stock, and not feel like dealing with the store's rain-check process (if any)?

Arguably the tracking isn't perfect for completed purchases, even. They get purchase date and store location, but that's not all that much: online retailers get much more information when someone clicks on a banner ad and then completes the purchase. They can even get some information out of a failed sale, depending on how far the potential customer made it through the process before bailing.

Re: Reversing Safeway's private APIs to automate coupon collection

#62

I did something similar with Safeway's API back in the day. But rather than chew up their API with unsupported usage--CFAA case territory--I now just log into Safeway's website and issue a one-liner on the coupon page: $(".grid-coupon-clip-button button").click();

I did that for a while too, but realized the mental overhead wasn't really worth it - occasionally I'd get the super generic coupons of "Spend $20, get $2 back" and those were worth it, but most of the time I was adding coupons I'd never use.

The mental effort of going to the site at all was what I was trying to circumvent - now I don't even need to think about it (the clearer abstraction is that going from "2 to 1" is a much less drastic jump than going from "1 to 0" - completely removing the overhead is what makes this worthwhile, IMO, not the actual speed of the actions)

Re: Reversing Safeway's private APIs to automate coupon collection

#63

I did something similar with Safeway's API back in the day. But rather than chew up their API with unsupported usage--CFAA case territory--I now just log into Safeway's website and issue a one-liner on the coupon page: $(".grid-coupon-clip-button button").click();

I use to use a similar bookmarklet that I would run on the Safeway Coupons page. But it stopped working after they moved away from Angular and I was too lazy to update it.

https://gist.github.com/pbojinov/d572b5494a4f26390aeb5136d70...

Re: Reversing Safeway's private APIs to automate coupon collection

#65
post #10

Another tip: (area code) 867-5309 works for Safeway club card discounts in most area codes while piping tracking of your purchases to essentially null. Yes, Jenny’s number.

At risk of ya'll taking "my" safeway gas rewards, this is almost always good for whatever the maximum discount off per gallon is at any safeway that also has a gas station.

Its amazing to me the degree to which people will go to save 3% or less on gas once a month. If you fill up 4 times a month you're saving about $4, and all it costs is a profile of everything you buy attached to your phone number.

Re: Reversing Safeway's private APIs to automate coupon collection

#66
post #17

When I see access to private API's like this, I wonder how judges would interpret these actions as they relate to the CFAA. By accessing "private" API's like this, are you knowingly accessing a computer without authorization? Are you exceeding your authorized access? The fact that Aaron's Law never went through has disturbed me...

In EU you are allowed to automate everything you legally can do manually, even if they have a large sign on their page saying that automation is not allowed. The only thing that is limiting you from selling is copyright, but by-products from ordinary business is always legal.

Re: Reversing Safeway's private APIs to automate coupon collection

#67
post #34

Earlier quoted context omitted.

Exactly this. I did the same thing to find available camping spots in Hawaii because they are super difficult to get. Wrote a script that would query their "API" every 5 minutes and alert me if a spot became available anywhere.

Have you considered whether doing this might be...wrong? Presumably those campsites are permitted by some government agency (NPS, BLM, the state of Hawaii, etc.), and presumably that agency designed permitting system with the assumption that people with limited time and attention would be vying for the permits by having to visit the site themselves to get one. This encodes a particular definition of fairness: that th…

You make an interesting point but I don't think that system was ever made to be ethically fair.

Without a script it relies on your free time and refreshing the script every 15 minutes. What if you have a full time job far away from a computer, are you less deserving than anyone with a lot of free time to refresh the page?

Re: Reversing Safeway's private APIs to automate coupon collection

#68
post #55

I did something similar with Safeway's API back in the day. But rather than chew up their API with unsupported usage--CFAA case territory--I now just log into Safeway's website and issue a one-liner on the coupon page: $(".grid-coupon-clip-button button").click();

what does this do exactly?

> $(".grid-coupon-clip-button button").click();

> what does this do exactly?

The command allows you to click all buttons in the page at once:

• The dollar sign is an alias for jQuery [1];

• The text between double quotes is a CSS selector;

• Select every DOM element with a “grid-coupon-clip-button” and “button” CSS class;

• The thing at the end is a JavaScript function call which triggers an “onclick” event [2];

[1] https://jquery.com/

[2] https://api.jquery.com/click/

Re: Reversing Safeway's private APIs to automate coupon collection

#69
post #65

Earlier quoted context omitted.

At risk of ya'll taking "my" safeway gas rewards, this is almost always good for whatever the maximum discount off per gallon is at any safeway that also has a gas station.

Its amazing to me the degree to which people will go to save 3% or less on gas once a month. If you fill up 4 times a month you're saving about $4, and all it costs is a profile of everything you buy attached to your phone number.

Given that they're probably already tracking everything via my credit card number (whether I sign up for anything or not), I don't feel like much privacy is being given up.

Though as a rule I don't bother with most of these programs, mainly due to the inconvenience factor.

I've lost hope of maintaining my privacy through any actions I can take individually. A legislative solution is required.

Re: Reversing Safeway's private APIs to automate coupon collection

#70
post #65

Earlier quoted context omitted.

At risk of ya'll taking "my" safeway gas rewards, this is almost always good for whatever the maximum discount off per gallon is at any safeway that also has a gas station.

Its amazing to me the degree to which people will go to save 3% or less on gas once a month. If you fill up 4 times a month you're saving about $4, and all it costs is a profile of everything you buy attached to your phone number.

The discount is markedly more substantial than 3%. If it's a Safeway brand gas station the max discount is a dollar off per gallon. The safeway gas station I used to do this at currently has regular for $2.69 a gallon.
Post reply on HN