コード例 #1
0
        private AdferoFeed GetFeed(int id, string[] properties, string[] fields)
        {
            string uri = this.GetUri(id, null, "xml", properties, fields, null, null);

            uri = string.Format("http://{0}:{1}@{2}", this.credentials.PublicKey, this.credentials.SecretKey, uri.Replace("http://", string.Empty));
            string xml = AdferoHelpers.GetXmlFromUri(uri);

            return(this.GetFeedFromXmlString(xml));
        }
コード例 #2
0
        private AdferoCategoryList ListCategoriesForArticle(int articleId, int offset, int limit, string[] properties, string[] fields)
        {
            string uri = this.GetUri(articleId, "articleId", "xml", properties, fields, offset, limit);

            uri = string.Format("http://{0}:{1}@{2}", this.credentials.PublicKey, this.credentials.SecretKey, uri.Replace("http://", string.Empty));
            string xml = AdferoHelpers.GetXmlFromUri(uri);

            AdferoCategoryList categories = this.ListCategoriesFromXmlString(xml);

            categories.Limit  = limit;
            categories.Offset = offset;

            return(categories);
        }
コード例 #3
0
        private AdferoFeedList ListFeedsForFeed(int offset, int limit, string[] properties, string[] fields)
        {
            string uri = this.GetUri(null, null, "xml", properties, fields, offset, limit);

            uri = string.Format("http://{0}:{1}@{2}", this.credentials.PublicKey, this.credentials.SecretKey, uri.Replace("http://", string.Empty));
            string xml = AdferoHelpers.GetXmlFromUri(uri);

            AdferoFeedList feeds = this.ListFeedsFromXmlString(xml);

            feeds.Limit  = limit;
            feeds.Offset = offset;

            return(feeds);
        }
コード例 #4
0
        private AdferoArticleList ListArticlesForBrief(int briefId, int offset, int limit, string state, string[] properties, string[] fields)
        {
            string uri = this.GetUri(briefId, "briefId", "xml", properties, fields, offset, limit);

            uri = string.Format("http://{0}:{1}@{2}", this.credentials.PublicKey, this.credentials.SecretKey, uri.Replace("http://", string.Empty));
            string xml = AdferoHelpers.GetXmlFromUri(string.Format("{0}&state={1}", uri, state));

            AdferoArticleList articles = this.ListArticlesFromXmlString(xml);

            articles.Limit  = limit;
            articles.Offset = offset;

            return(articles);
        }
コード例 #5
0
        private string ListFeedsForFeedRaw(int offset, int limit, string[] properties, string[] fields, string format)
        {
            string uri = string.Empty;

            switch (format)
            {
            case "xml":
                uri = this.GetUri(null, null, "xml", properties, fields, offset, limit);
                break;

            case "json":
                uri = this.GetUri(null, null, "json", properties, fields, offset, limit);
                break;

            default:
                throw new ArgumentException(string.Format("{0} format not supported", format));
            }

            uri = string.Format("http://{0}:{1}@{2}", this.credentials.PublicKey, this.credentials.SecretKey, uri.Replace("http://", string.Empty));
            return(AdferoHelpers.GetRawResponse(uri));
        }