コード例 #1
0
        public void Data_Mining_friends()
        {
            var miner      = new SnooperFacebookMining(true);
            var friendlist = miner.GetFriendlist("vaclav.miculka");

            miner.QuitMining();
            Assert.GreaterOrEqual(friendlist.Friends.Count, 200);
        }
コード例 #2
0
        public void Data_Mining_public_info()
        {
            var miner      = new SnooperFacebookMining(false);
            var publicInfo = miner.GetFacebookPublicInfo("bruckner.tomas");

            Assert.AreEqual(publicInfo.Gender, "male");
            Assert.AreEqual(publicInfo.Username, "bruckner.tomas");
            Assert.AreEqual(publicInfo.Id, 765374730);
        }
コード例 #3
0
        public void Data_Mining_albums()
        {
            var miner  = new SnooperFacebookMining(true);
            var albums = miner.ParseAlbums("socker01");

            miner.QuitMining();
            foreach (var album in albums)
            {
                Console.WriteLine(album.Name);
            }
        }
コード例 #4
0
        public void Data_Mining_upcoming_events()
        {
            var miner    = new SnooperFacebookMining(true);
            var fbEvents = miner.GetUpcomingEvents("socker01");

            miner.QuitMining();
            foreach (var fbEvent in fbEvents)
            {
                Console.WriteLine(fbEvent.Name);
            }
        }
コード例 #5
0
        public void Data_Mining_recent_places()
        {
            var miner        = new SnooperFacebookMining(true);
            var recentPlaces = miner.GetRecentPlaces("socker01");

            miner.QuitMining();
            Console.WriteLine(@"Test");
            foreach (var recentPlace in recentPlaces)
            {
                Console.WriteLine(recentPlace.Name);
            }
        }
コード例 #6
0
        public void Data_Mining_public_info()
        {
            var watch = new Stopwatch();

            // clean up
            GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();

            watch.Start();
            var miner = new SnooperFacebookMining(false);

            for (var i = 0; i < 5; i++)
            {
                miner.GetFacebookPublicInfo("bruckner.tomas");
            }

            watch.Stop();

            Debug.WriteLine(@"Benchmark public info: {0} ms", watch.Elapsed.TotalMilliseconds);
        }
コード例 #7
0
        public void Data_Mining_upcomming_events()
        {
            var watch = new Stopwatch();

            // clean up
            GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();

            watch.Start();
            var miner = new SnooperFacebookMining(true);

            for (var i = 0; i < 10; i++)
            {
                miner.GetUpcomingEvents("socker01");
            }
            miner.QuitMining();

            watch.Stop();

            Debug.WriteLine(@"Benchmark upcoming events: {0} ms", watch.Elapsed.TotalMilliseconds);
        }
コード例 #8
0
        public void Data_Mining_friendlist()
        {
            var watch = new Stopwatch();

            // clean up
            GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();

            watch.Start();
            var miner = new SnooperFacebookMining(true);

            for (var i = 0; i < 1; i++)
            {
                miner.GetFriendlist("vaclav.miculka");
            }
            miner.QuitMining();


            watch.Stop();

            Debug.WriteLine(@"Benchmark friendlist: {0} ms", watch.Elapsed.TotalMilliseconds);
        }
コード例 #9
0
        public void Data_Mining_mutual()
        {
            var watch = new Stopwatch();

            // clean up
            GC.Collect();
            GC.WaitForPendingFinalizers();
            GC.Collect();


            var friendlist1 = new FacebookFriendlist
            {
                Username = "******"
            };

            friendlist1.Friends.Add("friend1");
            friendlist1.Friends.Add("friend2");
            friendlist1.Friends.Add("friend3");
            friendlist1.Friends.Add("friend4");
            friendlist1.Friends.Add("friend5");
            friendlist1.Friends.Add("friend6");
            friendlist1.Friends.Add("friend7");
            friendlist1.Friends.Add("friend8");
            friendlist1.Friends.Add("friend9");
            friendlist1.Friends.Add("friend10");
            friendlist1.Friends.Add("friend11");
            friendlist1.Friends.Add("friend12");
            friendlist1.Friends.Add("friend13");
            friendlist1.Friends.Add("friend14");
            friendlist1.Friends.Add("friend15");
            friendlist1.Friends.Add("friend16");
            friendlist1.Friends.Add("friend17");
            friendlist1.Friends.Add("friend18");
            friendlist1.Friends.Add("friend19");
            friendlist1.Friends.Add("friend111");
            friendlist1.Friends.Add("friend112");
            friendlist1.Friends.Add("friend113");
            friendlist1.Friends.Add("friend114");
            friendlist1.Friends.Add("friend115");

            var friendlist2 = new FacebookFriendlist
            {
                Username = "******"
            };

            friendlist1.Friends.Add("friend1");
            friendlist1.Friends.Add("xfriend2");
            friendlist1.Friends.Add("friend3");
            friendlist1.Friends.Add("xfriend4");
            friendlist1.Friends.Add("friend5");
            friendlist1.Friends.Add("xfriend6");
            friendlist1.Friends.Add("friend7");
            friendlist1.Friends.Add("xfriend8");
            friendlist1.Friends.Add("friend9");
            friendlist1.Friends.Add("xfriend10");
            friendlist1.Friends.Add("friend11");
            friendlist1.Friends.Add("xfriend12");
            friendlist1.Friends.Add("friend13");
            friendlist1.Friends.Add("xfriend14");
            friendlist1.Friends.Add("friend15");
            friendlist1.Friends.Add("xfriend16");
            friendlist1.Friends.Add("friend17");
            friendlist1.Friends.Add("xfriend18");
            friendlist1.Friends.Add("friend19");
            friendlist1.Friends.Add("xfriend111");
            friendlist1.Friends.Add("friend112");
            friendlist1.Friends.Add("xfriend113");
            friendlist1.Friends.Add("friend114");
            friendlist1.Friends.Add("xfriend115");
            watch.Start();

            var miner = new SnooperFacebookMining(true);

            for (var i = 0; i < 10; i++)
            {
                miner.GetMutualFriends(friendlist1, friendlist2);
            }
            miner.QuitMining();

            watch.Stop();

            Debug.WriteLine(@"Benchmark mutual: {0} ms", watch.Elapsed.TotalMilliseconds);
        }