Exemplo n.º 1
0
 public TwitterUser(Tweetinvi.Models.IUser user)
 {
     Id          = user.Id;
     Name        = user.ScreenName;
     DisplayName = user.Name;
     Url         = user.Url;
 }
Exemplo n.º 2
0
 public cTweet(long vId, string vText, DateTime vCreatedAt, Tweetinvi.Models.IUser vCreatedBy, long?vReplyToStatusID)
 {
     id              = vId;
     text            = vText;
     createdAt       = vCreatedAt;
     createdBy       = vCreatedBy;
     replyToStatusID = vReplyToStatusID;
 }
Exemplo n.º 3
0
 public static string GetLatestTweet(BotInstance BotInstance)
 {
     try
     {
         Auth.SetUserCredentials(
             BotInstance.LoginConfig["Twitter"]["ConsumerKey"].ToString(),
             BotInstance.LoginConfig["Twitter"]["ConsumerSecret"].ToString(),
             BotInstance.LoginConfig["Twitter"]["AccessToken"].ToString(),
             BotInstance.LoginConfig["Twitter"]["AccessSecret"].ToString()
             );
         Tweetinvi.Models.IUser  TwitterUser      = User.GetUserFromScreenName("TheHarbonator");
         Tweetinvi.Models.ITweet UsersLatestTweet = TwitterUser.GetUserTimeline(1).Last();
         return(UsersLatestTweet.Url);
     }
     catch { return("!Was Unable To Find URL!"); }
 }
Exemplo n.º 4
0
        public User Map(Tweetinvi.Models.IUser from, User to)
        {
            to.Id              = from.IdStr;
            to.Name            = from.Name;
            to.Description     = from.Description;
            to.ProfileImageUrl = from.ProfileImageUrl;

            if (to.ProfileImageUrl != null)
            {
                to.ProfileImageUrl = to.ProfileImageUrl
                                     .Replace("_normal", "_bigger");
            }

            to.ProfileBackgroundColor = from.ProfileBackgroundColor;
            to.ProfileBannerUrl       = from.ProfileBannerURL;
            to.FollowersCount         = from.FollowersCount;
            to.StatusesCount          = from.StatusesCount;
            to.FriendsCount           = from.FriendsCount;
            to.ScreenName             = from.ScreenName;
            to.Verified = from.Verified;

            return(to);
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                PrintHelp();
                Environment.Exit(0);
            }

            int max_result = 35;

            if (args.Length == 1)
            {
                PrintLogo();
            }

            if (args.Length == 2)
            {
                if (Int32.TryParse(args[1], out int max) && max <= 70)
                {
                    max_result = max;
                    PrintLogo();
                }
                else
                {
                    Console.WriteLine("The second argument has to be an integer and have a value lesser than 70."); Environment.Exit(0);
                }
            }

            Auth.SetUserCredentials(
                "qpHCXcV4IEap3T02zJHi234Ev",
                "zjSizlzsC9YmN9qm1BTheXF4delq1CwALA7fBnykBtLCaMb946",
                "316723929-0zRG0RzpDYRwMTw3UvgUu37wni0PHKJBU9IL5BKQ",
                "cCJN2wIPubXBsNCBbVTRXzelIp9vHRXh9Jur5bF9SG52i"
                );

            void PrintLogo()
            {
                Console.WriteLine("       _____      _   _                     _   _             ");
                Console.WriteLine("      / ____|    | | | |                   | | (_)            ");
                Console.WriteLine("     | |  __  ___| |_| |     ___   ___ __ _| |_ _  ___  _ __  ");
                Console.WriteLine(@"     | | |_ |/ _ \ __| |    / _ \ / __/ _` | __| |/ _ \| '_ \ ");
                Console.WriteLine("     | |__| |  __/ |_| |___| (_) | (_| (_| | |_| | (_) | | | |");
                Console.WriteLine(@"      \_____|\___|\__|______\___/_\___\__,_|\__|_|\___/|_| |_|");
                Console.WriteLine("                   |__   __|     (_) | | |                     ");
                Console.WriteLine("                      | |_      ___| |_| |_ ___ _ __           ");
                Console.WriteLine(@"                      | \ \ /\ / / | __| __/ _ \ '__|          ");
                Console.WriteLine(@"                      | |\ V  V /| | |_| ||  __/ |             ");
                Console.WriteLine(@"                      |_| \_/\_/ |_|\__|\__\___|_|             ");
                Console.WriteLine(@"                                                               ");
                Console.WriteLine(@"                           [+] [email protected]        ");
                Console.WriteLine(@"                           [+] Created by Sharki.       ");
            }

            void PrintHelp() => Console.WriteLine("Invalid username. Usage: [ProgramName.exe] + Target's username (@Example/example) to track. [Optional: (Integer) Maximum number of searches allowed < 70]");

            string findLocation(List <string> locations)
            {
                IEnumerable <dynamic> query = locations.GroupBy(r => r)
                                              .Select(grp => new
                {
                    Location = grp.Key,
                    Count    = grp.Count()
                });

                int n = 0;

                foreach (var Q in query)
                {
                    if (Q.Count > n)
                    {
                        n = Q.Count;
                    }
                }

                return(query.Where(x => x.Count == n).First().Location);
            }

            Tweetinvi.Models.IUser User = Tweetinvi.User.GetUserFromScreenName(args[0]);

            if (User == null)
            {
                Console.WriteLine("This twitter's account doesn't exist or the rate limit has been reached");
                Environment.Exit(0);
            }

            IEnumerable <long> People              = User.FollowersCount < User.FriendsCount ? User.GetFollowerIds() : User.GetFriendIds();
            List <string>      Location_firstlist  = new List <string>();
            List <string>      Location_secondlist = new List <string>();

            int count = 0;

            foreach (long person in People.Reverse())
            {
                var Relation = Friendship.GetRelationshipDetailsBetween(person, User.UserIdentifier);

                if (Relation == null)
                {
                    Console.WriteLine("Exception"); break;
                }
                if (Relation.Following && Relation.FollowedBy)
                {
                    var      person_  = Tweetinvi.User.GetUserFromId(person);
                    string[] Location = person_.Location.Split(',', '-');

                    if (Location[0] != "" && Location[0] != "??")
                    {
                        Location_firstlist.Add(Location[0]);
                        try { Location_secondlist.Add(Location[1]); } catch { };
                        count++;
                        Console.WriteLine("[+] ---> " + person_.ScreenName);
                    }
                    else
                    {
                        Console.WriteLine("[-] ---> " + person_.ScreenName);
                    }
                }
                if (count > max_result)
                {
                    break;
                }
            }

            Console.WriteLine("\nProbable location based on target's followers/follows {0}", findLocation(Location_firstlist));
            Console.WriteLine("Probable zone/country based on target's followers/follows{0}", findLocation(Location_secondlist));

            if (!String.IsNullOrEmpty(User.Location))
            {
                Console.WriteLine("User's set location: {0}", User.Location);
            }
        }