Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
vDeggial committed Nov 30, 2014
1 parent cc83196 commit 99c37bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Tumbl Tool/Common Helpers/CommonHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ public static class CommonHelper
{
private static Regex _htmlRegex = new Regex("<.*?>", RegexOptions.Compiled);


public static string fixURL(string url)
{
if (url.EndsWith("/"))
{
url = url.Remove(url.Length - 1);
}

return url;
}

public static string getMimeType(string extension)
{
string mimeType = "";
Expand Down
2 changes: 1 addition & 1 deletion Tumbl Tool/Common Helpers/JSONHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static string getQueryString(string tumblrDomain, string type, int start
{
string query = string.Copy(jsonURL);

query += "/" + tumblrDomain + jsonPostQuery;
query += "/" + CommonHelper.fixURL(tumblrDomain) + "/" + jsonPostQuery;
query += "?api_key=" + apiKey;

if (!string.IsNullOrEmpty(type))
Expand Down
2 changes: 1 addition & 1 deletion Tumbl Tool/Common Helpers/XMLHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static string getQueryString(string tumblrURL, string type, int start = 0
query += "?num=" + ((int)postStepEnum.XML).ToString();
}

return tumblrURL + query;
return CommonHelper.fixURL( tumblrURL) + query;
}

public static XDocument getXMLDocument(string url)
Expand Down

0 comments on commit 99c37bc

Please sign in to comment.