string proxy = project.Variables["Proxy"].Value;
string memberID = project.Variables["mozMemberID"].Value;
string keyString = project.Variables["mozSecret"].Value;
string requestUri = "http://lsapi.seomoz.com/linkscape/url-metrics/";
string domain = System.Web.HttpUtility.UrlEncode(project.Variables["url"].Value);
double add = 15;
TimeSpan tsDuration = (DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0));
// Add intExpiryHours to the duration
TimeSpan tsEnd = TimeSpan.FromMinutes(add);
tsDuration = tsDuration.Add(tsEnd);
// Generate our unix timestamp
double dblUnixTime = tsDuration.TotalSeconds;
// Remove the decimal parts, we don't need them
int intUnixTime = (int)dblUnixTime;
// Convert to string for the api request
string strExpiry = intUnixTime.ToString();
string message = string.Concat(memberID + "\n" + strExpiry);
ASCIIEncoding encoding = new ASCIIEncoding();
// Convert our message and keystring to bytes
byte[] keyByte = encoding.GetBytes(keyString);
byte[] messageBytes = encoding.GetBytes(message);
// Compute the hash
System.Security.Cryptography.HMACSHA1 algorithm = new System.Security.Cryptography.HMACSHA1(keyByte);
byte[] hash = algorithm.ComputeHash(messageBytes);
// Base64 encode the hash
string strSignature = Convert.ToBase64String(hash);
// Return a url encoded version of the encoded hash string
string signature = System.Web.HttpUtility.UrlEncode(strSignature);
string strAPIUrl = "http://lsapi.seomoz.com/linkscape/url-metrics/" + domain + "?AccessID=" + memberID + "&Expires=" + strExpiry + "&Signature=" + signature;
string resultHttpGet = ZennoPoster.HttpGet(strAPIUrl, proxy, "UTF-8", ZennoLab.InterfacesLibrary.Enums.Http.ResponceType.HeaderAndBody);
return resultHttpGet;