/// <summary> /// Retrieve public blogs. This corresponds to the blogs.getPublic Hyves method. /// </summary> /// <param name="sortType">The sort type.</param> /// <param name="timeSpan">The timespan to select from.</param> /// <returns>The information about the blogs; null if the call fails.</returns> public Collection <Blog> GetPublicBlogs(HyvesSortType sortType, HyvesTimeSpan timeSpan, HyvesBlogResponsefield responsefields, bool useFancyLayout) { if (sortType == HyvesSortType.NotSpecified) { throw new ArgumentOutOfRangeException("sortType"); } if (timeSpan == HyvesTimeSpan.NotSpecified) { throw new ArgumentOutOfRangeException("timeSpan"); } HyvesRequest request = new HyvesRequest(this.session); request.Parameters["sorttype"] = EnumHelper.GetDescription(sortType); request.Parameters["timespan"] = EnumHelper.GetDescription(timeSpan); request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields); HyvesResponse response = request.InvokeMethod(HyvesMethod.BlogsGetForFriends, useFancyLayout); if (response.Status == HyvesResponseStatus.Succeeded) { return(response.ProcessResponse <Blog>("blog")); } return(null); }
/// <summary> /// Gets the public media for the loggedin user. This corresponds to the /// media.getPublic Hyves method. /// </summary> /// <param name="sortType">The sorttype</param> /// <param name="mediaType">The media type of the results.</param> /// <param name="timeSpan">The timespan to select from.</param> /// <param name="responsefields">Get extra information from the media.</param> /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param> /// <param name="page">The requested page.</param> /// <param name="resultsPerPage">The number of results per page.</param> /// <returns>The information about the specified media; null if the call fails.</returns> public Collection<Media> GetPublic(HyvesSortType sortType, HyvesMediaType mediaType, HyvesTimeSpan timeSpan, HyvesMediaResponsefield responsefields, bool useFancyLayout, int page, int resultsPerPage) { if (sortType == HyvesSortType.NotSpecified) { throw new ArgumentOutOfRangeException("sortType"); } if (mediaType == HyvesMediaType.Unknown) { throw new ArgumentOutOfRangeException("mediaType"); } HyvesRequest request = new HyvesRequest(this.session); request.Parameters["sorttype"] = EnumHelper.GetDescription(sortType); request.Parameters["mediatype"] = EnumHelper.GetDescription(mediaType); if (timeSpan == HyvesTimeSpan.NotSpecified) { request.Parameters["timespan"] = EnumHelper.GetDescription(timeSpan); } request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields); HyvesResponse response = request.InvokeMethod(HyvesMethod.MediaGetPublic, useFancyLayout, page, resultsPerPage); if (response.Status == HyvesResponseStatus.Succeeded) { return response.ProcessResponse<Media>("media"); } return null; }
/// <summary> /// Retrieve public blogs. This corresponds to the blogs.getPublic Hyves method. /// </summary> /// <param name="sortType">The sort type.</param> /// <param name="timeSpan">The timespan to select from.</param> /// <returns>The information about the blogs; null if the call fails.</returns> public Collection<Blog> GetPublicBlogs(HyvesSortType sortType, HyvesTimeSpan timeSpan, HyvesBlogResponsefield responsefields, bool useFancyLayout) { if (sortType == HyvesSortType.NotSpecified) { throw new ArgumentOutOfRangeException("sortType"); } if (timeSpan == HyvesTimeSpan.NotSpecified) { throw new ArgumentOutOfRangeException("timeSpan"); } HyvesRequest request = new HyvesRequest(this.session); request.Parameters["sorttype"] = EnumHelper.GetDescription(sortType); request.Parameters["timespan"] = EnumHelper.GetDescription(timeSpan); request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields); HyvesResponse response = request.InvokeMethod(HyvesMethod.BlogsGetForFriends, useFancyLayout); if (response.Status == HyvesResponseStatus.Succeeded) { return response.ProcessResponse<Blog>("blog"); } return null; }
/// <summary> /// Gets the public media for the loggedin user. This corresponds to the /// media.getPublic Hyves method. /// </summary> /// <param name="sortType">The sorttype</param> /// <param name="mediaType">The media type of the results.</param> /// <param name="timeSpan">The timespan to select from.</param> /// <param name="responsefields">Get extra information from the media.</param> /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param> /// <param name="page">The requested page.</param> /// <param name="resultsPerPage">The number of results per page.</param> /// <returns>The information about the specified media; null if the call fails.</returns> public Collection <Media> GetPublic(HyvesSortType sortType, HyvesMediaType mediaType, HyvesTimeSpan timeSpan, HyvesMediaResponsefield responsefields, bool useFancyLayout, int page, int resultsPerPage) { if (sortType == HyvesSortType.NotSpecified) { throw new ArgumentOutOfRangeException("sortType"); } if (mediaType == HyvesMediaType.Unknown) { throw new ArgumentOutOfRangeException("mediaType"); } HyvesRequest request = new HyvesRequest(this.session); request.Parameters["sorttype"] = EnumHelper.GetDescription(sortType); request.Parameters["mediatype"] = EnumHelper.GetDescription(mediaType); if (timeSpan == HyvesTimeSpan.NotSpecified) { request.Parameters["timespan"] = EnumHelper.GetDescription(timeSpan); } request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields); HyvesResponse response = request.InvokeMethod(HyvesMethod.MediaGetPublic, useFancyLayout, page, resultsPerPage); if (response.Status == HyvesResponseStatus.Succeeded) { return(response.ProcessResponse <Media>("media")); } return(null); }