Esempio n. 1
0
        /// <summary>
        /// List all mentioning tweets in a colection.
        /// </summary>
        /// <returns>String</returns>
        public static string getMentionsString()
        {
            StringBuilder aux = new StringBuilder();

            foreach (var item in Jarvis.getMentions())
            {
                aux.Append("\nAUTOR:" + item.Author.ScreenName + "\nTEXT: " + item.Text);
            }
            return(aux.ToString());
        }
Esempio n. 2
0
        /// <summary>
        /// This method get the list of Following Users IDs
        /// </summary>
        /// <returns></returns>
        public static List <long> getFollowingIds()
        {
            List <long> auxIds = new List <long>();

            foreach (var user in Jarvis.getFollowingUsers())
            {
                auxIds.Add(user.Id);
            }
            return(auxIds);
        }
Esempio n. 3
0
        /// <summary>
        /// Básicamente retorna la lista de usuarios que publicaron cosas en la Timeline (Generalmente la mayoría son Retweets por lo tanto son usuarios que no sigo.
        /// </summary>
        /// <returns>List of twitter users</returns>
        public static List <TwitterUser> getUsersToFollow()
        {
            Jarvis.auxUserList = new List <TwitterUser>();
            var collection = Jarvis.getTimeLine();

            foreach (var item in collection)
            {
                auxUserList.Add(item.User);
            }
            return(Jarvis.auxUserList);
        }
Esempio n. 4
0
        /// <summary>
        /// Obtains the list of users to follow
        /// </summary>
        /// <returns>List of twitter users</returns>
        public static List <long> getTimelineIds()
        {
            List <long> aux        = new List <long>();
            var         collection = Jarvis.getTimeLine(30);

            foreach (var post in collection)
            {
                if (post.RetweetedStatus != null)
                {
                    aux.Add(post.RetweetedStatus.User.Id);
                }
            }
            return(aux);
        }
Esempio n. 5
0
        /// <summary>
        /// This method return a String with de list of followers
        /// </summary>
        /// <returns></returns>
        public static string getFollowingString()
        {
            StringBuilder aux = new StringBuilder();

            Jarvis.getFollowingUsers();
            aux.Append("FOLLOWING\n");
            foreach (var follower in Jarvis.auxUserList)
            {
                aux.Append("NAME: " + follower.Name + " ID: " + follower.Id + " FOLLOWERS: " + follower.FollowersCount);
                aux.AppendLine("\n");
            }
            // Retornamos la colección.
            return(aux.ToString());
        }
Esempio n. 6
0
        /// <summary>
        /// This method GETS a collection of "Following" users and unfollow them if the user isnt in a Friendship
        /// </summary>
        /// <returns>JarvisResponse - This method returns a JarvisResponse Object with a Message and Counting info.</returns>
        public static JarvisResponse autoUnfollowNoFriendshipsUsers()
        {
            StringBuilder aux = new StringBuilder();

            Jarvis.jResponse = new JarvisResponse();
            jResponse.count  = 0;
            aux.AppendLine("Unfollowed Users:");
            // Collection with all followers.
            var colectionOfFollowers = Jarvis.getAllFollowingUsers();

            // Travel all collection

            // Append message footer.
            aux.AppendLine("Users: " + jResponse.count + "/" + colectionOfFollowers.Count);
            jResponse.message = aux.ToString();
            return(jResponse);
        }
Esempio n. 7
0
 private void timer_callBack(object state)
 {
     try
     {
         string nextPhrase = PhrasesManager.ObtainNextPhrase();
         DrawText(nextPhrase, new Font("Arial", 34), Color.Red, Color.Black);
         Jarvis.sendTweet(nextPhrase);
     }
     catch (Exception ex)
     {
         File.WriteAllText("log_process.err", ex.Message);
         MessageBox.Show("Error a la hora de obtener la nueva frase.");
     }
     finally
     {
         timer.Change(tiempoEspera, TimeSpan.Zero);
     }
 }
Esempio n. 8
0
        /// <summary>
        /// Like all timeline tweets.
        /// </summary>
        /// <returns>int Count of likes</returns>
        public static int autoLikeTimeline()
        {
            int count = 0;

            var collection = Jarvis.getTimeLine(20);

            foreach (var tweet in collection)
            {
                // En caso de que el Tweet en cuestión no esté Likeado, lo likeamos.
                if (tweet.IsFavorited == false)
                {
                    mainService.FavoriteTweet(new FavoriteTweetOptions {
                        Id = tweet.Id
                    });
                    // Aumentamos la cantidad de Likes dados en la instancia de procesamiento actual.
                    count++;
                }
            }
            return(count);
        }
Esempio n. 9
0
        /// <summary>
        /// Like all mentioning tweets.
        /// </summary>
        /// <returns>int Count of likes</returns>
        public static int autoLikeMentions()
        {
            int count = 0;

            // Recorremos la colecion de Menciones
            foreach (var tweet in Jarvis.getMentions())
            {
                // En caso de que el Tweet en cuestión no esté Likeado, lo likeamos.
                if (tweet.IsFavorited == false)
                {
                    mainService.FavoriteTweet(new FavoriteTweetOptions {
                        Id = tweet.Id
                    });
                    count++;
                }
            }

            Jarvis.likeCount += count;
            return(count);
        }