Blog
September 29, 2015 Marie H.

When Spam is a Necessary Evil

When Spam is a Necessary Evil

Photo by <a href="https://unsplash.com/@ricdeoliveira?utm_source=cloudista&utm_medium=referral" target="_blank" rel="noopener">Ruan Richard Rodrigues</a> on <a href="https://unsplash.com/?utm_source=cloudista&utm_medium=referral" target="_blank" rel="noopener">Unsplash</a>

We don’t often talk about spam as something necessary often times it is a nuisance and fortunately in this gmail powered world something we rarely have to deal with any more. However there are times outside of mail that spam is the only avenue left to get the attention to resolve an ongoing issue.
The following story will highlight one such case where I recently used spam to my advantage. In a ever public facing world social media can be used to grab the attention of almost any major corporation. (They have teams of people whose job is to watch social media.)
So in August, my wife and I decided to purchase a TV for our son (perhaps not the greatest idea); but it seemed like a great solution if we could implement proper restrictions on use. We found a GREAT deal on a open box TV from best buy for only $130 dollars and snatched it up. Only problem, we bought it online where it would need to be shipped from PA.
Anyways, this package left the shipper on the 4th of August with an expectant delivery date of the 8th of August. However; come August 22nd UPS has marked on their tracking site that the package is lost and they have opened an investigation.
Throughout the weeks we have called both Best Buy and UPS to no avail each provider telling us to call the other. After about 7 calls I finally told my wife I would take care of it.
This is where having some software experience really pays off. I threw together a basic python script in 10 minutes and set it off to use the Twitter API to post a message @bestbuy and @ups every 10 minutes until I got a response.
And what do you know……
Within a half hour I have both companies coming to me to provide me expedited customer service. This is one of the times where I feel spam is okay although I’m sure some disagree.
Anyways here is the script in question:

#!/usr/bin/env python
"""
One man"s anger expressed through
code, consuming api"s and spam
"""
from twitter.api import Twitter
from twitter import *
import time, os
api_key    = '****'
api_secret = '****'
username   = 'PassionateCode'
password   = '****'
msgArr = [
    "Sup @bestbuy, @ups please note that my cronjobs have been initiated...",
    "@bestbuy, @ups they shall stop when a refund, gift card or item I purchased on Aug 4th arrives",
    "@bestbuy, @ups here is the order number: BBY01-738679018411",
    "@bestbuy, @ups I have talked to you like 7 times on the phone, I mean you have $130 bucks right?",
    "@bestbuy, @ups my son really wanted this birthday present in a reasonable time period",
    "@bestbuy, @ups #DontFProgrammers",
    "@bestbuy, @ups Thanks again; and look forward to your reply",
]
creds = os.path.expanduser('~/.twitter_credentials')
if not os.path.exists(creds):
        oauth_dance("HateBestBuy", api_key, api_secret, creds)
oauth_token, oauth_secret = read_token_file(creds)
twitter = Twitter(auth=OAuth(oauth_token, oauth_secret, api_key, api_secret))
for msg in msgArr:
    twitter.statuses.update(status = msg)
    time.sleep(600)

Tell your friends...