internal static TrendingItemViewModel FromTrend(TweetSharp.ITwitterModel item)
 {
     var trend = item as TwitterTrend;
     return new TrendingItemViewModel()
     {
         Title = trend.Name
     };
 }
 string buildTweetString(TweetSharp.TwitterStatus tweet)
 {
     return
         String.Format("{0}", tweet.CreatedDate) +
         Environment.NewLine +
         String.Format("{0} tweeted:", tweet.User.ScreenName) +
         Environment.NewLine +
         tweet.Text +
         Environment.NewLine + Environment.NewLine;
 }
Esempio n. 3
0
        private void ReceiveTrends(TweetSharp.TwitterTrends Trends, TweetSharp.TwitterResponse Response)
        {
            IsLoading = false;
            if (Response.StatusCode != HttpStatusCode.OK)
            {
                MessageService.ShowError(Localization.Resources.ErrorLoadingTT);
                GoBack();
            }

            Collection = Trends;
        }
Esempio n. 4
0
 private NTLIB.TwitterUser ConvertUser(TweetSharp.TwitterUser suser)
 {
     NTLIB.TwitterUser user = new TwitterUser();
     if (suser == null) return user;
     user.ContributorsEnabled = suser.ContributorsEnabled;
     user.CreatedDate = suser.CreatedDate;
     user.DefaultProfile = suser.IsDefaultProfile;
     user.Description = suser.Description;
     user.FavouritesCount = suser.FavouritesCount;
     user.FollowersCount = suser.FollowersCount;
     user.FollowRequestSent = suser.FollowRequestSent;
     user.FriendsCount = suser.FriendsCount;
     user.Id = suser.Id;
     user.IsGeoEnabled = suser.IsGeoEnabled;
     user.IsProfileBackgroundTiled = suser.IsProfileBackgroundTiled;
     user.IsProtected = suser.IsProtected;
     user.IsTranslator = suser.IsTranslator;
     user.IsVerified = suser.IsVerified;
     user.Language = suser.Language;
     user.ListedCount = suser.ListedCount;
     user.Location = suser.Location;
     user.Name = suser.Name;
     user.ProfileBackgroundColor = suser.ProfileBackgroundColor;
     user.ProfileBackgroundImageUrl = suser.ProfileBackgroundImageUrl;
     user.ProfileBackgroundImageUrlHttps = suser.ProfileBackgroundImageUrlHttps;
     user.ProfileImageUrl = suser.ProfileImageUrl;
     user.ProfileImageUrlHttps = suser.ProfileImageUrlHttps;
     user.ProfileLinkColor = suser.ProfileLinkColor;
     user.ProfileSidebarBorderColor = suser.ProfileSidebarBorderColor;
     user.ProfileSidebarFillColor = suser.ProfileSidebarFillColor;
     user.ProfileTextColor = suser.ProfileTextColor;
     user.ScreenName = suser.ScreenName;
     user.Status = ConvertResult(suser.Status);
     user.StatusesCount = suser.StatusesCount;
     user.TimeZone = suser.TimeZone;
     user.Url = suser.Url;
     user.UtcOffset = suser.UtcOffset;
     return user;
 }
 public Uri GetAuthorizationUri(TweetSharp.OAuthRequestToken token)
 {
     var ret = new Uri("/Account/AuthorizeCallback?oauth_token=" + Guid.NewGuid().ToString() + "&oauth_verifier=" + Guid.NewGuid().ToString(), UriKind.Relative);
     return ret;
 }
 public TweetSharp.OAuthAccessToken GetAccessToken(TweetSharp.OAuthRequestToken token, string verifier)
 {
     return new OAuthAccessToken() { ScreenName = LOCAL_USER_NAME, Token = Guid.NewGuid().ToString(), TokenSecret = Guid.NewGuid().ToString() };
 }
Esempio n. 7
0
        internal static TweetViewModel FromTwitterStatus(TweetSharp.TwitterStatus item)
        {
            int id = item.User.Id;
            /*
            if (item.Entities != null && item.Entities.HashTags.Count > 0)
            {
                ViewModelLocator.Instance.SearchResults.AddItem(item);
            }
            */
            string source = item.Source;
            if (source.Contains("<"))
            {
                source = source.Substring(source.IndexOf(">") + 1);
                source = source.Substring(0, source.IndexOf("<"));
            }

            var vm = new TweetViewModel()
            {
                Username = item.User.ScreenName,
                Message = item.Text,
                ProfilePhotoURL = item.User.ProfileImageUrl,
                ID = item.Id,
                AppName = source,
                AppPicURL = item.Author.ProfileImageUrl,
                RealName = item.User.Name,
                DateTime = item.CreatedDate,
                UserId = item.User.Id
            };

            return vm;
        }