Esempio n. 1
0
        public MediaItemList GetFeaturedMedia()
        {
            string relativePath = GenerateRelativeFeaturedUrl();

            QueryParameterList paramaters = new QueryParameterList();

            paramaters.Add(new QueryParameter(_format, "xml"));

            string getFeaturedMediaUrl = OAuth.GenerateURL(_apiUrl, relativePath, _featuredMediaMethod, Token, paramaters);

            XmlResponseMessage getFeaturedMediaResponseMessage = GetXmlResponseMessageFromUrl(getFeaturedMediaUrl, _featuredMediaMethod);

            return(MediaItemList.CreateFromXmlResponseMessage(getFeaturedMediaResponseMessage));
        }
Esempio n. 2
0
        public MediaItemList SearchMedia(string query, int num, int perpage, int page, int offset, int secondaryperpage, string type, bool recentFirst)
        {
            string relativePath = GenerateRelativeSearchUrl(query);

            QueryParameterList paramaters = new QueryParameterList();

            paramaters.Add(new QueryParameter(_format, "xml"));
            paramaters.Add(new QueryParameter(_num, num.ToString()));
            paramaters.Add(new QueryParameter(_perpage, perpage.ToString()));
            paramaters.Add(new QueryParameter(_page, page.ToString()));
            paramaters.Add(new QueryParameter(_offset, offset.ToString()));
            paramaters.Add(new QueryParameter(_secondaryperpage, secondaryperpage.ToString()));
            paramaters.Add(new QueryParameter(_type, type));
            paramaters.Add(new QueryParameter(_recentfirst, recentFirst ? "1" : "0"));

            string searchMediaUrl = OAuth.GenerateURL(_apiUrl, relativePath, _searchMediaMethod, Token, paramaters);

            XmlResponseMessage searchMediaResponseMessage = GetXmlResponseMessageFromUrl(searchMediaUrl, _searchMediaMethod);

            return(MediaItemList.CreateFromXmlResponseMessage(searchMediaResponseMessage));
        }