Created
July 23, 2012 06:21
-
-
Save sandrinodimattia/3162264 to your computer and use it in GitHub Desktop.
GoogleReader Url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ReaderUrl | |
{ | |
/// <summary> | |
/// Base url for Atom services. | |
/// </summary> | |
public const string AtomUrl = "https://www.google.com/reader/atom/"; | |
/// <summary> | |
/// Base url for API actions. | |
/// </summary> | |
public const string ApiUrl = "https://www.google.com/reader/api/0/"; | |
/// <summary> | |
/// Feed url to be combined with the desired feed. | |
/// </summary> | |
public const string FeedUrl = AtomUrl + "feed/"; | |
/// <summary> | |
/// State path. | |
/// </summary> | |
public const string StatePath = "user/-/state/com.google/"; | |
/// <summary> | |
/// State url to be combined with desired state. For example: starred | |
/// </summary> | |
public const string StateUrl = AtomUrl + StatePath; | |
/// <summary> | |
/// Label path. | |
/// </summary> | |
public const string LabelPath = "user/-/label/"; | |
/// <summary> | |
/// Label url to be combined with the desired label. | |
/// </summary> | |
public const string LabelUrl = AtomUrl + LabelPath; | |
} | |
public enum ReaderCommand | |
{ | |
SubscriptionAdd, | |
SubscriptionEdit, | |
SubscriptionList, | |
TagAdd, | |
TagEdit, | |
TagList, | |
TagRename, | |
TagDelete | |
} | |
public static class ReaderCommandFormatter | |
{ | |
/// <summary> | |
/// Get the full url for a command. | |
/// </summary> | |
/// <param name="comm"></param> | |
/// <returns></returns> | |
public static string GetFullUrl(this ReaderCommand comm) | |
{ | |
switch (comm) | |
{ | |
case ReaderCommand.SubscriptionAdd: | |
return GetFullApiUrl("subscription/quickadd"); | |
case ReaderCommand.SubscriptionEdit: | |
return GetFullApiUrl("subscription/edit"); | |
case ReaderCommand.SubscriptionList: | |
return GetFullApiUrl("subscription/list"); | |
case ReaderCommand.TagAdd: | |
return GetFullApiUrl("edit-tag"); | |
case ReaderCommand.TagEdit: | |
return GetFullApiUrl("edit-tag"); | |
case ReaderCommand.TagList: | |
return GetFullApiUrl("tag/list"); | |
case ReaderCommand.TagRename: | |
return GetFullApiUrl("rename-tag"); | |
case ReaderCommand.TagDelete: | |
return GetFullApiUrl("disable-tag"); | |
default: | |
return ""; | |
} | |
} | |
/// <summary> | |
/// Get the full api url. | |
/// </summary> | |
/// <param name="append"></param> | |
/// <returns></returns> | |
private static string GetFullApiUrl(string append) | |
{ | |
return String.Format("{0}{1}", ReaderUrl.ApiUrl, append); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment