Exemple #1
0
        public static List <Person> getListMembers(AccountTwitter account, string username, string listNameOrId)
        {
            ListListMembersOptions    options = new TweetSharp.ListListMembersOptions();
            IEnumerable <TwitterUser> users;
            List <Person>             members = new List <Person>();

            options.OwnerScreenName = username;
            try
            {
                Int64 id = 0;
                if (Int64.TryParse(listNameOrId, out id))
                {
                    options.ListId = id;
                }
                IAsyncResult result = account.twitterService.BeginListListMembers(options);
                users = account.twitterService.EndListListMembers(result);

                if (users != null)
                {
                    foreach (TwitterUser user in users)
                    {
                        members.Add(TweetSharpConverter.getPersonFromUser(user, account));
                    }
                }
            }
            catch (Exception exp)
            {
                AppController.Current.sendNotification("ERROR", "Fetching list members failed", exp.Message, "", null);
            }

            return(members);
        }
Exemple #2
0
        public static void addSearchToAccount(AccountTwitter account, string query)
        {
            CreateSavedSearchOptions options = new TweetSharp.CreateSavedSearchOptions();

            options.Query = query;

            IAsyncResult       result      = account.twitterService.BeginCreateSavedSearch(options);
            TwitterSavedSearch savedSearch = account.twitterService.EndCreateSavedSearch(result);


            if (savedSearch != null)
            {
                account.addSearch(TweetSharpConverter.getSearchFromTwitterSavedSearch(account, savedSearch));
            }
        }