In [1]:
import webbrowser

In [2]:
batch_size = 1
current = 1000

In [3]:
def open_twitter(current, batch_size):
    row_id = 0
    count = 0
    url = 'https://www.twitter.com/'
    with open('data/brand_names.txt') as data_file:
        for row in data_file:
            row_id += 1
            if row_id < current:
                continue
            webbrowser.open(url+row.strip(),new=0)
            count += 1
            current += 1
            if count == batch_size:
                break
    return current

In [43]:
for i in range(5):
    current = open_twitter(current, batch_size)
    print(current)


1056
1057
1058
1059
1060

In [ ]: