Category Archives: Web

Graphing My Cycling Progress on Strava and Automating With Zapier

Since I moved to a new home that’s closer to work, I’ve been riding my bike to commute at least a few times each week. My commute to work is very easy as it’s almost completely downhill. I pay for it on the way back, though. I’ve been trying to get healthier, so commuting with my bike has definitely become a priority. In addition to having fun, I’d also like to motivate myself to ride more often and push myself to get better at it (especially the uphill part).

I’ve been using Strava to track my rides, and it turns out that my ride home includes a user-generated segment that automatically tracks my performance when I’m going uphill on Liberty. The first time I rode, it took 10:44 for me to complete. My best time so far is 6:58. The cool part is that I’m able to see the progress I’ve made, and I really do feel accomplished when I beat one of my best times. Here’s the view I’m using to see what my times are:

Stava SegmentThis isn’t the easiest table to read, but you can see that the dates sort of correlate with my times, as the fastest one is in September and the ones in August are slower on average. While beating my fastest time is a good motivator, it’s not realistic to try and break my record every time I ride. I’d rather see consistent improvement as a motivator.

To visualize this, I decided to grab all of the times by viewing the full leaderboard (with just my results). I gathered the times and dates and thew them into a Google spreadsheet to visualize my trend. Here are the results so far.

Strava Trend

Success! It looks like I made some really good progress since I started in July, and my times have been inching downward as I get better at cycling uphill. The times also probably vary a bit because there are some stop signs and a traffic signal within the segment, which can slow me down.

The next problem I wanted to tackle was the data entry bit. Since it’s a pain to update the spreadsheet each time I ride,  I wanted to automate the addition of new efforts (the term that Strava uses to describe single instances of activities on a segment). This is where things get interesting.

Because I’m storing the efforts in a Google Doc, and because Strava has an API, I just need to connect the two together. Unfortunately, my go-to choice for this kind of thing, IFTTT, doesn’t have Strava as a channel. Luckily, I can do something similar with Zapier (btw that’s a referral link, so be sure to click it so I can get more tasks), which is sort of like IFTTT but costs money (albeit with a nice free tier) and has more integrations. You can also set up your own integration, which is what I had to do with Strava.

In order to get the list of my efforts on that particular segment, I had to create a few Zapier “triggers.” One to get my Strava user ID (for use in other API endpoints), another to grab my starred segments (so I could specify which segment I wanted to track), and finally a trigger to listen for any new efforts on my commute’s segment (limited to efforts created by me). I also had to post-process the last trigger so that I could get the date in a format that works in Google Spreadsheets. The result looks something like this:

Strava Zapier

Now, whenever I ride home on my bike while recording the segment with Strava, the effort will be automatically logged and graphed on my Google Spreadsheet! Apparently, I can embed the chart, so here it is!


While the Zapier integration had a somewhat steep learning curve, it’s nice to just set the “zap” and then forget about it. Any new integrations I might need to write will also go much quicker. As always, Runscope was a really useful tool for exploring the Strava API and getting real responses from the API to play around with. Finally, I learned the right way to spell athlete rather painfully (after misspelling athlete_id a billion times and wondering why my request wasn’t filtering correctly)!

I went from seeing some sketchy looking progress in my Strava results table to being able to visualize it on a graph, while also setting the graph up to update whenever I record a new effort! Automation for the win!

If you’re interested in the details of the integration, or if you want to try it out yourself, let me know and I can invite you as a tester. If there’s a lot of interest, I can also go over the creation of the integration, as I ran into a few gotchas while building it.

Google Reader and Skating to Where The Puck Used To Be

I just wrote a couple of tweets about this, but maybe this is a better blog post subject.

Google Reader is shutting down, apparently because its user base is shrinking and Google wants to focus on fewer products. Because of the huge void this will leave, many startups are rushing to fill the space that Google Reader took up. So far I’ve heard of plans from Digg, Flipboard, Zite (whatever that is), Feedly, and maybe some others.

While this might be a good opportunity for those startups, it strikes me as odd. There’s a concept called being a “fast follower” where you copy some innovative company’s product immediately after they release it. Think of Facebook’s clone of that Snapchat app. What we’re seeing now is sort of the “slow(est) follow.”

I suppose it makes sense to go into a space that you know is going to swell up with demand, but honestly, how much longer does the classic Google Reader style app have left? How much of the original Google Reader market are you going to get? Will you be able to re-create the community that the sharebros loved so much? On top of that, do any of these new products have a solid plan on monetization?

To put it another way, what is the opportunity cost of rebuilding Google Reader (even if it’s a “reimagined” version) versus putting time into another product that might actually be new and useful? At this point, it’s probably not worth it considering how many others are eager to clone Reader.

Pharma Hacked!

I noticed that the Google results for my blog have been showing ads for pharmaceuticals. I am not actively trying to sell drugs, so I figured this was a hack.

I ended up nuking the wp directory for this blog and re-installing plugins/images. I think the site’s clean now but it’s hard to tell since the “fetch as Googlebot” feature in Google Webmaster tools seems to show stale data. I’m not sure whether to blame Cloudflare, Google or myself.

Hopefully my Google results for this blog clear up in a few days or so. The weird part of the hack is that normal visitors are not affected. So the malware writers are apparently trying to sell stuff to Google. Of course, they’re just trying to raise their Google rank by inserting links and not being caught by being too obvious. But it’s interesting that the hack is transparent to normal people unless you check the Google cache.

Oh and sorry if you came here looking for the pharmaceuticals. You’ll just have to get them somewhere else.

Dropbox Referrals with Google Adwords

I read a tweet from someone a while back about how they used Google Adwords to max out their Dropbox referral disk space. I thought this was a clever hack and decided to try it for myself. I made a new Adwords account and entered a coupon code from Dreamhost for $75 in free Adwords money.

I ran into a few issues with my first ads. They were running okay in the beginning, but were getting shot down in the review process for trademark issues. I couldn’t figure out why this was the case, since I had seen multiple blog posts describing how to set up the ads with no mention of trademark issues. I tried a few tweaks, and removed “Mac” from the copy of my ads, thinking that the word might have triggered the trademark issue.

The first set of ads without “Mac” in them ended up getting approved, and I was on the fast track to Dropbox space gluttony. Here’s a screenshot of what my campaign looked like (until I stopped it because I maxed out on referrals):

Things looked like smooth sailing and I think I only used something like $20 worth of credit (though I could’ve easily optimized for spend, I kinda wanted to finish more quickly, so I set my cpcs aggressively). I was gonna change the ads and open it up for friends to get referral space, too.

Then yesterday, with no warning, I got an email that my account had been suspended. There wasn’t really any good explanation for this. When I look at my account, it says:

Your Google AdWords account has been permanently suspended for repeated violation of AdWords or Landing Page and Site policies in this or a related account.


Your Google AdWords account has been permanently suspended because your billing information in this or a related account could not be verified.

I’m not sure I could come up with a more vague message. So far, Google Adwords email support has been of no use at all. I first got an email saying they were “escalating” the matter, which probably just means they didn’t get around to it within 24 hours so they had to send something, then I got a generic form email saying that:

After reviewing your account, it has come to our attention that your Google AdWords accounts do not comply with our Terms and Conditions. As a result, your account, and any related accounts you may have created, have been suspended, and your ads will no longer run on Google.

Well no shit, that really doesn’t tell me anything new! The best tidbit of the email was that:

– For privacy reasons, AdWords Support is unable to provide any additional information regarding this account.

You know, in case I find something out about myself that I didn’t know… It’s my account!

If I did something wrong to get banned, I sure would like to know why. Since I don’t, I feel like I’m in the customer support limbo that is synonymous with “Google Support” which is already an oxymoron of sorts.

Anyway, TL;DR I used Adwords to max out my Dropbox referrals like many have before, got the banhammer from Google and now their customer support is atrocious (as expected).

Banana Republic (and Gap, etc.) Stores Passwords in Plain Text

I was sitting on the subway when I got a random email from Banana Republic that contained my password in plain text. Besides the fact that I hadn’t requested it (lots of Hung Truongs think that they’re me @ gmail), I was surprised because any company that even slightly values security does not store passwords in plain text. It is quite jarring to see a password show up on my iPhone’s home screen. Here’s the email in case anyone needs proof:

The fact that BR stores passwords in plain text means that they’re probably a very nice target for a quick hack (and if they’ve got bad practices in password storage, they probably have holes elsewhere as well). Unlike the Gawker password leak, which had hashed passwords (though they could still be eventually brute-forced), the BR passwords aren’t even obfuscated (or if they are, it’s in an easily reversible way).

If you have a Banana Republic, Gap, Old Navy, Piperlime or Athela account, I highly suggest you change your password to something unique that you don’t use for any other sites (um, just like all your passwords… I totally have different passwords and two-factor security for everything).

I’d also suggest you contact Banana Republic and tell them that their security policies suck. Maybe they’ll fix it if enough people complain. That’d be sad if it took a huge hack and user info disclosure to change their ways.