Skip to content

Instantly share code, notes, and snippets.

@fourthdimension
Created November 8, 2016 03:56
Show Gist options
  • Save fourthdimension/f518ee1ed8d4cf23056eaab9f14803dc to your computer and use it in GitHub Desktop.
Save fourthdimension/f518ee1ed8d4cf23056eaab9f14803dc to your computer and use it in GitHub Desktop.
function TRENDLINK(style,state) {
var s;
if(state == "Ontario")
s = "CA-ON";
else if(state == "Manitoba")
s = "CA-MB";
else if(state == "Quebec")
s = "CA-QC";
else if(state == "Saskatchewan")
s = "CA-SK";
else if(state == "Alberta")
s = "CA-AB";
else if(state == "Newfoundland")
s = "CA-NL";
else if(state == "NovaScotia")
s = "CA-NS";
else if(state == "NewBrunswick")
s = "CA-NB";
else if(state == "BritishColumbia")
s = "CA-BC";
return "https://www.google.ca/trends/explore?geo=" + s + "&q=" + style;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment