/// <summary> /// Returns the 20 most recent statuses, including retweets if they exist, from non-protected users. The public timeline is cached for 60 seconds. /// </summary> /// <param name="tokens">The oauth tokens.</param> /// <param name="options">The options.</param> /// <returns>A <see cref="TwitterStatusCollection"/>.</returns> /// <remarks></remarks> public static TwitterResponse <TwitterStatusCollection> PublicTimeline(OAuthTokens tokens, OptionalProperties options) { Commands.PublicTimelineCommand command = new Commands.PublicTimelineCommand(tokens, options); TwitterResponse <TwitterStatusCollection> result = CommandPerformer.PerformAction(command); return(result); }
/// <summary> /// Updates the authenticating user's profile background image. This method can also be used to enable or disable the profile background image. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="imageData">The image data.</param> /// <param name="options">The options.</param> /// <returns></returns> public static TwitterResponse <TwitterUser> UpdateProfileBackgroundImage(OAuthTokens tokens, byte[] imageData = null, UpdateProfileBackgroundImageOptions options = null) { if (imageData == null && options == null) { throw new System.ArgumentNullException("imageData", "You must provide image data or indicate you wish to not use any image in the options argument."); } Commands.UpdateProfileBackgroundImageCommand command = new Twitterizer.Commands.UpdateProfileBackgroundImageCommand(tokens, imageData, options); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Check if a user is a member of the specified list. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="ownerUsername">The username of the list owner.</param> /// <param name="listId">The list id.</param> /// <param name="userId">The user id.</param> /// <param name="options">The options.</param> /// <returns> /// The user's details, if they are a member of the list, otherwise <c>null</c>. /// </returns> public static TwitterResponse <TwitterUser> CheckMembership(OAuthTokens tokens, string ownerUsername, string listId, decimal userId, OptionalProperties options) { Commands.CheckListMembershipCommand command = new Twitterizer.Commands.CheckListMembershipCommand( tokens, ownerUsername, listId, userId, options); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Allows the authenticating users to unfollow the user specified. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="TargetID">The user id of the friendship to destroy.</param> /// <param name="Screenname">The screenname of the user of the friendship to destroy.</param> /// <param name="options">The options.</param> /// <returns> /// Returns the unfollowed user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. /// </returns> public static async Task <TwitterResponse <User> > DeleteAsync(OAuthTokens tokens, decimal TargetID = 0, string Screenname = "", OptionalProperties options = null) { return(await CommandPerformer.PerformAction(new Twitterizer.Commands.DeleteFriendshipCommand(tokens, TargetID, Screenname, options))); }
/// <summary> /// Allows the authenticating users to unfollow the user specified in the ID parameter. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="userId">The user id.</param> /// <param name="options">The options.</param> /// <returns> /// Returns the unfollowed user in the requested format when successful. /// </returns> public static TwitterResponse <TwitterUser> Delete(OAuthTokens tokens, decimal userId, OptionalProperties options) { Commands.DeleteFriendshipCommand command = new Commands.DeleteFriendshipCommand(tokens, userId, string.Empty, options); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Returns a list of the 20 most recent direct messages sent by the authenticating user. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="options">The options.</param> /// <returns> /// A <see cref="TwitterDirectMessageCollection"/> instance. /// </returns> public static TwitterResponse <TwitterDirectMessageCollection> DirectMessagesSent(OAuthTokens tokens, DirectMessagesSentOptions options) { return(CommandPerformer.PerformAction(new Commands.DirectMessagesSentCommand(tokens, options))); }
/// <summary> /// Deletes the saved search specified in the ID parameter as the authenticating user. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="savedsearchId">The saved search id.</param> /// <param name="options">The options.</param> /// <returns>The deleted saved search in the requested format when successful.</returns> public static TwitterResponse <TwitterSavedSearch> Delete(OAuthTokens tokens, decimal savedsearchId, OptionalProperties options) { return(CommandPerformer.PerformAction( new Commands.DeleteSavedSearchCommand(tokens, savedsearchId, options))); }
/// <summary> /// Updates the authenticating user's profile image. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="imageData">The image data.</param> /// <param name="options">The options.</param> /// <returns> /// The user, with updated data, as a <see cref="TwitterUser"/> /// </returns> public static TwitterResponse <TwitterUser> UpdateProfileImage(OAuthTokens tokens, byte[] imageData, OptionalProperties options = null) { Commands.UpdateProfileImageCommand command = new Twitterizer.Commands.UpdateProfileImageCommand(tokens, imageData, options); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Returns up to 100 of the first retweets of a given tweet. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="statusId">The status id.</param> /// <param name="options">The options.</param> /// <returns> /// A <see cref="TwitterStatusCollection"/> instance. /// </returns> public static TwitterResponse <TwitterStatusCollection> Retweets(OAuthTokens tokens, decimal statusId, RetweetsOptions options) { return(CommandPerformer.PerformAction( new Commands.RetweetsCommand(tokens, statusId, options))); }
/// <summary> /// Returns the 20 most recent retweets posted by the authenticating user's friends. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="options">The options.</param> /// <returns>A <see cref="TwitterStatusCollection"/> instance.</returns> public static TwitterResponse <TwitterStatusCollection> RetweetedToMe(OAuthTokens tokens, TimelineOptions options) { return(CommandPerformer.PerformAction( new Commands.RetweetedToMeCommand(tokens, options))); }
/// <summary> /// Unsubscribes the authenticated user from the specified list. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="listId">The list id.</param> /// <param name="optionalProperties">The optional properties.</param> /// <returns></returns> /// <remarks></remarks> public static TwitterResponse <TwitterList> UnSubscribe(OAuthTokens tokens, decimal listId, OptionalProperties optionalProperties) { Commands.DestroyListSubscriber command = new Commands.DestroyListSubscriber(tokens, listId, optionalProperties); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Subscribes the specified tokens. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="listId">The list id.</param> /// <param name="optionalProperties">The optional properties.</param> /// <returns></returns> public static TwitterResponse <TwitterList> Subscribe(OAuthTokens tokens, decimal listId, OptionalProperties optionalProperties) { Commands.CreateListMembershipCommand command = new Commands.CreateListMembershipCommand(tokens, listId, optionalProperties); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Returns the members of the specified list. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="username">The username.</param> /// <param name="listIdOrSlug">The list id or slug.</param> /// <param name="options">The options.</param> /// <returns> /// A collection of users as <see cref="TwitterUserCollection"/>. /// </returns> public static TwitterResponse <TwitterUserCollection> GetMembers(OAuthTokens tokens, string username, string listIdOrSlug, GetListMembersOptions options) { Commands.GetListMembersCommand command = new Twitterizer.Commands.GetListMembersCommand(tokens, username, listIdOrSlug, options); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter in the requested format. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="options">The options.</param> /// <returns>The 20 most recent favorite statuses</returns> public static TwitterResponse <TwitterStatusCollection> List(OAuthTokens tokens, ListFavoritesOptions options) { return(CommandPerformer.PerformAction( new Commands.ListFavoritesCommand(tokens, options))); }
/// <summary> /// Deletes the specified status. /// </summary> /// <param name="tokens">The oauth tokens.</param> /// <param name="id">The status id.</param> /// <param name="options">The options.</param> /// <returns> /// A <see cref="TwitterStatus"/> object of the deleted status. /// </returns> public static TwitterResponse <TwitterStatus> Delete(OAuthTokens tokens, decimal id, OptionalProperties options) { Commands.DeleteStatusCommand command = new Twitterizer.Commands.DeleteStatusCommand(tokens, id, options); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Returns the 20 most recent mentions (status containing @username) for the authenticating user. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="options">The options.</param> /// <returns>A <see cref="TwitterStatusCollection"/> instance.</returns> public static TwitterResponse <TwitterStatusCollection> Mentions(OAuthTokens tokens, TimelineOptions options) { Commands.MentionsCommand command = new Commands.MentionsCommand(tokens, options); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Retweets a tweet. Requires the id parameter of the tweet you are retweeting. (say that 5 times fast) /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="statusId">The status id.</param> /// <param name="options">The options.</param> /// <returns>A <see cref="TwitterStatus"/> representing the newly created tweet.</returns> public static TwitterResponse <TwitterStatus> Retweet(OAuthTokens tokens, decimal statusId, OptionalProperties options) { return(CommandPerformer.PerformAction( new Commands.RetweetCommand(tokens, statusId, options))); }
/// <summary> /// Allows the authenticating users to unfollow the user specified. /// </summary> /// <param name="tokens">The tokens.</param> /// <returns> /// Returns the unfollowed user in the requested format when successful. Returns a string describing the failure condition when unsuccessful. /// </returns> public TwitterResponse <TwitterUser> Delete(OAuthTokens tokens) { Commands.DeleteFriendshipCommand command = new Twitterizer.Commands.DeleteFriendshipCommand(tokens, this.Target.Id, string.Empty, null); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Shows Related Results of a tweet. Requires the id parameter of the tweet you are getting results for. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="statusId">The status id.</param> /// <param name="options">The options.</param> /// <returns>A <see cref="TwitterStatus"/> representing the newly created tweet.</returns> public static TwitterResponse <TwitterRelatedTweetsCollection> RelatedResultsShow(OAuthTokens tokens, decimal statusId, OptionalProperties options) { return(CommandPerformer.PerformAction( new Commands.RelatedResultsCommand(tokens, statusId, options))); }
/// <summary> /// Access the users in a given category of the Twitter suggested user list. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="categorySlug">The category slug.</param> /// <param name="options">The options.</param> /// <returns></returns> /// <remarks>It is recommended that end clients cache this data for no more than one hour.</remarks> public static TwitterResponse <TwitterUserCategory> SuggestedUsers(OAuthTokens tokens, string categorySlug, OptionalProperties options) { Commands.SuggestedUsersCommand command = new Commands.SuggestedUsersCommand(tokens, categorySlug, options); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Sets one or more hex values that control the color scheme of the authenticating user's profile page on twitter.com /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="options">The options.</param> /// <returns> /// The user, with updated data, as a <see cref="TwitterUser"/> /// </returns> public static TwitterResponse <TwitterUser> UpdateProfileColors(OAuthTokens tokens, UpdateProfileColorsOptions options) { Commands.UpdateProfileColorsCommand command = new Twitterizer.Commands.UpdateProfileColorsCommand(tokens, options); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Access to Twitter's suggested user list. This returns the list of suggested user categories. The category can be used in the users/suggestions/category endpoint to get the users in that category. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="options">The options.</param> /// <returns>A collection of categories without user data.</returns> public static TwitterResponse <TwitterUserCategoryCollection> SuggestedUserCategories(OAuthTokens tokens, OptionalProperties options) { Commands.SuggestedUserCategoriesCommand command = new Commands.SuggestedUserCategoriesCommand(tokens, options); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Creates the saved search specified in the query parameter as the authenticating user. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="query">The query.</param> /// <param name="options">The options.</param> /// <returns>The saved search when successful.</returns> public static TwitterResponse <TwitterSavedSearch> Create(OAuthTokens tokens, string query, OptionalProperties options) { return(CommandPerformer.PerformAction( new Commands.CreateSavedSearchCommand(tokens, query, options))); }
/// <summary> /// Retrieves a place based on the specified coordinates. /// </summary> /// <param name="latitude">The latitude.</param> /// <param name="longitude">The longitude.</param> /// <param name="options">The options.</param> /// <returns>A collection of matched <see cref="Twitterizer.TwitterPlace"/> items.</returns> public static TwitterResponse <TwitterPlaceCollection> Lookup(double latitude, double longitude, TwitterPlaceLookupOptions options) { Commands.ReverseGeocodeCommand command = new Twitterizer.Commands.ReverseGeocodeCommand(latitude, longitude, options); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Returns the the authenticating user's saved search queries in the requested format. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="options">The options.</param> /// <returns>The saved searches</returns> public static TwitterResponse <TwitterSavedSearchCollection> SavedSearches(OAuthTokens tokens, OptionalProperties options) { return(CommandPerformer.PerformAction( new Commands.SavedSearchesCommand(tokens, options))); }
/// <summary> /// Updates the authenticating user's status. A status update with text identical to the authenticating user's text identical to the authenticating user's current status will be ignored to prevent duplicates. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="text">The status text.</param> /// <param name="options">The options.</param> /// <returns> /// A <see cref="TwitterStatus"/> object of the newly created status. /// </returns> public static TwitterResponse <TwitterStatus> Update(OAuthTokens tokens, string text, StatusUpdateOptions options) { return(CommandPerformer.PerformAction(new Commands.UpdateStatusCommand(tokens, text, options))); }
/// <summary> /// Allows the authenticating users to follow the user specified in the userName parameter. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="userName">The user name.</param> /// <param name="options">The options.</param> /// <returns> /// Returns the followed user in the requested format when successful. /// </returns> public static TwitterResponse <TwitterUser> Create(OAuthTokens tokens, string userName, CreateFriendshipOptions options) { Commands.CreateFriendshipCommand command = new Commands.CreateFriendshipCommand(tokens, userName, options); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Updates the authenticating user's status. A status update with text identical to the authenticating user's text identical to the authenticating user's current status will be ignored to prevent duplicates. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="text">The status text.</param> /// <param name="fileData">The file to upload, as a byte array.</param> /// <param name="options">The options.</param> /// <returns> /// A <see cref="TwitterStatus"/> object of the newly created status. /// </returns> public static TwitterResponse <TwitterStatus> UpdateWithMedia(OAuthTokens tokens, string text, byte[] fileData, StatusUpdateOptions options = null) { return(CommandPerformer.PerformAction(new Commands.UpdateWithMediaCommand(tokens, text, fileData, options))); }
public static TwitterResponse <TwitterUserCollection> Friends(OAuthTokens tokens, FriendsOptions options) { Commands.FriendsCommand command = new Commands.FriendsCommand(tokens, options); return(CommandPerformer.PerformAction(command)); }
/// <summary> /// Allows the authenticating users to follow the user specified in the userName parameter. /// </summary> /// <param name="tokens">The tokens.</param> /// <param name="userName">The user name.</param> /// <param name="options">The options.</param> /// <returns> /// Returns the followed user in the requested format when successful. /// </returns> public static async Task <TwitterResponse <User> > CreateAsync(string userName, OAuthTokens tokens, CreateFriendshipOptions options) { return(await CommandPerformer.PerformAction(new Commands.CreateFriendshipCommand(tokens, userName, options))); }