Inheritance: IFlickrParsable
Exemplo n.º 1
0
        private ActivityItem[] ActivityUserPhotos(string timeframe)
        {
            Hashtable parameters = new Hashtable();
            parameters.Add("method", "flickr.activity.userPhotos");
            if( timeframe != null && timeframe.Length > 0 ) parameters.Add("timeframe", timeframe);

            FlickrNet.Response response = GetResponseNoCache(parameters);
            if( response.Status == ResponseStatus.OK )
            {
                XmlNodeList list = response.AllElements[0].SelectNodes("item");
                ActivityItem[] items = new ActivityItem[list.Count];
                for(int i = 0; i < items.Length; i++)
                {
                    items[i] = new ActivityItem(list[i]);
                }
                return items;
            }
            else
            {
                throw new FlickrException(response.Error);
            }
        }
Exemplo n.º 2
0
		/// <summary>
		/// Returns a list of recent activity on photos commented on by the calling user.
		/// </summary>
		/// <remarks>
		/// <b>Do not poll this method more than once an hour.</b>
		/// </remarks>
		/// <returns></returns>
		public ActivityItem[] ActivityUserComments(int page, int perPage)
		{
			Hashtable parameters = new Hashtable();
			parameters.Add("method", "flickr.activity.userComments");
			if( page > 0 ) parameters.Add("page", page);
			if( perPage > 0 ) parameters.Add("per_page", perPage);

			FlickrNet.Response response = GetResponseCache(parameters);
			if( response.Status == ResponseStatus.OK )
			{
				XmlNodeList list = response.AllElements[0].SelectNodes("item");
				ActivityItem[] items = new ActivityItem[list.Count];
				for(int i = 0; i < items.Length; i++)
				{
					items[i] = new ActivityItem(list[i]);
				}
				return items;
			}
			else
			{
				throw new FlickrApiException(response.Error);
			}
		}