예제 #1
0
            public static Tuple <List<Post>,ApiCallResponse> getUnifiedStream(string access_token, ParametersMyStream parameter = null)
            {
                ApiCallResponse apiCallResponse = new ApiCallResponse();
                try
                {
                    if (string.IsNullOrEmpty(access_token))
                    {
                        apiCallResponse.success = false;
                        apiCallResponse.errorMessage = "Missing parameter access_token";
                        return new Tuple<List<Post>, ApiCallResponse>(new List<Post>(), apiCallResponse);
                    }
                    string requestUrl = Common.baseUrl + "/stream/0/posts/stream/unified";
                    if(parameter != null) {
                        requestUrl = requestUrl + "?" + parameter.getQueryString();
                    }
                    Dictionary<string, string> headers = new Dictionary<string, string>();
                    headers.Add("Authorization", "Bearer " + access_token);
                    Helper.Response response = Helper.SendGetRequest(requestUrl, headers);

                    return Helper.getData<List<Post>>(response);
                }
                catch (Exception exp)
                {
                    apiCallResponse = new ApiCallResponse();
                    apiCallResponse.success = false;
                    apiCallResponse.errorMessage = exp.Message;
                    apiCallResponse.errorDescription = exp.StackTrace;
                } 
                return new Tuple<List<Post>, ApiCallResponse>(new List<Post>(), apiCallResponse);
            }
예제 #2
0
        private void buttonGetPersonalStream_Click_1(object sender, RoutedEventArgs e)
        {
            Tuple<List<Post>, ApiCallResponse> streamItems;
            ParametersMyStream parameters = new ParametersMyStream();
            parameters.count = 100;
            parameters.include_annotations = true;

            streamItems = AppNetDotNet.ApiCalls.SimpleStreams.getUserStream(textboxAccessToken.Text,parameters);
            Console.WriteLine(streamItems.ToString());
        }
예제 #3
0
        public static Tuple <List <Post>, ApiCallResponse> getUnifiedStream(string access_token, ParametersMyStream parameter = null)
        {
            ApiCallResponse apiCallResponse = new ApiCallResponse();

            try
            {
                if (string.IsNullOrEmpty(access_token))
                {
                    apiCallResponse.success      = false;
                    apiCallResponse.errorMessage = "Missing parameter access_token";
                    return(new Tuple <List <Post>, ApiCallResponse>(new List <Post>(), apiCallResponse));
                }
                string requestUrl = Common.baseUrl + "/posts/streams/unified";
                if (parameter != null)
                {
                    requestUrl = requestUrl + "?" + parameter.getQueryString();
                }
                Dictionary <string, string> headers = new Dictionary <string, string>();
                headers.Add("Authorization", "Bearer " + access_token);
                Helper.Response response = Helper.SendGetRequest(requestUrl, headers);

                return(Helper.getData <List <Post> >(response));
            }
            catch (Exception exp)
            {
                apiCallResponse                  = new ApiCallResponse();
                apiCallResponse.success          = false;
                apiCallResponse.errorMessage     = exp.Message;
                apiCallResponse.errorDescription = exp.StackTrace;
            }
            return(new Tuple <List <Post>, ApiCallResponse>(new List <Post>(), apiCallResponse));
        }