Ejemplo n.º 1
0
        public string GetSearch()
        {
            var           searchJson       = string.Empty;
            IAuthenticate authenticate     = new Authenticate();
            AuthResponse  twitAuthResponse = authenticate.AuthenticateMe(AuthenticateSettings);

            // Do the timeline
            var utility = new Utility();

            searchJson = utility.RequstJson(SearchSettings.SearchUrl, twitAuthResponse.TokenType, twitAuthResponse.AccessToken);

            return(searchJson);
        }
Ejemplo n.º 2
0
        public string GetSearch(string sinceId)
        {
            var           searchJson       = string.Empty;
            IAuthenticate authenticate     = new Authenticate();
            AuthResponse  twitAuthResponse = authenticate.AuthenticateMe(AuthenticateSettings);

            // Do the search
            var utility = new Utility();

            searchJson = utility.RequstJson($"{SearchSettings.SearchUrl}&since_id={sinceId}", twitAuthResponse.TokenType, twitAuthResponse.AccessToken);

            return(searchJson);
        }
Ejemplo n.º 3
0
        public string GetMyTimeline()
        {
            var           timeLineJson     = string.Empty;
            IAuthenticate authenticate     = new Authenticate();
            AuthResponse  twitAuthResponse = authenticate.AuthenticateMe(AuthenticateSettings);

            // Do the timeline
            var utility = new Utility();

            timeLineJson = utility.RequstJson(TimeLineSettings.TimelineUrl, twitAuthResponse.TokenType, twitAuthResponse.AccessToken);

            return(timeLineJson);
        }
        public string GetSearch(OAuthData oAuthData)
        {
            var searchJson   = string.Empty;
            var authenticate = new Authenticate();
            TwitAuthenticateResponse twitAuthResponse = authenticate.AuthenticateMe(oAuthData.OAuthConsumerKey, oAuthData.OAuthConsumerSecret, OAuthUrl);

            // Do the timeline
            var utility = new Utility();

            searchJson = utility.RequstJson(searchUrl, twitAuthResponse.token_type, twitAuthResponse.access_token);

            return(searchJson);
        }
        public TwitterData GetMyTimeline(string url, OAuthData oAuthData)
        {
            timelineUrl = url;
            var authenticate = new Authenticate();
            TwitAuthenticateResponse twitAuthResponse = authenticate.AuthenticateMe(oAuthData.OAuthConsumerKey, oAuthData.OAuthConsumerSecret, OAuthUrl);

            // Do the timeline
            var timeLineJson = new Utility().RequstJson(timelineUrl, twitAuthResponse.token_type, twitAuthResponse.access_token);

            TwitterData response = new TwitterData();

            response.xmls = new List <XmlDocument>();

            if (timeLineJson.StartsWith("Error:"))
            {
                response.error = timeLineJson;
                return(response);
            }

            //List<XmlDocument> xmls = new List<XmlDocument>();

            if (timeLineJson == string.Empty || timeLineJson == "[]")
            {
                return(response);
            }

            timeLineJson = timeLineJson.Substring(3, timeLineJson.Length - 6);
            var timeLines = timeLineJson.Split(new [] { "\"},{\"" }, System.StringSplitOptions.None);

            try
            {
                foreach (string line in timeLines)
                {
                    response.xmls.Add(JsonConvert.DeserializeXmlNode("{\"root\":[{\"" + line + "\"}]}"));
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }


            return(response);
        }
        public string GetSearch()
        {
            var searchJson = string.Empty;
            IAuthenticate authenticate = new Authenticate();
            AuthResponse twitAuthResponse = authenticate.AuthenticateMe(AuthenticateSettings);

            // Do the timeline
            var utility = new Utility();
            searchJson = utility.RequstJson(SearchSettings.SearchUrl, twitAuthResponse.TokenType, twitAuthResponse.AccessToken);

            return searchJson;
        }
        public string GetMyTimeline()
        {
            var timeLineJson = string.Empty;
            IAuthenticate authenticate = new Authenticate();
            AuthResponse twitAuthResponse = authenticate.AuthenticateMe(AuthenticateSettings);

            // Do the timeline
            var utility = new Utility();
            timeLineJson = utility.RequstJson(TimeLineSettings.TimelineUrl, twitAuthResponse.TokenType, twitAuthResponse.AccessToken);

            return timeLineJson;
        }