示例#1
0
        /// <summary>
        /// Return all Marketplace listings either by listing ID or by user.
        /// </summary>
        /// /// <param name="uids">Filter by a list of users. If you leave this blank, then the list is filtered only for listing IDs.</param>
        /// <param name="listing_ids">Filter by listing IDs. If you leave this blank, then the list is filtered only for user IDs.</param>
        /// <returns>This method returns all visible listings matching the criteria given. If no matching listings are found, the method returns an empty element.</returns>
        public IList <listing> getListings(List <long> listing_ids, Collection <string> uids)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.marketplace.getListings" }
            };

            _api.AddList(parameterList, "listing_ids", listing_ids);
            _api.AddCollection(parameterList, "uids", uids);

            var response = _api.SendRequest(parameterList);

            return(!string.IsNullOrEmpty(response) ? marketplace_getListings_response.Parse(response).listing : null);
        }
示例#2
0
文件: feed.cs 项目: wsgan001/asegrp
        /// <summary>
        /// Publishes a Mini-Feed story to the user corresponding to the session_key parameter, and publishes News Feed stories to the friends of that user who have added the application.
        /// </summary>
        /// <param name="title_template">The templatized markup displayed in the feed story's title section. This template must contain the token {actor} somewhere in it.</param>
        /// <param name="title_data">Optional - A JSON-encoded associative array of the values that should be substituted into the templates in the title_template markup string. The keys of this array are the tokens, and their associated values are the desired substitutions. 'actor' and 'target' are special tokens and should not be included in this array. If your title_template contains tokens besides 'actor' and 'target', then this is a required parameter.</param>
        /// <param name="body_template">Optional - The markup displayed in the feed story's body section.</param>
        /// <param name="body_data">Optional - A JSON-encoded associative array of the values that should be substituted into the templates in the body_template markup string. The keys of this array are the tokens, and their associated values are the desired substitutions. 'actor' and 'target' are special token and should not be included in this array.</param>
        /// <param name="body_general">Optional - Additional markup displayed in the feed story's body section. This markup is not required to be identical for two stories to be aggregated. One of the two will be chosen at random.</param>
        /// <param name="page_actor_id">Optional - if publishing a story to a Facebook Page, use this parameter as the page who performed the action. If you use this parameter, the application must be added to that Page's Feed. A session key is not required to do this.</param>
        /// <param name="images"></param>
        /// <param name="target_ids"></param>
        /// <returns></returns>
        public bool publishTemplatizedAction(string title_template, Dictionary <string, string> title_data,
                                             string body_template, Dictionary <string, string> body_data,
                                             string body_general, int page_actor_id,
                                             Collection <feed_image> images, Collection <string> target_ids)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.feed.publishTemplatizedAction" }
            };

            _api.AddRequiredParameter(parameterList, "title_template", title_template);
            _api.AddOptionalParameter(parameterList, "page_actor_id", page_actor_id);
            _api.AddJSONAssociativeArray(parameterList, "title_data", title_data);
            _api.AddJSONAssociativeArray(parameterList, "body_data", body_data);
            _api.AddOptionalParameter(parameterList, "body_template", body_template);
            _api.AddOptionalParameter(parameterList, "body_general", body_general);
            _api.AddCollection(parameterList, "target_ids", target_ids);
            AddFeedImages(parameterList, images);

            var response = _api.SendRequest(parameterList);

            return(string.IsNullOrEmpty(response) || feed_publishTemplatizedAction_response.Parse(response).TypedValue);
        }