Exemple #1
0
 public FollowStream(ConsumerData consumer,AccessTokenData token,User user)
     :base(consumer,token,user,TwitterUrl.FilterStreamingUrl+"?follow="+user.id_str)
 {
     GetStreamMe += async (e) => { };
     GetStreamMention += async (e) => { };
     GetStreamRetweet += async (e) => { };
     GetStreamDelete += async (e) => { };
     GetStreamRetweeted += async (e) => { };
 }
        public TwitterClientBase(ConsumerData consumerData,AccessTokenData token)
        {
            this.consumerData = consumerData;

            this.accessToken = token;
            httpClient = OAuthUtility.CreateOAuthClient(ConsumerData.ConsumerKey, ConsumerData.ConsumerSecret,new AccessToken(AccessToken.AccessToken,AccessToken.TokenSecret));

            httpClient.Timeout = System.Threading.Timeout.InfiniteTimeSpan;
        }
        public async Task<string> BeginAuthorizedAsync(ConsumerData data)
        {
            authorizer = new OAuthAuthorizer(data.ConsumerKey,data.ConsumerSecret);

             var tokenResponse = await authorizer.GetRequestToken(TwitterUrl.GetRequestTokenUrl);
             requestToken = tokenResponse.Token;
            
            var pinRequestUrl = authorizer.BuildAuthorizeUrl(TwitterUrl.AuthorizeUrl, requestToken);
            return pinRequestUrl;
        }
 public TwitterStreamBase(ConsumerData consumerData,AccessTokenData token,User user,string streamingUrl)
     :base(consumerData,token)
 {
    
     this.UserInformation = user;
     this.streamingUrl = streamingUrl;
     ConnectEndFlag = false;
     ChangeStreamEvent += (state) => { };
     OnStreamError += e => { };
     StreamState = StreamState.DisConnect;
 }
Exemple #5
0
 public UserStream(ConsumerData consumerData,AccessTokenData token,User user)
     :base(consumerData,token,user,TwitterUrl.UserStreamingUrl)
 {
     
 }
Exemple #6
0
 public NeuroniaModel(CoreDispatcher dispatcher, ConsumerData consumerData)
 {
     SharedDispatcher.Dispatcher = dispatcher;
     twitterUIComponent = new TwitterUIComponent();
     accountList = new ObservableCollection<TwitterAccount>();
     TimelineListTab = new ObservableCollection<TimelineTab>();
     NowTimelineList = new ObservableCollection<TimelineBase>();
     SearchDetail = new SearchDetail();
     Setting = new SettingData();
     TweetDetail = new TweetDetail(new TimelineRow(Tweet.ZeroTweet,"",Setting,CallRowAction));
     DMDetail = new DirectMessageDetail();
     UserDetail = new UserDetail();
     NotifyMessage = new NotificationMessage();
     IsFirstNavigate = true;
     this.consumerData = consumerData;
     this.connectionStatusStr = "";
     Authorizer = new TwitterAuthorizer();
     restTimerCounter = 0;
     LicenseInfo = CurrentApp.LicenseInformation;
    
     RestTimer = new DispatcherTimer();
     RestTimer.Interval = TimeSpan.FromMinutes(1);
     RestTimer.Tick += (s, e) => Task.Run(async() =>
     {
         await SharedDispatcher.RunAsync(() =>
         {
             NowTime = DateTime.Now;
             NowTimeStr = NowTime.ToString("HH:mm");
         });
         
         if (restTimerCounter%2 == 0)
         {
             foreach (var tab in TimelineListTab)
             {
                 foreach (var t in tab.TimelineList)
                 {
                     await t.RestUpdate();
                 }
             }
         }
         if (restTimerCounter%10 == 0)
         {
             TwitterUIComponent.MentionSuggestSourceList.Clear();
             TwitterUIComponent.HashSuggestSourceList.Clear();
             foreach (var tab in TimelineListTab)
             {
                 foreach (var t in tab.TimelineList)
                 {
                     foreach (var ac in (await t.GetTimelineAccountListAsync()))
                     {
                         TwitterUIComponent.MentionSuggestSourceList.Add(ac);
                     }
                     foreach (var ac in (await t.GetTimelineHashTagListAsync()))
                     {
                         TwitterUIComponent.HashSuggestSourceList.Add(ac);
                     }
                 }
             }
         }
         restTimerCounter++;
         if (restTimerCounter > 100)
         {
             restTimerCounter = 0;
         }
         
     });
     RestTimer.Start();
     
     timelineWidth = 320;
     IsFirstLaunch = true;
     if (LicenseInfo.ProductLicenses["ApplicationTheme"].IsActive)
     {
         IsPurchase = true;
     }
     else
     {
         IsPurchase = false;
     }
     
 }
Exemple #7
0
 public TrackStream(ConsumerData consumerData,AccessTokenData token,User user,string trackKeyword)
     : base(consumerData,token,user, TwitterUrl.FilterStreamingUrl + "?track=" + Uri.EscapeDataString(trackKeyword))
 {
     this.trackKeyword = trackKeyword;
     GetStreamTrack += async(e) => { };
 }