Exemple #1
0
class TwitterTest(unittest.TestCase):
    def setUp(self):
        self.scraper = Twitter()

    def test_connection(self):
        self.assertEqual(self.scraper.connection(), True)

    def test_grab_user(self):
        self.scraper.connection()
        self.assertEqual(self.scraper.grab_user(profile='ribeiroit'), True)
        self.assertEqual(self.scraper.profile['nm'], 'Thiago Ribeiro')
Exemple #2
0
class TwitterTest(unittest.TestCase):
    def setUp(self):
        self.scraper = Twitter()

    def test_connection(self):
        self.assertEqual(self.scraper.connection(), True)

    def test_grab_user(self):
        self.scraper.connection()
        self.assertEqual(self.scraper.grab_user(profile='ribeiroit'), True)
        self.assertEqual(self.scraper.profile['nm'], 'Thiago Ribeiro')
Exemple #3
0
def scrap_profile(p_type, profile):
    print 'Processing profile %s' % profile

    if p_type == 'f':
        scrap = Facebook()
    elif p_type == 't':
        scrap = Twitter()

    scrap.connection()
    scrap.grab_user(profile)

    if scrap.profile['nm']:
        p = Profile(
            nm=scrap.profile['nm'],
            im=scrap.profile['im'],
            dc=scrap.profile['dc'],
            pi=scrap.profile['pi'],
            fr=scrap.profile['fr'],
            pr=scrap.profile['pr']
        )
        p.save()
Exemple #4
0
 def setUp(self):
     self.scraper = Twitter()
Exemple #5
0
 def setUp(self):
     self.scraper = Twitter()