In [55]:
import tweepy 
import pickle
import os
from geopy.geocoders import Nominatim
import countries
import datetime 
import time
import re
import nltk
from nltk.corpus import stopwords
from scipy.sparse import lil_matrix
from sklearn.cross_validation import KFold
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction import DictVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
from collections import Counter
from sklearn.feature_selection import chi2
import numpy as np
import operator

In [2]:
#nltk.download()
cachedStopWords = stopwords.words("english")

In [2]:
TWEET_PATH = 'Tweets/'
ACCESS_TOKEN = '3007366663-QU3WM6hrAXEAfelPzdCpv713LOB8D7LgtsuvZWL'
ACCESS_SECRET = 'RzDTCkg3xoZfEmc3bGNXypponiq06ak9rZxiziXzx7nkO'
CONSUMER_KEY = 'nlbCSYMdqtyKpANbLQOl6ITKZ'
CONSUMER_SECRET = 'wY1CXDFLcN03H94BQo96KzKW47J2nfvoQBr4x5XL96POTV9Bbj'

auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET)

api = tweepy.API(auth)
api.wait_on_rate_limit = True
api.wait_on_rate_limit_notify = True

In [4]:
def get_all_tweets(user_id, api):


    alltweets = []
    #make initial request for most recent tweets (200 is the maximum allowed count)
    new_tweets = api.user_timeline(user_id = user_id,count=200)

    #save most recent tweets
    alltweets.extend(new_tweets)

    #save the id of the oldest tweet less one
    oldest = alltweets[-1].id - 1

    #keep grabbing tweets until there are no tweets left to grab
    while len(new_tweets) > 0:
        #print "getting tweets before %s" % (oldest)

        #all subsiquent requests use the max_id param to prevent duplicates
        new_tweets = api.user_timeline(user_id = user_id, count=200, max_id=oldest)

        #save most recent tweets
        alltweets.extend(new_tweets)

        #update the id of the oldest tweet less one
        oldest = alltweets[-1].id - 1

        #print "...%s tweets downloaded so far" % (len(alltweets))
    
    return alltweets

In [14]:
#all_tweets = get_all_tweets(40428817,api)

#for tweet in all_tweets:
    #print tweet.coordinates

In [15]:
#f = open('all_tweets.txt', 'w')
#pickle.dump(all_tweets, f)
#f.close()

#f = open('all_tweets.txt', 'r')
#all_tweets2 = pickle.load(f)
#f.close()

In [5]:
def get_followers(filename, screen_name, api):
    
    uscis_followers = []
    for page in tweepy.Cursor(api.followers_ids, screen_name = screen_name).pages():
        uscis_followers.extend(page)
        time.sleep(60)
    
    #write into a file
    f = open(filename , 'w')
    for id in uscis_followers:
        f.write(str(id) + '\n')
    f.close()
    
    return uscis_followers

In [17]:
#uscis_followers = get_followers('uscis_followers','USCIS' ,api)

In [6]:
f = open('uscis_followers', 'r')
uscis_followers = []
for line in f:
    uscis_followers.append(line)
f.close()

print len(uscis_followers)


65996

In [7]:
def prune_followers(uscis_followers, min_status_count, api):
    
    pruned = []
    i = 0 
    for id in uscis_followers:
        try:
            user = api.get_user(id)
        
            if not user.protected:
                if user.geo_enabled:
                    if user.statuses_count > min_status_count:
                        pruned.append(id)
                        print i , ' --- ', id 
        except:
            print 'error caught!'
            pass
        
        i += 1
    return pruned

In [16]:
pruned_followers1 = prune_followers(uscis_followers[0:6000], 100, api)


23720020

279053298

132249617

2892471246

3309063965

146364454

106684256

78109038

4327012872

Rate limit reached. Sleeping for: 578
714091884

632429582

74949731

247098368

4719509617

415549163

2172879916

304964628

error caught!
2789316242

452433573

998072485

296006711

85606223

117661169

163199524

316527293

43966920

734840887

1955910378

186133722

121032415

1631842022

142725970

41645106

43814770

84234286

197395914

513967813

937531525

93952792

2732797066

3112137105

136159169

2547698569

Rate limit reached. Sleeping for: 817
62530983

2534570779

356512535

703167316

60766455

265224679

245610798

1112875572

15834056

141083048

2422514959

39471924

262032803

41876401

287331280

129297414

2578539502

16419969

352839081

42469754

2995367602

1481987028

137903506

139793294

212854571

202759904

630788634

19847483

339223177

334604453

555707454

787718532

217068300

2981198944

Rate limit reached. Sleeping for: 831
103227019

146867891

39550795

1035696786

256852341

3178445136

2210850013

24298952

25091723

12077642

64440900

1938177632

64795484

76075967

525419131

237519270

456594119

205780028

576787933

1381496635

488815662

19321222

3532746432

2447739648

27248764

3023504707

127293260

253271161

103317801

270112071

1077703478

68595024

29233779

16563576

144600606

1240776284

3302948303

2358071144

111659023

15748805

34629813

3337197586

3163001474

Rate limit reached. Sleeping for: 830
1349757036

4212085453

3303566749

926909484

204351276

2599940288

968997288

16537643

349006666

202787721

354466455

2751836003

162400246

1645474741

185348607

312620730

415988400

22021948

17260038

3230115218

3275094080

48211700

199850893

1225907048

438917707

200279186

158748220

154617268

136895014

196307200

549726451

2430523532

30804544

2622998643

3396165172

362155779

247382104

250256748

3365872759

251934448

272427073

632728253

615184118

245420909

Rate limit reached. Sleeping for: 804
22904559

1129958274

86383643

318613127

113367928

615253546

2876395264

166169852

58850228

291832349

300401602

1002605478

1203601027

165489088

28609503

391835914

26582848

22006244

21984279

123356205

390212070

429065890

468988056

53589580

3227655552

379987206

165838536

581198986

3408600363

4797602535

83648894

478261194

336373820

1934019176

314291655

85606835

59232086

29186208

40076915

187591998

278661116

228932275

287327720

840256724

Rate limit reached. Sleeping for: 832
2327349846

11579862

3044353335

353844808

2562506614

337910908

3421238092

2180743123

158517795

95862598

141881110

119626120

2774316183

372573817

262506341

1868602002

3968458185

159782137

27946466

266688902

2435213886

4447791808

2278092252

2199567878

223748617

16962131

17355350

616472075

259811700

23471243

1149471265

793095324

13065472

711076028

Rate limit reached. Sleeping for: 829
error caught!
1645422481

2859775600

438925152

410929832

14562086

3074278099

1033502875

445749808

161500486

444730848

301803464

132293426

193545438

76047938

776402448

22831407

336702852

275313643

15465429

198167870

4463339297

49478473

94832601

4445566223

17809798

3373588535

254798686

846025814

360897119

212638721

181456588

109389530

290809243

294553205

2814653158

382683179

3392487676

18598615

1567096106

4513147152

325933638

1859515387

262781986

59032925

Rate limit reached. Sleeping for: 802
error caught!
420410722

151755669

2552550007

2323142034

3386762429

3164351040

77650379

458159310

42291598

70911683

3449941215

44299490

58075426

14372921

186839334

629631638

175372991

50772425

62802749

486083556

253821078

534580329

2198518719

2444486546

475396366

1100011422

626225466

97483602

446184853

197284030

558203120

225039260

Rate limit reached. Sleeping for: 832
error caught!
228866392

14205936

314419323

293533565

311632838

3310096513

96333769

171048928

329357458

3307132894

270982005

1605376658

7357552

293752853

2327521273

252978405

329004039

36953448

714872976

757947822

3127922322

156003365

201212848

616935597

18120722

3098321542

529265592

79100657

70324106

491149289

1534577900

90953496

755953164

4716851238

607051719

187273510

462115262

1286166727

Rate limit reached. Sleeping for: 828
247718824

2986237495

475694207

49452560

2612494502

533317666

173948254

29750159

376635386

519638478

4699053410

102312603

3149787442

89514183

634947226

2833329937

29060853

516483599

48039269

3059907656

142252643

23498714

1625373187

16080426

93139254

1407761876

211317510

1568048534

76845018

68985239

72719371

140771317

19698165

118045268

Rate limit reached. Sleeping for: 832
error caught!
190719934

4303551

64139714

21023896

449982397

62199285

246588916

284253254

101669441

136242112

1256598078

535228280

1483011734

16714275

1009861886

16227516

187434361

69586948

444994317

1891458744

55801465

143065403

51010708

322988991

148226398

405826553

18466850

825747595

Rate limit reached. Sleeping for: 818
error caught!
348561468

447291776

735591937

24743244

138022851

380705994

56419674

77851824

267617342

312704634

20463164

3297877948

17759371

1122948080

46029287

29370120

1571063846

83770449

95955769

205829263

20289445

157074855

3337299329

16054656

3656843352

935720785

171217363

3404768541

246362315

118632461

310532681

error caught!
430318087

Rate limit reached. Sleeping for: 820
863694098

3339851374

44866160

80654397

136347372

31001654

310524803

357611522

3227098789

1572827144

2545659360

33876324

222636160

838954273

221972776

2613124821

193709242

34128985

80524385

459247104

415891545

1676695922

745692901

3221481222

432251444

2815048381

Rate limit reached. Sleeping for: 814
17890544

493138720

22335923

3413870405

19094067

167345220

172511687

11016252

62071389

2250788684

21103576

26343788

3310303898

118997561

1620846667

1199614536

1938546398

2911887103

4248479123

367750047

53839093

158593565

309556241

159723096

3447895333

4441219042

42362487

48454562

575239733

321837938

147220954

270725953

37271364

327428143

517961389

2536303451

221768774

122813846

Rate limit reached. Sleeping for: 797
703447596

3170888425

323806052

560064537

131790709

1157584921

245015324

257526327

2468518000

107341917

2829220508

64461443

37920978

98881281

194814479

1096277084

3184087975

230157939

2565884221

4294863312

2787081445

2533592953

95966563

14876000

21261410

3267495571

2223418195

18197430

3437849679

2353932074

499846012

2888868142

2865165616

95327710

19731255

29965363

3099883263

26942104

111051559

3018272104

68321759

388124500

Rate limit reached. Sleeping for: 781
76832827

4431990794

37630113

1638728406

90839243

4010191092

762697266

438092745

3121959027

3000196660

3220731283

73241227

368688843

625205210

862556504

2153268036

50165632

236044707

122882037

64747084

427272900

37597359

2797356674

44111237

515765515

22015957

2271057959

2373239013

2394303197

46443065

4191570562

1892620658

274288982

3755078300

893296753

93890718

18615231

31218458

2378270569

3301748240

4300221861

39576814

310812495

42463942

22651134

1096082978

121887080

55895687

2768761353

Rate limit reached. Sleeping for: 816
353917037

136832131

14103138

231909676

432157218

3040736187

202664148

431617702

3230960364

25816643

4072498295

17284798

40158307

171963467

942814512

21430686

50688509

36373890

870189685

3428532268

923624185

126181510

72949614

52987220

1016671128

930072638

752159682

129675504

2312494016

96280946

35201390

168277428

543483592

3873650953

329989982

34702832

2165797386

39993936

2217564324

544656068

3057285230

2663259305

218084368

2798528288

439825740

1461329647

3034717043

512824732

251934827

3048895338

14703049

54918325

1093350067

38257050

2230503625

1890403346

26852376

15501262

127180612

337641377

302204453

319951253

2784416954

439768520

142397608

178139894

1202940421

3493922422

1511680770

1691905310

9627502

431286129

45148245

3094016556

149917241

Rate limit reached. Sleeping for: 746
3777682995

2184532918

578964538

63418918

27759863

2164126967

74290376

3734211256

2203814522

4152130769

16152178

1532102240

45648984

125773388

3301759607

50806221

23071151

236726805

3244197212

3041236959

131100503

857729437

161307949

1471019562

336283404

139147394

25552566

22153452

2407867620

215252002

257856987

600955704

33343296

216685712

15616459

340646681

497181988

3040426484

80612347

965002952

1908176906

Rate limit reached. Sleeping for: 827
3047271994

4143160666

98973049

61109225

169013871

41438469

1337093828

177395167

2497625899

50720759

60139111

648643

67804096

3374413174

31588258

153803880

3241884596

1530783200

138815473

224687220

190512471

358990285

1905476077

382631461

4129744274

61234549

560371774

131014335

14536082

37884704

1063158572

1308569960

475488548

269585164

394111765

45857550

44989000

975249038

2463303265

1379628954

625216552

301103024

1158234043

340452877

70273763

226041521

166406139

794481884

52962829

28859248

196514743

14881659

32816610

3101963899

21086710

Rate limit reached. Sleeping for: 766
360236819

45477837

261244165

273572709

380139772

309681036

57732629

761110808

955889702

188921908

3221461088

21914895

1338515053

2499044360

361009864

299404995

1276720860

118583509

2974287563

1454569741

720420246

844565766

22583725

119566009

571494080

801010310

378419067

28556714

2916833677

935141786

2249969798

2420018986

208838544

24844300

2497861171

3041649421

624232736

Rate limit reached. Sleeping for: 828
4003325253

402834122

333592479

212510911

1570568480

2577254371

1069176302

380551603

293512582

54195531

279642157

62547770

1457636226

1137405769

501493564

598426229

194443694

109431956

2943469315

81724321

1404875185

122741424

158145399

323193310

2279580883

14780473

3321421564

14272607

65906861

162536267

779458303

Rate limit reached. Sleeping for: 827
3265068516

622045531

14476992

15224444

785183402

164732631

1040158560

2188472324

2541186084

2805764473

32495497

180626301

49480294

1250883788

50034138

634387197

399210358

714762829

544199455

1463532319

2845285873

54336952

373379085

1013477796

229648821

1719513643

176706258

86943511

82397091

3308558803

89139810

26333256

Rate limit reached. Sleeping for: 837
82292022

15977178

1911239052

3040078483

107823095

57475417

143358467

2808715165

47386229

95447208

267262235

111145818

618504903

275342997

26978308

1356052267

2760689155

247614518

315006238

164826035

750386767

785804071

150515469

57405887

54879675

183785627

716044325

8504452

2755132178

2310425167

3716389512

143195113

2771300323

2776927028

69403317

149259716

17904375

235459045

788070114

2508007956

2155410991

207108466

2835015256

error caught!
74529934

Rate limit reached. Sleeping for: 805
119798184

385029275

494618008

90306063

86130773

16070893

73371820

2971863879

2742788722

30775217

9393712

130180885

274701752

2170986318

175032133

51499096

189334268

47549800

2392400532

347635373

3804522732

529548070

516994993

83563859

498042099

120605637

335512630

2524157914

322803025

110728072

109203238

33160996

549572947

3913822098

235696645

257109035

286752526

17882946

700106822

2651614530

862176900

300387497

1310732425

139435238

2214626611

479149139

3924180819

1615619287

205254505

318840422

341579776

312919918

27346701

160246535

19144466

636795822

19184927

846578754

2928078771

14694167

325241277

259260816

65028062

2786857361

814435903

67400987

542214416

Rate limit reached. Sleeping for: 774
111849519

69836265

171550174

113392594

1951126891

1209632204

3864608359

326569888

3511329494

159555647

28946273

63641169

171129188

9777822

133399487

592846427

520735446

6419262

161358080

283419562

189431083

36394149

22696409

68905937

3645269596

44638816

2213078875

15582021

3308978374

385408074

3847907489

1806686539

513698978

35924661

3900701956

3827449094

Rate limit reached. Sleeping for: 813
201974045

228345825

2388092496

42520414

37345675

3284953824

2780924683

3048478945

2744956818

2583993487

2214741398

2835638904

141280494

380553186

23034405

141454306

17298635

1849872097

305899417

234844908

446276299

3786721960

2195433152

136885380

425889794

56367356

320956780

16207052

85370098

586315817

481437974

487694329

164398243

3403502055

19225977

36724093

61914320

35238770

312036576

147647236

17425259

Rate limit reached. Sleeping for: 810
116716599

314541366

3850255108

237258164

3306283622

132200303

74483257

25117556

248785249

1589571211

236972191

3171914931

404076947

163284411

827231672

151775575

140297023

520799447

28657457

367498967

2215259462

49253745

922289666

786044730

248922314

493327181

194707013

92479673

3082925523

271977832

3408020489

3413197707

860590664

86909220

80693383

50185177

2548424204

59281691

386184124

446293158

348243347

14820046

222622640

47538093

134241206

842840798

471510456

101411866

301065559

69760319

231444370

33198745

2837030551

Rate limit reached. Sleeping for: 797
78447223

1454726292

91763421

19411541

3150600104

1128514404

1117438088

604911709

2770670226

3419961613

3048023501

3180980659

402147539

258096549

75734723

127821623

3823775903

185782828

290785184

30144847

114611933

812968879

2462402330


In [19]:
f = open('pruned_followers1','w')
for follower in pruned_followers1:
    f.write(str(follower)+'\n')
f.close()

In [8]:
pruned_followers2 = prune_followers(uscis_followers[6000:12000], 100, api)


2  ---  1320220920

5  ---  15983203

8  ---  2187610758

14  ---  21115909

23  ---  3294005390

29  ---  2688440329

30  ---  77268091

36  ---  442477682

44  ---  64662201

52  ---  186503743

54  ---  190004786

56  ---  96367350

57  ---  16812678

58  ---  25516947

60  ---  260156477

65  ---  541983618

69  ---  25425842

70  ---  102527727

90  ---  183157883

92  ---  425156368

115  ---  69298151

119  ---  270138135

126  ---  139900071

127  ---  414861659

143  ---  2312674705

148  ---  78821234

152  ---  46691413

170  ---  190491667

172  ---  113157882

180  ---  3795592036

181  ---  3299933809

182  ---  69770454

188  ---  48321406

190  ---  2897597028

193  ---  458861749

195  ---  2653622856

203  ---  2858077692

206  ---  246725673

207  ---  2256871969

218  ---  1061926292

223  ---  941475259

225  ---  361525084

228  ---  71243948

229  ---  29620402

230  ---  108156138

235  ---  78862025

238  ---  19302460

243  ---  783815149

Rate limit reached. Sleeping for: 677
258  ---  1323591001

264  ---  454743352

279  ---  17609285

287  ---  123238487

294  ---  22220278

324  ---  20416161

329  ---  12768142

334  ---  102570229

335  ---  508392225

351  ---  78043007

356  ---  28929021

358  ---  86609657

361  ---  17140222

369  ---  59640584

374  ---  32864010

376  ---  3041739853

383  ---  252593490

389  ---  18373162

394  ---  3427845845

395  ---  172894749

405  ---  3293429306

407  ---  2457123169

410  ---  953979134

413  ---  2604854920

415  ---  146196745

417  ---  151358029

418  ---  58472249

424  ---  2345666761

427  ---  259904351

428  ---  286225314

430  ---  621592512

431  ---  1023445663

432  ---  2899711580

Rate limit reached. Sleeping for: 832
440  ---  456947825

443  ---  69996070

448  ---  114600664

462  ---  3291961496

466  ---  223439511

474  ---  2505153797

475  ---  16148083

478  ---  287901221

487  ---  17359420

490  ---  2471364594

497  ---  1946987005

501  ---  2664816260

519  ---  101626208

520  ---  63956956

521  ---  31644216

526  ---  18600524

528  ---  373185859

530  ---  1447523690

531  ---  61834506

538  ---  2944914207

539  ---  1671627942

541  ---  76851362

542  ---  59194802

546  ---  3518087726

549  ---  155728591

550  ---  437761263

551  ---  30967110

559  ---  279885374

562  ---  43409258

564  ---  74731396

572  ---  1012120064

573  ---  3027501082

575  ---  34898908

582  ---  438103723

585  ---  23647228

594  ---  116103983

599  ---  18340635

600  ---  169129302

607  ---  70455225

609  ---  118200859

613  ---  2165298064

614  ---  623070976

635  ---  250990891

640  ---  145119548

643  ---  2736413779

644  ---  49492230

657  ---  3396001114

659  ---  15258519

664  ---  566947009

Rate limit reached. Sleeping for: 804
669  ---  45533553

673  ---  200981002

680  ---  99365539

682  ---  2552928404

684  ---  1433518009

686  ---  1255603118

688  ---  228509597

691  ---  3402805311

702  ---  86350567

706  ---  2191919061

707  ---  131273063

713  ---  125529600

716  ---  424683862

717  ---  72411804

722  ---  1517504198

724  ---  327145449

744  ---  2736270662

749  ---  761744628

754  ---  273715263

758  ---  1971403946

773  ---  1320062504

775  ---  3113684721

778  ---  1086790166

779  ---  423911213

781  ---  371880137

801  ---  897484796

802  ---  96564060

803  ---  17135615

806  ---  237526622

810  ---  48802886

814  ---  29399294

831  ---  1173408768

834  ---  131068771

835  ---  177890163

837  ---  87014813

838  ---  184009827

839  ---  146593669

842  ---  476115918

845  ---  45869761

846  ---  119241590

849  ---  202423878

Rate limit reached. Sleeping for: 826
868  ---  10972962

871  ---  1639012855

884  ---  2997035789

892  ---  195861376

897  ---  99725920

900  ---  2885632387

903  ---  22451908

907  ---  52126257

918  ---  992530470

923  ---  46418092

945  ---  162655429

956  ---  274272841

959  ---  3321551275

966  ---  1246523292

969  ---  100724466

973  ---  373450638

979  ---  19628420

988  ---  1959719359

992  ---  143657719

998  ---  2644425311

1000  ---  3398460023

1003  ---  186558923

1004  ---  31426524

1005  ---  79569645

1006  ---  469504985

1029  ---  3231933590

1035  ---  20836715

1036  ---  3249935365

1047  ---  3387777719

1050  ---  280777514

1051  ---  2416784622

1053  ---  150302744

1055  ---  37506224

1066  ---  150403778

1073  ---  2305148474

1075  ---  46594286

1086  ---  115814897

1094  ---  542746530

1097  ---  3289402512

1109  ---  121309641

1110  ---  194026116

Rate limit reached. Sleeping for: 802
1118  ---  208713591

1119  ---  33174605

1123  ---  2658420836

1129  ---  36295253

1130  ---  855487766

1142  ---  1913613091

1145  ---  16870807

1146  ---  2439001832

1150  ---  131667757

1158  ---  244725406

1161  ---  332010970

1163  ---  276773271

1168  ---  142934167

1172  ---  3032906997

1178  ---  1955241006

1180  ---  92672190

1181  ---  425189805

1182  ---  18564666

1185  ---  1634815598

1189  ---  151183444

1197  ---  2841163311

1202  ---  1363873538

1203  ---  49125112

1226  ---  55963205

1230  ---  384828601

1234  ---  481346819

1239  ---  455930802

1242  ---  2505665912

1250  ---  157850786

1254  ---  982497632

1256  ---  14850098

1263  ---  596930219

1267  ---  54417706

1272  ---  509171505

1277  ---  50966870

1283  ---  3261764123

1285  ---  2453891772

1290  ---  112290547

1291  ---  44546124

1295  ---  563196574

1304  ---  3243290935

1308  ---  359656190

1313  ---  91501117

1315  ---  1191614016

1318  ---  455183773

1322  ---  48115957

1329  ---  221238218

1342  ---  134335103

1344  ---  3430272736

1348  ---  465257929

1350  ---  3298726318

1352  ---  326733430

1354  ---  376211514

Rate limit reached. Sleeping for: 809
1361  ---  19198783

1363  ---  3582265462

1365  ---  34705390

1367  ---  187464174

1380  ---  573603435

1383  ---  217065550

1385  ---  608134751

1389  ---  22719023

1396  ---  24058504

1398  ---  92988080

1414  ---  37009840

1419  ---  71152794

1428  ---  3524135837

1430  ---  193748642

1431  ---  591652845

1463  ---  267661313

1464  ---  418911357

1467  ---  62119604

1474  ---  557621137

1475  ---  3295745845

1487  ---  3290607540

1492  ---  194060344

1521  ---  3552585675

1522  ---  1690852898

1524  ---  254568194

1544  ---  191247812

1550  ---  265549875

1558  ---  1048097000

1559  ---  16741237

1560  ---  115762349

1565  ---  855463021

1570  ---  44831234

1571  ---  2106811

1572  ---  225856055

1580  ---  14248486

1586  ---  2495488976

1587  ---  195634034

1590  ---  2293385868

1603  ---  1865184320

1610  ---  608150513

1613  ---  33132406

1614  ---  125464222

1616  ---  423807080

1620  ---  706144878

1631  ---  2515744478

1636  ---  584343299

Rate limit reached. Sleeping for: 786
1639  ---  611759384

1642  ---  408505086

1646  ---  385191975

1659  ---  371472670

1661  ---  634504586

1671  ---  2362689271

1677  ---  625869104

1678  ---  289060250

1680  ---  43590380

1681  ---  215823858

1682  ---  3233217204

1683  ---  3522083595

1686  ---  234627090

1702  ---  2567864521

1709  ---  40183855

1724  ---  128399074

1727  ---  54579233

1736  ---  63655480

1740  ---  3366513046

1741  ---  2798052993

1742  ---  445014026

1743  ---  1409495378

1748  ---  75881733

1756  ---  3302651016

1762  ---  39854730

1764  ---  1398611323

1769  ---  298340307

1771  ---  284792751

1780  ---  22274206

1786  ---  57369226

1808  ---  73179406

1836  ---  2370613735

1838  ---  35524218

1839  ---  88723967

1849  ---  2743599729

1855  ---  2685763951

1878  ---  730190784

1881  ---  1046903588

1884  ---  18882363

Rate limit reached. Sleeping for: 795
1887  ---  37707229

1891  ---  3412800273

1907  ---  537614255

1908  ---  238185601

1924  ---  385728524

1929  ---  164338783

1934  ---  52415702

1939  ---  607264901

1940  ---  1237108867

1946  ---  74280702

1952  ---  238418786

1956  ---  1145941478

1964  ---  1631109350

1975  ---  21098242

1977  ---  15619938

1990  ---  451713297

1994  ---  1725108385

2003  ---  3220167144

2008  ---  59570408

2020  ---  94503315

2021  ---  49998539

2029  ---  149955482

2030  ---  2362087675

2036  ---  34486550

2038  ---  38021422

2042  ---  3291289812

2052  ---  2310394014

2053  ---  81544161

2065  ---  1000478264

2072  ---  27092844

2081  ---  44131267

2086  ---  153840467

2087  ---  986988950

2090  ---  1705571214

2093  ---  134801131

2094  ---  755408677

2100  ---  108463258

2111  ---  16328473

2115  ---  76883366

2121  ---  251191691

2130  ---  3099930581

2139  ---  45915191

Rate limit reached. Sleeping for: 797
2145  ---  47364335

2148  ---  3127168535

2151  ---  770814230

2156  ---  295461124

2169  ---  42119666

2175  ---  588234489

2177  ---  33037095

2182  ---  124747418

2185  ---  743417202

2186  ---  17423191

2189  ---  284767346

2198  ---  288891878

2209  ---  369254932

2214  ---  263128918

2220  ---  202370319

2221  ---  25886103

2222  ---  2544275959

2231  ---  254283156

2241  ---  26807132

2242  ---  117705022

2243  ---  2744952502

2246  ---  1460680334

2250  ---  89850915

2255  ---  30369686

2257  ---  72661958

2261  ---  46749850

2264  ---  311111466

2272  ---  49419767

2287  ---  3269228370

2295  ---  23714887

2302  ---  522153728

2310  ---  155059967

2315  ---  3433345667

2316  ---  211674197

2318  ---  104345789

2319  ---  45953369

2323  ---  424796177

2329  ---  3170916196

2339  ---  199119704

2358  ---  318667078

2366  ---  2688219761

2369  ---  25064587

2372  ---  28047395

2373  ---  112503680

2383  ---  3415649003

2384  ---  440109116

2387  ---  141751828

2388  ---  2683678471

2389  ---  400729322

2390  ---  3135349648

2394  ---  356411536

2397  ---  142606336

2404  ---  3265630302

2412  ---  142938051

2413  ---  733681771

2418  ---  480211084

2425  ---  2375187150

2430  ---  457889851

2446  ---  2790168934

2448  ---  142596872

2457  ---  109464088

2471  ---  974671574

2479  ---  134354649

2505  ---  1198274456

2508  ---  43653944

Rate limit reached. Sleeping for: 737
2523  ---  190374561

2533  ---  145119792

2535  ---  3792501

2536  ---  126305763

2551  ---  51791079

2554  ---  373698467

2566  ---  362294801

2576  ---  1969943299

2577  ---  246562533

2579  ---  13414352

2581  ---  286371986

2586  ---  3310872595

2595  ---  152309936

2597  ---  584425848

2603  ---  282187301

2610  ---  155693433

2612  ---  1675400312

2615  ---  892537531

2621  ---  72846114

2626  ---  277485072

2627  ---  48939226

2642  ---  178344419

2649  ---  38326185

2657  ---  389431308

2664  ---  238529501

2665  ---  6708252

2670  ---  98340575

2676  ---  159390058

2678  ---  3420867075

2680  ---  71260896

2687  ---  2992366647

2700  ---  217110429

2703  ---  859906328

2709  ---  1862672803

2713  ---  900390380

2719  ---  2374826101

2720  ---  12627032

2724  ---  2367799226

Rate limit reached. Sleeping for: 821
2730  ---  89072898

2734  ---  21387556

2739  ---  516963460

2741  ---  82012895

2745  ---  170507071

2747  ---  1327549494

2749  ---  954618302

2759  ---  2583415067

2791  ---  3092505707

2797  ---  2891598865

2799  ---  17027129

2814  ---  264993908

2815  ---  269815851

2816  ---  44643312

2819  ---  3351818189

2826  ---  192069604

2830  ---  198816994

2835  ---  2246299408

2850  ---  39074359

2856  ---  626150221

2866  ---  71834468

2884  ---  2392141846

2886  ---  904442526

2896  ---  894141074

2898  ---  1102639778

2903  ---  104269355

2904  ---  348906120

Rate limit reached. Sleeping for: 834
2909  ---  68005853

2914  ---  467495079

2916  ---  64691085

error caught!
2928  ---  305788738

2945  ---  1396738880

2946  ---  36958331

2949  ---  13911232

2960  ---  2429078788

2964  ---  1228267898

2974  ---  84382289

2975  ---  247539161

2982  ---  238757489

2987  ---  3305189117

2988  ---  389758831

3000  ---  3008130788

3005  ---  227869477

3016  ---  53186966

3029  ---  2777753094

3030  ---  188310450

3044  ---  705571328

3058  ---  549614546

3061  ---  1365144612

3070  ---  3073787988

3071  ---  988819238

3076  ---  25829921

3077  ---  25949178

3080  ---  3399376613

3082  ---  3035396898

3089  ---  174953869

3095  ---  121370151

3097  ---  1480628424

3099  ---  63665862

3111  ---  152651090

3125  ---  1643303280

3126  ---  56820593

3128  ---  334444689

3135  ---  1389849500

3146  ---  1901309600

3147  ---  1018047643

3148  ---  20212700

3150  ---  57001993

3154  ---  2945105341

3155  ---  974166224

3156  ---  56715264

Rate limit reached. Sleeping for: 799
3179  ---  113925504

3185  ---  16408759

3195  ---  17726407

3199  ---  43347283

3201  ---  139611137

3210  ---  2150597804

3211  ---  3056256942

3213  ---  94064941

3220  ---  51811499

3223  ---  70289803

3231  ---  311852722

3247  ---  1515639152

3252  ---  2766354201

3257  ---  2984882102

3267  ---  7799592

3269  ---  2400312368

3273  ---  1457819624

3276  ---  518240282

3277  ---  15669080

3279  ---  24548615

3282  ---  14641650

3285  ---  1155164156

3286  ---  1130167135

3292  ---  1015508684

3293  ---  109382395

3296  ---  2831919636

3297  ---  373458103

3299  ---  46392894

3301  ---  3014596006

3322  ---  48451918

3328  ---  3291424327

3332  ---  9263202

3333  ---  47601729

3339  ---  14840203

3341  ---  326821710

3348  ---  274749318

3349  ---  1143002431

3350  ---  15711668

3356  ---  915457484

3359  ---  1132756380

3360  ---  18847579

3361  ---  311622254

3364  ---  1903490869

Rate limit reached. Sleeping for: 822
3371  ---  27811524

3375  ---  61341611

3376  ---  1852067635

3385  ---  2559614234

3387  ---  144543576

3393  ---  85927459

3394  ---  2720253489

3395  ---  1941110586

3399  ---  135117115

3400  ---  3307776305

3401  ---  59541579

3404  ---  40147901

3407  ---  628774156

3410  ---  22131842

3437  ---  3310182827

3439  ---  118146959

3443  ---  19031057

3444  ---  56780939

3448  ---  363642117

3452  ---  2724255644

3453  ---  127897070

3457  ---  248451914

3458  ---  636648648

3465  ---  2469476492

3469  ---  552987792

3483  ---  2356046360

3484  ---  123109417

3489  ---  293076937

3490  ---  90917198

3497  ---  254659570

3500  ---  3143329357

3503  ---  22548656

3504  ---  240844862

3519  ---  21196611

3520  ---  89199618

3527  ---  133960701

3528  ---  2179051945

3529  ---  3272116010

3530  ---  2727991810

3532  ---  73702830

3534  ---  53701715

3544  ---  144923604

3547  ---  24836097

3553  ---  3230198848

3556  ---  169134980

3558  ---  16705048

3563  ---  16248209

3572  ---  32422347

3576  ---  45010968

3586  ---  499982779

3587  ---  545305090

3591  ---  471043394

3595  ---  622734834

3598  ---  2453026574

3610  ---  25600795

3614  ---  448176970

3616  ---  305394051

3625  ---  899003988

3628  ---  2872274937

3632  ---  210160926

3637  ---  14997979

3639  ---  32375759

3647  ---  2223934866

3650  ---  24913074

3658  ---  17309492

3663  ---  3342482313

3665  ---  41027973

3666  ---  47100542

3668  ---  47654760

Rate limit reached. Sleeping for: 779
3672  ---  73268863

3677  ---  2471824568

3678  ---  44650702

3688  ---  161615144

3692  ---  3379781727

3695  ---  190586218

3698  ---  26506968

3700  ---  66894069

3708  ---  3323010515

3724  ---  137511713

3726  ---  241653228

3731  ---  127578837

3734  ---  562071938

3742  ---  570657426

3745  ---  52632652

3747  ---  200372289

3749  ---  303622154

3752  ---  304123014

3755  ---  556508263

3759  ---  333204475

3763  ---  3098833573

3764  ---  1967467232

3771  ---  327553091

3774  ---  387919852

3778  ---  2152541034

3779  ---  209739371

3785  ---  48404758

3793  ---  130678058

3798  ---  265170486

3800  ---  3372900155

3802  ---  1973535618

3807  ---  124777003

3811  ---  16398376

3813  ---  2809858441

3817  ---  82658113

3823  ---  128342376

3824  ---  3002793997

3830  ---  285832429

3833  ---  89206855

3839  ---  452474775

3846  ---  2813412205

3847  ---  81712007

3849  ---  298242110

3851  ---  3042452209

3855  ---  250633280

3858  ---  57662387

3862  ---  128593263

3873  ---  372636599

3876  ---  447174901

Rate limit reached. Sleeping for: 824
3891  ---  3340465047

3892  ---  16982410

3894  ---  503906837

3895  ---  15434181

3897  ---  2180230888

3898  ---  496979787

3900  ---  1945145209

3908  ---  332608281

3910  ---  3229059758

3912  ---  69550086

3913  ---  14230821

3917  ---  18080695

3920  ---  389203961

3926  ---  23626129

3927  ---  1430387964

3930  ---  2171404587

3942  ---  899652943

3954  ---  2787216760

3957  ---  3239410441

3966  ---  254135326

3968  ---  44792979

3970  ---  1370995375

3971  ---  2444561660

3973  ---  20103036

3974  ---  75078858

3979  ---  3252511513

3988  ---  145852397

3989  ---  1260842239

3997  ---  1710024372

4001  ---  433224273

4008  ---  16813061

4011  ---  19253885

4013  ---  1264451460

4014  ---  404149661

4016  ---  248965061

4019  ---  621873053

4022  ---  1587022777

4030  ---  1437825738

4036  ---  729078128

4041  ---  44162457

4042  ---  2370610038

4045  ---  243494641

4047  ---  2194981310

4056  ---  822400058

4069  ---  223944783

4070  ---  27824900

4075  ---  18426507

4077  ---  134534776

4090  ---  3044993235

Rate limit reached. Sleeping for: 822
4092  ---  205065944

4095  ---  704363558

4096  ---  2319453359

4102  ---  557867182

4105  ---  564739170

4110  ---  2239292181

4122  ---  221460820

4130  ---  1536471

4142  ---  14842431

4149  ---  561608087

4153  ---  447567294

4158  ---  2315583811

4166  ---  3267449232

4168  ---  308119119

4169  ---  1305829658

4171  ---  3330113877

4177  ---  14385995

4186  ---  15358798

4187  ---  34378516

4188  ---  14147374

4189  ---  16999516

4191  ---  621264566

4192  ---  111808396

4194  ---  2169523404

4195  ---  93933955

4204  ---  77203634

4207  ---  221178245

4212  ---  118988468

4220  ---  67942262

4228  ---  145515636

4229  ---  345676930

4233  ---  202988421

4237  ---  1710421442

4241  ---  36960564

4256  ---  2232696984

4257  ---  49594954

4260  ---  367337022

4266  ---  413508470

4279  ---  29342072

4281  ---  275394765

4282  ---  22553748

4285  ---  2371688027

4293  ---  2328166860

4294  ---  547816431

4295  ---  217453831

4300  ---  2836749637

4304  ---  105989546

4311  ---  15661285

4313  ---  39913809

4317  ---  34875946

4319  ---  50426077

4321  ---  2402590428

4324  ---  553178322

4326  ---  3353925088

4328  ---  239220938

4332  ---  76094540

4335  ---  574524920

4336  ---  2523759337

Rate limit reached. Sleeping for: 805
4340  ---  2316845708

4341  ---  2371760770

4343  ---  451453638

4344  ---  23024492

4351  ---  21861727

4355  ---  83724045

4357  ---  118464661

4359  ---  52853420

4360  ---  72564275

4364  ---  379817601

4368  ---  84371629

4375  ---  564515676

4379  ---  341481462

4382  ---  32880297

4394  ---  1409986328

4399  ---  179043818

4418  ---  3185654618

4419  ---  20802760

4421  ---  2999506385

4431  ---  2528402600

4436  ---  26003471

4439  ---  54128612

4440  ---  64326123

4442  ---  84628302

4451  ---  3337878909

4452  ---  2379609865

4456  ---  600204279

4461  ---  22250031

4463  ---  184907105

4466  ---  3131515168

4467  ---  3345651676

4471  ---  2920742106

4472  ---  57938487

4473  ---  103572181

4474  ---  537381564

4497  ---  37331738

4499  ---  767838722

4500  ---  90957235

4504  ---  23965985

4513  ---  2951095041

4514  ---  62453219

4516  ---  103755143

4517  ---  2307343238

4519  ---  105118422

4520  ---  1236880596

4521  ---  2179493472

4523  ---  26524000

4525  ---  37723049

4530  ---  16550986

4534  ---  326892463

4536  ---  362689426

4537  ---  27190982

4541  ---  23800816

4542  ---  31376703

4552  ---  3342460793

4562  ---  45465892

4571  ---  2383586898

4576  ---  3092217927

4580  ---  124081556

4582  ---  2284440674

4588  ---  3232826113

4593  ---  2876321105

4599  ---  304514607

4603  ---  34391129

4606  ---  257978349

4613  ---  479107939

4627  ---  41055173

4630  ---  1529158076

Rate limit reached. Sleeping for: 776
4638  ---  17388854

4639  ---  232406684

4640  ---  199032080

4644  ---  34870022

4646  ---  101983276

4649  ---  3068578807

4652  ---  83251901

4661  ---  1921311408

4667  ---  104425290

4670  ---  32907711

4675  ---  1128980814

4679  ---  1183672902

4680  ---  56078606

4681  ---  101802390

4686  ---  40615652

4694  ---  350940083

4699  ---  448089112

4700  ---  3341556501

4702  ---  239186963

4703  ---  114910758

4706  ---  57739066

4707  ---  30255933

4727  ---  2975676705

4728  ---  169184640

4737  ---  18947551

4738  ---  426247625

4739  ---  386128711

4755  ---  83766408

4757  ---  223327269

4767  ---  3009729397

4769  ---  3246850524

4774  ---  370122605

4785  ---  234047492

4789  ---  3309912083

4790  ---  334495462

4792  ---  92211807

4800  ---  2400314768

4801  ---  91001162

4802  ---  56299961

4803  ---  2212454553

4820  ---  516112011

4824  ---  2726879090

4837  ---  578623703

4843  ---  267523967

4845  ---  3318961103

4849  ---  584304761

4850  ---  16427409

4851  ---  185801989

Rate limit reached. Sleeping for: 813
4859  ---  41530834

4861  ---  549384393

4867  ---  1943041039

4871  ---  105877426

4872  ---  412502182

4878  ---  14850410

4880  ---  27142201

4889  ---  91903903

4890  ---  58480512

4891  ---  2983946514

4895  ---  116810164

4896  ---  807180799

4897  ---  186560223

4898  ---  563622733

4917  ---  431948066

4918  ---  130387429

4924  ---  2965204000

4927  ---  588978928

4928  ---  50635677

4930  ---  144322477

4933  ---  830113940

4940  ---  153265554

4946  ---  2395233378

4950  ---  20484982

4956  ---  2279590520

4959  ---  80470779

4961  ---  2185289596

4968  ---  203958386

4970  ---  214795726

4976  ---  42674943

4979  ---  36610670

4980  ---  172368604

4985  ---  222557823

4989  ---  250229423

4999  ---  316317408

5002  ---  1114355748

5004  ---  17823765

5005  ---  33624291

5009  ---  2298707864

5014  ---  182048985

5016  ---  918422700

5017  ---  41233808

5026  ---  132727437

5027  ---  634011284

5028  ---  3168049347

5031  ---  160762757

5034  ---  2813668064

5036  ---  435936261

5039  ---  46018142

5044  ---  85604255

5051  ---  271125440

5054  ---  204940565

5060  ---  625333416

5063  ---  215941277

5065  ---  25055273

5073  ---  26843389

5075  ---  215616785

5079  ---  563610113

5091  ---  30386845

5095  ---  783216918

5097  ---  46580462

5099  ---  110755983

5103  ---  84147605

5105  ---  56595468

5111  ---  95776313

5121  ---  419162478

5124  ---  30142513

5130  ---  45342434

5131  ---  876099870

Rate limit reached. Sleeping for: 786
5140  ---  611469684

5145  ---  57210302

5146  ---  110904169

5152  ---  371517760

5162  ---  219095635

5177  ---  1239603626

5178  ---  1297221686

5179  ---  342954124

5187  ---  65610575

5190  ---  2245773062

5196  ---  243477649

5218  ---  786617612

5219  ---  3194506202

5227  ---  118502630

5230  ---  69054020

5232  ---  100449761

5233  ---  2502074857

5234  ---  29966399

5235  ---  3233461865

5241  ---  73941876

5242  ---  184908623

5243  ---  180247338

5246  ---  308405974

5253  ---  1378169520

5256  ---  3008618936

5260  ---  2361570222

5267  ---  140121830

5272  ---  273133913

5284  ---  71310473

5287  ---  55376413

5290  ---  22106552

5299  ---  430398328

5300  ---  32439299

5303  ---  2884823728

5307  ---  2632021282

5310  ---  755214062

5319  ---  24660189

5322  ---  120427338

5324  ---  1053884274

5330  ---  219915029

5331  ---  171141033

5334  ---  2403204059

5335  ---  1043669898

5336  ---  861435451

5337  ---  221668555

5339  ---  3220306573

Rate limit reached. Sleeping for: 821
5348  ---  23341019

5352  ---  3020225198

5353  ---  1622228840

5358  ---  20450922

5359  ---  2814073905

5361  ---  313567537

5364  ---  564707615

5365  ---  23592155

5369  ---  24188985

5370  ---  2292399023

5377  ---  17717420

5380  ---  20915113

5391  ---  604260059

5392  ---  16229478

5395  ---  20687723

5401  ---  55619854

5406  ---  281694250

5412  ---  2763311515

5415  ---  104309964

5421  ---  3140959214

5428  ---  24853213

5433  ---  14724414

5434  ---  118883182

5437  ---  622465636

5444  ---  23419632

5452  ---  21579287

5455  ---  1735570604

5467  ---  116643933

5470  ---  3289430536

5483  ---  2262886544

5499  ---  2518877564

5501  ---  85659855

5504  ---  116208685

5507  ---  296616877

5509  ---  20888742

5522  ---  19750653

5525  ---  17337793

5526  ---  40297578

5529  ---  587890310

5535  ---  89587592

5538  ---  52415455

5542  ---  14523861

5546  ---  117343688

Rate limit reached. Sleeping for: 821
5561  ---  3308631821

5563  ---  34696654

5565  ---  2740019332

5567  ---  170547144

5571  ---  46638048

5572  ---  422939389

5573  ---  522670493

5579  ---  286041356

5582  ---  181628845

5583  ---  460534166

5584  ---  60832549

5586  ---  103041912

5602  ---  2373668879

5616  ---  188833126

5618  ---  2883283491

5622  ---  97379578

5624  ---  42118566

5627  ---  15828075

5628  ---  35171306

5629  ---  63754359

5637  ---  616880962

5642  ---  20413277

5645  ---  2859420134

5650  ---  71301801

5655  ---  27148987

5672  ---  23499062

5675  ---  176426798

5677  ---  519608124

5685  ---  187003824

5695  ---  994196634

5709  ---  41667627

5710  ---  123242310

5711  ---  169094888

5715  ---  74189049

5717  ---  135730830

5719  ---  61552331

5720  ---  1122585704

5721  ---  52098165

5734  ---  5518872

5752  ---  88133447

5756  ---  278386187

5759  ---  25112529

5760  ---  2258460385

5773  ---  3304058697

5781  ---  23422169

5785  ---  109863618

5786  ---  399145440

5799  ---  129982402

5801  ---  787763576

5815  ---  499060987

5816  ---  3016522415

Rate limit reached. Sleeping for: 793
5825  ---  3247181764

5829  ---  52226304

5832  ---  3128980554

5833  ---  64832885

5836  ---  357946817

5837  ---  606659313

5841  ---  130030235

5842  ---  497998934

5843  ---  3070496153

5846  ---  3073449455

5852  ---  45769828

5861  ---  26869755

5865  ---  34937656

5869  ---  133730941

5880  ---  423761993

5888  ---  66700793

5889  ---  37678481

5902  ---  3300049505

5911  ---  54809528

5914  ---  176541019

5918  ---  835927573

5924  ---  1105216934

5926  ---  1439299256

5945  ---  146851693

5946  ---  2335905625

5947  ---  587999842

5952  ---  31767147

5955  ---  2727698562

5956  ---  361478039

5957  ---  3213124239

5963  ---  1325323622

5965  ---  19058164

5966  ---  562020627

5970  ---  251425172

5983  ---  3001842356

5984  ---  2804197693

error caught!
5988  ---  113877406

5996  ---  3002010147

5997  ---  18957376


In [9]:
print len(pruned_followers2)


1198

In [10]:
f = open('pruned_followers2','w')
for follower in pruned_followers2:
    f.write(str(follower)+'\n')
f.close()

In [7]:
pruned_followers3 = prune_followers(uscis_followers[12000:18000], 100, api)


2  ---  93410717

5  ---  335068910

6  ---  590073980

10  ---  39618894

15  ---  70238870

25  ---  87621471

28  ---  113402418

29  ---  378623212

32  ---  1682847373

34  ---  782271006

35  ---  430027306

44  ---  138832910

51  ---  46503479

57  ---  2863944899

58  ---  32846604

66  ---  145236123

67  ---  703234315

68  ---  635350338

85  ---  2333017830

95  ---  2495617093

97  ---  242357402

103  ---  70702909

108  ---  2244126306

115  ---  241503821

118  ---  29370762

119  ---  386874318

121  ---  18574946

125  ---  1158323508

132  ---  22050477

134  ---  522640764

142  ---  184312556

144  ---  743457475

146  ---  360473383

150  ---  719453560

154  ---  285257740

164  ---  2924711160

173  ---  1135228627

175  ---  169650584

193  ---  47605644

Rate limit reached. Sleeping for: 800
204  ---  137389956

205  ---  3293512240

206  ---  11280732

209  ---  959028943

224  ---  2966938900

231  ---  870901824

235  ---  2792257547

248  ---  180943904

249  ---  789137736

255  ---  2357566799

257  ---  2710288991

270  ---  163847135

292  ---  258121190

294  ---  2428781760

297  ---  3025204973

300  ---  17520726

304  ---  16843892

307  ---  14931333

308  ---  107976565

315  ---  56199532

317  ---  23779901

319  ---  326082308

324  ---  2739885542

326  ---  542876051

328  ---  235026585

338  ---  92034833

350  ---  130286664

359  ---  40684584

362  ---  44843167

366  ---  2837674554

367  ---  2901891261

371  ---  88101274

375  ---  153481992

379  ---  133906375

391  ---  16680545

397  ---  21224854

399  ---  133379712

405  ---  1309573123

Rate limit reached. Sleeping for: 809
408  ---  22645467

409  ---  56069132

410  ---  99922331

414  ---  253119192

415  ---  869083922

418  ---  1655921144

422  ---  25227201

432  ---  29121506

440  ---  70530417

441  ---  31214377

473  ---  15627940

480  ---  205119795

484  ---  23169385

499  ---  356344920

521  ---  606955602

522  ---  998259570

525  ---  20840956

536  ---  2907910044

538  ---  3138890201

541  ---  2306589042

549  ---  411008787

550  ---  16002235

555  ---  2316381889

556  ---  3065000120

557  ---  525043657

565  ---  67515881

570  ---  1278802482

571  ---  1599774030

error caught!
576  ---  1237625971

589  ---  3004892850

596  ---  469063308

599  ---  85334883

602  ---  388725925

608  ---  2855112441

Rate limit reached. Sleeping for: 818
613  ---  3008362890

619  ---  518133858

625  ---  2749557316

633  ---  102992914

636  ---  475525943

638  ---  202016902

643  ---  3241114755

649  ---  43059670

650  ---  636295497

652  ---  3194907127

671  ---  632235357

673  ---  15804278

674  ---  490271335

676  ---  52944653

686  ---  287878934

692  ---  526482781

698  ---  141837444

702  ---  388819764

704  ---  12026762

714  ---  106598395

723  ---  1228274948

725  ---  15921852

731  ---  1336401894

733  ---  103607074

737  ---  229857475

743  ---  429264142

744  ---  2913747395

746  ---  34277404

751  ---  158928958

755  ---  243917945

768  ---  3152111108

769  ---  473528082

770  ---  42375637

775  ---  402084110

780  ---  25982946

782  ---  73012466

785  ---  105717070

786  ---  20475954

790  ---  210625529

Rate limit reached. Sleeping for: 826
error caught!
794  ---  136877927

795  ---  153772153

798  ---  88619784

801  ---  20835127

805  ---  2654963936

808  ---  16793684

809  ---  747441085

817  ---  25522532

818  ---  1717557870

823  ---  2432574414

827  ---  81726736

841  ---  2646528416

843  ---  261485286

847  ---  20804220

850  ---  98065688

856  ---  25525509

858  ---  135416398

861  ---  411231531

867  ---  247884304

882  ---  170187289

883  ---  464953921

887  ---  398397468

899  ---  19430999

902  ---  483805107

904  ---  3241373817

907  ---  353263082

913  ---  28819745

927  ---  2192958850

931  ---  413564240

932  ---  108655665

937  ---  85598726

956  ---  161709928

Rate limit reached. Sleeping for: 826
error caught!
983  ---  3111728325

986  ---  619286329

987  ---  228767693

998  ---  491961932

1009  ---  48352760

1019  ---  590220431

1033  ---  188425658

1034  ---  3028368907

1035  ---  1899011731

1042  ---  1624345459

1045  ---  14261019

1046  ---  214354273

1054  ---  2367941126

1064  ---  297103149

1068  ---  22773047

1069  ---  478142135

1070  ---  11426882

1077  ---  288178475

1082  ---  95660680

1094  ---  16986712

1107  ---  180999554

1136  ---  24670130

1139  ---  136490956

1140  ---  2441817153

1142  ---  88136730

1146  ---  2246292648

1149  ---  2337676723

Rate limit reached. Sleeping for: 812
error caught!
1162  ---  211792200

1169  ---  258955992

1178  ---  31155528

1182  ---  168941258

1195  ---  573649158

1200  ---  1094104932

1201  ---  178984488

1208  ---  2810498755

1215  ---  1872485785

1217  ---  176751423

1218  ---  1062966103

1228  ---  43601911

1233  ---  132433919

1236  ---  23630521

1238  ---  387779715

1241  ---  47655439

1244  ---  409170192

1245  ---  91086166

1246  ---  17868347

1248  ---  60631108

1249  ---  105577674

1252  ---  76294840

1264  ---  1229013613

1265  ---  17904807

1267  ---  562208636

1269  ---  291867432

1270  ---  44872292

1271  ---  40434833

1287  ---  1077797526

1290  ---  30912137

1293  ---  62211066

1298  ---  287330562

1299  ---  2920829846

1301  ---  158208256

1307  ---  15425461

1308  ---  484795462

1311  ---  18283237

1313  ---  160075930

1319  ---  103869260

1320  ---  804743064

1322  ---  808335548

Rate limit reached. Sleeping for: 835
1344  ---  12264492

1348  ---  69095442

1366  ---  178472214

1370  ---  82586223

1386  ---  103857202

1391  ---  1921867603

1394  ---  85502734

1395  ---  16569387

1400  ---  56190164

1401  ---  715206258

1402  ---  3232397069

1404  ---  933602161

1409  ---  1216028432

1430  ---  2998709384

1432  ---  32618144

1437  ---  73966538

1440  ---  33923443

1441  ---  2992130177

1446  ---  1302046328

1449  ---  618078902

1468  ---  2379968695

1470  ---  108561656

1478  ---  2798438490

1481  ---  3077399050

1493  ---  458034068

1505  ---  536326829

1507  ---  48316428

1510  ---  609928290

1518  ---  191555965

1521  ---  18548136

1524  ---  382816349

1526  ---  3161294731

1527  ---  285878702

1531  ---  224997417

1532  ---  291285702

1535  ---  84749285

1541  ---  953139150

Rate limit reached. Sleeping for: 825
1548  ---  1283500518

1553  ---  89218194

1557  ---  109545650

1566  ---  10215012

1568  ---  278406445

1570  ---  170644228

1573  ---  1544868931

1574  ---  35818036

1578  ---  73069536

1587  ---  119444905

1588  ---  5542352

1602  ---  2537930084

1604  ---  217134577

1605  ---  154573594

1606  ---  598010927

1607  ---  3130736343

1611  ---  848378072

1618  ---  314618810

1619  ---  1088032854

1623  ---  224890777

1628  ---  2333008075

1629  ---  109159443

1635  ---  67765647

1638  ---  1015966484

1642  ---  1540037090

1652  ---  394788738

1653  ---  482200141

1658  ---  377242614

1659  ---  2260150651

1666  ---  102775218

1671  ---  162092824

1685  ---  108729681

1689  ---  2568849966

1701  ---  26115411

1703  ---  189050486

1704  ---  1175175056

1705  ---  2929989195

1717  ---  116150073

1721  ---  54355001

1726  ---  2150376527

1733  ---  248775510

1736  ---  2265209108

1740  ---  850312039

1741  ---  18574332

1769  ---  260388200

1774  ---  84320588

1776  ---  1905212462

1787  ---  63934874

1789  ---  3076253280

1794  ---  322518708

1803  ---  384339993

1806  ---  283867875

1814  ---  50001581

1815  ---  622189004

1819  ---  217225558

1838  ---  525343252

1840  ---  81301554

1843  ---  501396509

1844  ---  3193650322

1851  ---  837612758

1852  ---  498620895

1853  ---  38979552

error caught!
1868  ---  290235271

1874  ---  117284411

Rate limit reached. Sleeping for: 753
1880  ---  195498168

1881  ---  2941095644

1886  ---  490264232

1908  ---  284539556

1911  ---  18626580

1916  ---  3022895923

1917  ---  1470386125

1920  ---  78908871

1928  ---  1491670812

1938  ---  1975232922

1949  ---  2374835294

1955  ---  2881424443

1959  ---  54376297

1962  ---  60791252

1966  ---  1192721

1969  ---  39733569

1970  ---  2260467313

1971  ---  342148314

1978  ---  1462897848

1979  ---  2314810082

1980  ---  103320931

1988  ---  148780843

1999  ---  2888840463

2013  ---  42651268

2016  ---  263351049

2020  ---  1594051026

2021  ---  237507666

2034  ---  3169052900

2041  ---  481389596

2042  ---  424600929

2045  ---  34612898

2053  ---  2277977005

2063  ---  2877158969

2064  ---  168580238

2067  ---  271763840

2069  ---  21556662

2070  ---  1462695746

2079  ---  1139567186

2082  ---  32867032

Rate limit reached. Sleeping for: 817
2086  ---  21395218

2087  ---  2272193148

2093  ---  44004902

2094  ---  126621307

2096  ---  3075122125

2098  ---  94355297

error caught!
2112  ---  2534281844

2124  ---  275614832

2125  ---  71579777

2140  ---  2194858188

2141  ---  1928238984

2152  ---  71528421

2155  ---  1440363926

2156  ---  1289485256

2158  ---  30196977

2161  ---  158779748

2167  ---  141274504

2175  ---  319984225

2183  ---  24852153

2186  ---  100338263

2188  ---  262207088

2193  ---  18066617

2194  ---  3191075369

2201  ---  108739363

2210  ---  84743906

2219  ---  73624511

2225  ---  49369339

2228  ---  529135459

2231  ---  2896267537

2233  ---  32636723

2234  ---  260070979

2238  ---  129711716

2242  ---  979632349

2248  ---  30405096

2253  ---  529767422

2264  ---  79433442

2268  ---  2279684977

2275  ---  29644224

2280  ---  30702053

2283  ---  18721632

2292  ---  30934601

2299  ---  3162121309

2336  ---  23580744

2339  ---  234230815

2348  ---  633845591

2361  ---  100293824

2362  ---  321087617

2371  ---  3150800431

2377  ---  377443190

2380  ---  3083087059

2385  ---  1337329969

2414  ---  2188208672

2423  ---  2888157287

2424  ---  15350593

2425  ---  389847782

2428  ---  554558159

Rate limit reached. Sleeping for: 769
2442  ---  19263524

2443  ---  149435922

2445  ---  3098326477

2451  ---  517284966

2463  ---  1154965129

2464  ---  85540281

2473  ---  52602656

2488  ---  212702652

2489  ---  296665817

2498  ---  344491490

2500  ---  91947060

2504  ---  269225151

2510  ---  53129825

2511  ---  57351581

error caught!
2528  ---  140108446

2533  ---  840345805

2542  ---  23982318

2543  ---  2314928630

2544  ---  117612069

2552  ---  434121207

2558  ---  176134160

2561  ---  2167650290

2568  ---  1328016134

2576  ---  124471876

2581  ---  27935905

2583  ---  23965180

2588  ---  1372579260

2597  ---  3167914575

2604  ---  344968918

2605  ---  285401666

2617  ---  10054122

2618  ---  49057437

2623  ---  5676332

2628  ---  163888921

2633  ---  2173045921

2634  ---  101806273

2638  ---  17049551

2640  ---  115354424

2645  ---  304149355

2649  ---  25874921

2655  ---  2157475512

2661  ---  826843255

2662  ---  1121426060

2665  ---  25174693

2668  ---  127865026

2671  ---  131613558

2679  ---  37308727

2680  ---  1033460304

2683  ---  135755862

2700  ---  146158763

2701  ---  194625002

2706  ---  149682879

2711  ---  5839912

2719  ---  600085921

2726  ---  143077013

2729  ---  2521595034

2730  ---  139457707

2732  ---  2302621952

2735  ---  140069461

2749  ---  69560348

2751  ---  586598255

2754  ---  58606634

2756  ---  2326121288

2758  ---  700742535

2764  ---  139594686

2765  ---  1877943564

2767  ---  290859908

2781  ---  26033515

2785  ---  50560449

2786  ---  143385557

Rate limit reached. Sleeping for: 737
error caught!
2791  ---  215206475

2792  ---  136635245

2804  ---  428712617

2828  ---  15111399

2831  ---  71662536

2836  ---  239063378

2840  ---  2651233652

2841  ---  18204778

2842  ---  166992490

2847  ---  129228834

2857  ---  15578163

2872  ---  56829986

2876  ---  14321097

2877  ---  348392371

2887  ---  38394696

2896  ---  1278489812

2904  ---  47044491

2908  ---  245439137

2909  ---  453896269

2914  ---  169800469

2928  ---  149030653

2930  ---  361371125

2931  ---  9400592

2935  ---  138128605

2946  ---  323830943

2958  ---  1515453192

2973  ---  31604697

2975  ---  19348785

2979  ---  1711179192

2980  ---  84830312

2982  ---  92342663

2983  ---  150000935

2984  ---  68378825

2988  ---  199222143

2994  ---  74799185

2997  ---  96072521

2999  ---  16334908

3010  ---  35722709

3011  ---  14082083

3012  ---  102894889

3013  ---  296662334

3016  ---  154787383

3017  ---  529894614

3024  ---  492426429

3026  ---  133163951

3027  ---  1499189214

3030  ---  66607635

3034  ---  47550573

3043  ---  385579385

3050  ---  199443333

3056  ---  108565168

Rate limit reached. Sleeping for: 775
3060  ---  64661126

3063  ---  18835199

3065  ---  43983505

3067  ---  922237320

3071  ---  759218486

3074  ---  161383633

3082  ---  30620583

3083  ---  37185647

3084  ---  57995433

3085  ---  78548738

3093  ---  56272637

3095  ---  83844504

3096  ---  117443535

3100  ---  109764961

3106  ---  93122938

3109  ---  128272649

3110  ---  147950988

3115  ---  240559164

3117  ---  42015609

3122  ---  254650745

3124  ---  296675762

3131  ---  96540683

3137  ---  134002437

3138  ---  14371818

3142  ---  84100057

3147  ---  224117080

3148  ---  151266382

3150  ---  49551653

3151  ---  106366408

3152  ---  15053332

3157  ---  16416919

3158  ---  252916733

3161  ---  375731095

3164  ---  320805687

3168  ---  100311459

3172  ---  58190126

3173  ---  398785845

3180  ---  299511757

3182  ---  85610149

3187  ---  113076988

3190  ---  438442015

3192  ---  38819882

3198  ---  16522342

3207  ---  51378594

3208  ---  69518165

3215  ---  278094474

3216  ---  760126434

3217  ---  110187912

3222  ---  80321272

3227  ---  207516288

3231  ---  89188038

3236  ---  1609235778

3238  ---  403936481

3240  ---  1317175638

3242  ---  39989655

3246  ---  2684211

3248  ---  335594103

Rate limit reached. Sleeping for: 809
error caught!
3266  ---  508842197

3270  ---  216295406

3273  ---  40242043

3278  ---  322974203

3279  ---  140698599

3281  ---  188259268

3286  ---  230790736

3287  ---  17705171

3290  ---  1417154648

3294  ---  445874135

3296  ---  8617122

3298  ---  151892161

3302  ---  30186240

3308  ---  52679922

3311  ---  69606045

3315  ---  2724617600

3317  ---  164967724

3318  ---  292915214

3329  ---  131827449

3334  ---  15955870

3335  ---  48262389

3341  ---  119892433

3351  ---  3150893420

3353  ---  49644786

3356  ---  39969482

3369  ---  550765557

3380  ---  253357301

3392  ---  123364385

3396  ---  2780773370

3400  ---  35265625

3405  ---  140524178

3406  ---  139735869

3413  ---  21985739

3416  ---  75557604

3419  ---  229192109

3426  ---  714491399

3442  ---  73295496

3443  ---  115642740

3449  ---  7104402

3451  ---  438615503

3452  ---  3112023432

3457  ---  801285889

3458  ---  2466518126

3461  ---  2556541892

3473  ---  2479745490

3490  ---  132047877

3499  ---  69660252

3500  ---  44791757

3502  ---  443185963

3505  ---  882039594

Rate limit reached. Sleeping for: 805
error caught!
3515  ---  399253408

3516  ---  89580708

3519  ---  426403490

3524  ---  323540783

3531  ---  3091042459

3532  ---  364171758

3535  ---  43780072

3536  ---  64247368

3545  ---  585464719

3547  ---  517221501

3548  ---  14971440

3558  ---  368821578

3560  ---  130790171

3569  ---  85745763

3572  ---  1468758176

3573  ---  20837449

3580  ---  148137609

3603  ---  44577722

3606  ---  3008418704

3609  ---  303314515

3619  ---  86247689

3620  ---  7099952

3624  ---  2248135972

3626  ---  341465633

3631  ---  2413467324

3634  ---  52082817

3635  ---  561452697

3653  ---  154653109

3654  ---  1674818360

3678  ---  562241283

3682  ---  22751270

3686  ---  30732508

3691  ---  248419757

3696  ---  130299343

3697  ---  177084100

3700  ---  551676972

3705  ---  44638776

3712  ---  28689796

3713  ---  75189141

3716  ---  1099296103

3722  ---  861591595

3724  ---  721132974

3725  ---  16637144

3736  ---  56997244

3746  ---  140336345

Rate limit reached. Sleeping for: 788
error caught!
3756  ---  74414255

3759  ---  56081792

3769  ---  79357932

3787  ---  141551238

3791  ---  255945960

3798  ---  102011929

3805  ---  84285971

3811  ---  14976129

3818  ---  40591776

3821  ---  118142243

3823  ---  72391662

3831  ---  30780538

3832  ---  922987122

3842  ---  1977815706

3844  ---  303462482

3845  ---  37971790

3847  ---  19608297

3860  ---  390556857

3861  ---  88836129

3863  ---  1388279244

3880  ---  801198666

3882  ---  45657799

3890  ---  37164018

3901  ---  56015195

3903  ---  15575902

3905  ---  481811559

3906  ---  15113902

3913  ---  81093667

3922  ---  3149108788

3925  ---  26982881

3931  ---  42723399

3933  ---  36039745

3955  ---  1113553112

3963  ---  18848966

3967  ---  17574790

3974  ---  2151414217

3980  ---  14324627

3983  ---  3130711503

3986  ---  430519074

Rate limit reached. Sleeping for: 795
3991  ---  266791168

3993  ---  261742185

3994  ---  26373855

4002  ---  103756820

4006  ---  2794155689

4017  ---  12158582

4019  ---  215231954

error caught!
4032  ---  133231557

4048  ---  123950483

4049  ---  415263631

4071  ---  292728751

4074  ---  2960254795

4086  ---  135787578

4093  ---  2268344924

4101  ---  65865411

4115  ---  2851451859

4121  ---  25703406

4123  ---  2752477352

4124  ---  133794380

4144  ---  60774837

4153  ---  21808061

4160  ---  64344330

4162  ---  2384801245

4172  ---  41315823

4178  ---  155615924

4179  ---  157338743

4181  ---  205601282

4184  ---  225671549

4190  ---  2240744275

4193  ---  348380216

4194  ---  110358179

4202  ---  94309234

4216  ---  1380854948

4246  ---  143452931

4250  ---  43188441

4251  ---  187135839

4253  ---  66676764

4270  ---  69560640

4282  ---  136738038

4289  ---  1072828093

4295  ---  25149701

4299  ---  140853023

4309  ---  761670847

4325  ---  2725191278

4328  ---  31125377

4329  ---  480796632

4343  ---  15697791

Rate limit reached. Sleeping for: 737
error caught!
Rate limit reached. Sleeping for: 66
4351  ---  78361492

4358  ---  169631459

4361  ---  704894406

4363  ---  75649430

4373  ---  9909682

4374  ---  64482350

4380  ---  282449194

4397  ---  137668557

4399  ---  119993350

4400  ---  143079658

4401  ---  191450982

4412  ---  122103799

4413  ---  1687866966

4417  ---  75264459

4422  ---  106015578

4423  ---  65599747

4424  ---  79471444

error caught!
4429  ---  881604271

4431  ---  61775158

4432  ---  204836333

4444  ---  14138079

4451  ---  18071071

4452  ---  94379211

4465  ---  18605439

4469  ---  105409538

4473  ---  60285578

4475  ---  26635865

4477  ---  94849381

4494  ---  80409948

4505  ---  83317369

4507  ---  103899243

4511  ---  1177014836

4515  ---  506849583

4517  ---  260917477

4527  ---  127145565

4532  ---  164458111

4537  ---  820863578

4539  ---  126964152

4540  ---  833408257

4541  ---  142812565

4543  ---  2201031398

4546  ---  149055799

4547  ---  50938960

4548  ---  372464819

4550  ---  36058395

4557  ---  70998375

4558  ---  63118828

4565  ---  1049734093

4568  ---  211448020

4574  ---  227193165

Rate limit reached. Sleeping for: 792
4582  ---  3018187371

4584  ---  51342663

4596  ---  17477005

4597  ---  187097371

4598  ---  141842622

4604  ---  63995517

4616  ---  133209123

4618  ---  16568084

4619  ---  260459944

4621  ---  163165384

4624  ---  44983389

4631  ---  3090280866

4633  ---  3116406727

4641  ---  244835198

4642  ---  161924841

4645  ---  84405901

4649  ---  1421019432

4654  ---  80489425

4670  ---  280501683

4679  ---  166255015

4683  ---  35892421

4691  ---  1566556656

4702  ---  683413

4703  ---  183278283

4705  ---  1581976488

4708  ---  849126716

4709  ---  84629230

4712  ---  2210594991

4715  ---  1563889788

4718  ---  221883614

4721  ---  89497546

4726  ---  14132988

4733  ---  16479390

4739  ---  117684853

4744  ---  1145313865

4746  ---  33457598

4748  ---  22142031

4753  ---  52033965

4754  ---  192651996

4758  ---  454147475

4764  ---  1120347764

4766  ---  17748849

4768  ---  41516848

4772  ---  134050144

4775  ---  14608539

4778  ---  139497097

4787  ---  358587751

4792  ---  38529785

4795  ---  279226864

4816  ---  14569987

4824  ---  2748624149

4849  ---  21795879

4854  ---  175104819

4857  ---  34635984

4859  ---  598157131

4860  ---  130074112

4864  ---  1023167005

4866  ---  555511077

4868  ---  449335776

4870  ---  2782474562

4888  ---  50237699

4902  ---  858965766

4903  ---  134900179

4907  ---  130422858

4917  ---  219654102

4919  ---  287951014

4921  ---  184475264

Rate limit reached. Sleeping for: 739
4928  ---  63640432

4939  ---  86989599

4943  ---  783552200

4947  ---  2283565724

4954  ---  42727314

4963  ---  106972252

4969  ---  1625867324

4971  ---  14321397

4975  ---  272706578

4982  ---  50380011

4992  ---  2797015780

4994  ---  50654041

5004  ---  154184964

5006  ---  59676379

5010  ---  16546329

5013  ---  86296964

5018  ---  2377298803

5021  ---  70305899

5023  ---  146913289

5025  ---  173977314

5026  ---  542976220

5032  ---  1425983455

5033  ---  2288025055

5041  ---  515928677

5048  ---  65948965

5049  ---  374176835

5050  ---  297700544

5052  ---  426407575

5054  ---  472581276

5055  ---  145453010

5056  ---  1643752568

5064  ---  1137751340

5066  ---  905188310

5068  ---  3111932987

5071  ---  1427987923

5072  ---  133529757

5078  ---  2787206519

5085  ---  79386645

5089  ---  47242873

5092  ---  160671812

5095  ---  546839063

5105  ---  1947303967

5107  ---  81800276

5110  ---  7556162

5111  ---  149706421

5117  ---  607075237

Rate limit reached. Sleeping for: 816
5119  ---  624029228

5125  ---  8167392

5127  ---  57950606

5130  ---  125297188

5149  ---  84674585

5154  ---  117680347

5157  ---  3005610710

5160  ---  372948744

5164  ---  847430623

5166  ---  70160882

5167  ---  401163540

5168  ---  104173075

5169  ---  141543369

5170  ---  44124014

5174  ---  2285984991

5180  ---  146373642

5182  ---  279575100

5184  ---  80986914

5186  ---  171747801

5201  ---  103580524

5202  ---  213119979

5213  ---  183021272

5218  ---  52431491

5221  ---  18813135

5223  ---  612844121

5232  ---  16315177

5233  ---  231433153

5238  ---  1388525719

5239  ---  2782966176

5240  ---  161000256

5249  ---  31536884

5252  ---  120739537

5254  ---  21205586

5261  ---  3013223133

5265  ---  113714375

5275  ---  66544413

5281  ---  59877759

5282  ---  1149714595

5294  ---  2984305514

5298  ---  3058369821

5306  ---  756750992

5307  ---  2438288814

5308  ---  276095098

5312  ---  50944040

5313  ---  146445558

5315  ---  2456768010

error caught!
5321  ---  15841928

5326  ---  966752198

5327  ---  370702177

5332  ---  773600556

5333  ---  2973256793

Rate limit reached. Sleeping for: 820
error caught!
5339  ---  24026618

5341  ---  134272046

5343  ---  1112486646

5344  ---  3044606175

5348  ---  3021491215

5351  ---  2431405495

5352  ---  278965019

5354  ---  2271082352

5355  ---  2341577987

5356  ---  49922973

5359  ---  517922853

5363  ---  122367441

5364  ---  134891251

5368  ---  1026842708

5375  ---  79518372

5395  ---  795305972

5402  ---  2959975508

5403  ---  349852169

5413  ---  84324001

5416  ---  112080775

5417  ---  29474581

5419  ---  33852562

5421  ---  3115814021

5422  ---  765108673

5425  ---  144363539

5429  ---  23797097

5438  ---  2916925279

5442  ---  37296872

5443  ---  26510316

5449  ---  15827862

5452  ---  365198186

5461  ---  37131103

5465  ---  283902152

5473  ---  173237327

5476  ---  135382584

5481  ---  74298835

5486  ---  28760818

5499  ---  1334943186

5505  ---  97528480

5507  ---  253589441

5509  ---  488314788

5510  ---  428584066

5521  ---  366346878

5525  ---  316250057

5535  ---  1322914280

5543  ---  1075589179

5547  ---  495497487

5552  ---  18794010

5555  ---  15986899

5564  ---  48610592

5567  ---  21562527

Rate limit reached. Sleeping for: 816
5570  ---  434329829

5573  ---  317155780

5578  ---  91131353

5580  ---  387402174

5584  ---  135670617

5585  ---  2258257694

5592  ---  44624465

5593  ---  2358140324

5594  ---  84395507

5595  ---  2829417677

5598  ---  2877857877

5603  ---  180887297

5605  ---  3082615523

5608  ---  2765936032

5609  ---  12474482

5611  ---  156098253

5614  ---  43152303

5619  ---  3100163256

5626  ---  3100080881

5631  ---  845485626

5636  ---  118905218

5637  ---  2731871677

5644  ---  2986245298

5653  ---  2234969922

5673  ---  456860225

5674  ---  3060601913

5683  ---  41527198

5686  ---  293909474

5694  ---  67278167

5695  ---  44158260

5702  ---  205069128

5703  ---  15633209

5709  ---  100046757

5714  ---  171017638

5715  ---  625362633

5734  ---  2394856766

5746  ---  206762115

5753  ---  3085781111

5758  ---  120058577

5761  ---  2185892041

5765  ---  19279747

5774  ---  470618137

5775  ---  2161994878

5780  ---  118763519

5781  ---  489009982

5783  ---  256747411

5785  ---  3094555903

5787  ---  2839846846

5793  ---  53326238

5795  ---  3007166604

Rate limit reached. Sleeping for: 815
5800  ---  1108257234

5803  ---  436920867

5812  ---  15857073

5815  ---  98579138

5824  ---  3085120152

5826  ---  947527303

5840  ---  142818857

5854  ---  249531778

5855  ---  2773274334

5856  ---  54234610

5861  ---  162694386

5870  ---  46493683

5883  ---  211705910

error caught!
5891  ---  820740774

5893  ---  2484335071

5902  ---  79402488

5905  ---  243702908

5911  ---  50226460

5916  ---  219537525

5920  ---  21906543

5924  ---  803888958

5933  ---  43034334

5941  ---  75580689

5944  ---  759897007

5959  ---  3074577992

5962  ---  51312569

5964  ---  124767892

5966  ---  1323716664

5968  ---  3038439360

5969  ---  224887388

5972  ---  2876690446

5975  ---  359597288

5985  ---  2879622192

5988  ---  1192693070

5997  ---  309994532


In [8]:
f = open('pruned_followers3','w')
for follower in pruned_followers3:
    f.write(str(follower)+'\n')
f.close()

In [9]:
len(pruned_followers3)


Out[9]:
1155

In [ ]:
#pruned_followers4 = prune_followers(uscis_followers[18000:24000], 100, api)

In [ ]:
#pruned_followers5 = prune_followers(uscis_followers[24000:30000], 100, api)

In [ ]:
#pruned_followers6 = prune_followers(uscis_followers[30000:36000], 100, api)

In [ ]:
#pruned_followers7 = prune_followers(uscis_followers[36000:42000], 100, api)

In [ ]:
#pruned_followers8 = prune_followers(uscis_followers[42000:48000], 100, api)

In [ ]:
#pruned_followers9 = prune_followers(uscis_followers[48000:54000], 100, api)

In [ ]:
#pruned_followers10 = prune_followers(uscis_followers[54000:60000], 100, api)

In [ ]:
#pruned_followers11 = prune_followers(uscis_followers[60000:], 100, api)

In [34]:
pruned_followers1 = []

f = open('pruned_followers1','r')
for line in f:
    if not line.isspace():
        pruned_followers1.append(line)
f.close()

In [35]:
len(pruned_followers1)


Out[35]:
1140

In [8]:
def get_and_save_tweets_one_user(user_id, api):
    all_tweets = get_all_tweets(user_id, api)
    f = open (TWEET_PATH + str(user_id) , 'w')
    pickle.dump(all_tweets, f)
    f.close

In [9]:
def get_and_save_tweets_all_users(followers_pruned_id, api):
    for id in followers_pruned_id:
        try:
            get_and_save_tweets_one_user(id, api)
            print 'tweets of ' , id , 'were saved!' 
        except:
            print '*******************************'
            print '*******************************'
            print '         EXCEPTION! '
            print 'in id: ', id
            print '*******************************'
            print '*******************************'

In [10]:
def get_user_ids_Twetter_folder():
    all_followers = []
    for dirs, root, files in os.walk(TWEET_PATH):
        for file in files:
            if not file.startswith('.'):
                all_followers.append(file) 
    return all_followers

In [ ]:
#get_and_save_tweets_all_users(pruned_followers1, api)

In [11]:
all_followers = get_user_ids_Twetter_folder()

In [12]:
len(all_followers)


Out[12]:
1167

In [14]:
class User_Tweet(object):

    def __init__(self,date,text,country):
        self.date = date
        self.text = text
        self.country = country
    
    def __cmp__(self,other):
        if self.date < other.date:
            return -1
        elif self.date == other.date:
            return 0
        else:
            return 1

In [19]:
def create_user_timelines_dic(followers_ids):
    
    users_timelines = {}
    
    for user_id in followers_ids:
        
        user_id.replace('\n','')
        
        timeline = []
        
        try:
            
            file_name = TWEET_PATH + str(user_id)
            f = open(file_name,'r')
            tweets = pickle.load(f)
            f.close()

            for tweet in tweets:
                if tweet.place is not None:
                    user_tweet = User_Tweet(tweet.created_at,tweet.text,tweet.place.country)
                    timeline.append(user_tweet)

            users_timelines[user_id] = timeline
            
        except:
            print 'Error caught and prevented interruption'
            continue
        
    return users_timelines

In [15]:
users_timelines = create_user_timelines_dic(all_followers)


Error caught and prevented interruption

In [27]:
class Immigrant(object):

    def __init__(self,user_id, immigration_date,tweets,source_country,destination_country, duration):
        self.user_id = user_id
        self.immigration_date = immigration_date
        self.tweets = tweets
        self.source_country = source_country
        self.destination_country = destination_country
        self.duration = duration

    def display(self):
        print '**********************************'
        print 'user id:', self.user_id
        print '# of tweets', len(self.tweets)
        print 'immigrated from: ', self.source_country
        print 'to: ', self.destination_country
        print 'at:', self.immigration_date
        print 'for', self.duration, 'days'
        print '**********************************'

In [28]:
def find_immigrants(users_timelines):
    
    immigrants = []
    
    for user_id in users_timelines:
        timeline = users_timelines[user_id]
        sorted_timeline = sorted(timeline)
    
        countries = []
        for user_tweet in sorted_timeline:
            if user_tweet.country not in countries:
                countries.append(user_tweet.country)
            
        if (len(countries) > 1):
            if sorted_timeline[-1].country == countries[-1]:

                #find the time of last tweet in the previous country
                i = len(sorted_timeline) - 1
                last_tweet_previous_country = sorted_timeline[i]
                while(last_tweet_previous_country.country != countries[-2]):
                    i = i - 1
                    last_tweet_previous_country = sorted_timeline[i]
                
                duration = sorted_timeline[-1].date - last_tweet_previous_country.date
            
                if duration.days > 90:
                    
                    #We found an immigrant! 
                    
                    #lets reload ALL his/her tweet:
                    file_name = TWEET_PATH + str(user_id)
                    f = open(file_name,'r')
                    tweets = pickle.load(f)
                    f.close()
                    
                    #now lets build him/her:
                    immigrant = Immigrant(user_id, 
                                          last_tweet_previous_country.date, 
                                          tweets, 
                                          last_tweet_previous_country.country, 
                                          sorted_timeline[-1].country,
                                          duration.days)
                    #immigrant.display()
                    immigrants.append(immigrant)
    return immigrants

In [18]:
immigrants = find_immigrants(users_timelines)

In [19]:
print len(immigrants)


45

In [20]:
#write immigrant ids into a file
f = open('immigrant_ids11','w')
for immigrant in immigrants:
    f.write(immigrant.user_id)
f.close()

In [21]:
#dump entire immigrants objects into a file
f = open('immigrants_objects11', 'w')
pickle.dump(immigrants, f)
f.close()

In [22]:
#read all immigrants (full objects) from a file
f = open('immigrants_objects11', 'r')
all_immigrants = pickle.load(f)
f.close()
print len(all_immigrants)


45

In [23]:
def get_tweets_after_immigration(immigrant):
    tweets = []
    for tweet in immigrant.tweets:
        if(tweet.created_at > immigrant.immigration_date):
            tweets.append(tweet)
    return tweets

In [24]:
def get_tweets_before_immigration(immigrant):
    tweets = []
    for tweet in immigrant.tweets:
        if(tweet.created_at <= immigrant.immigration_date):
            tweets.append(tweet)
    return tweets

In [25]:
def tokenize(string, lowercase, keep_punctuation, prefix, collapse_urls, collapse_mentions):
    if not string:
        return []
    if lowercase:
        string = string.lower()
    tokens = []
    if collapse_urls:
        string = re.sub('http\S+', 'THIS_IS_A_URL', string)
    if collapse_mentions:
        string = re.sub('@\S+', 'THIS_IS_A_MENTION', string)
    if keep_punctuation:
        tokens = string.split()
    else:
        tokens = re.sub('\W+', ' ', string).split()
    if prefix:
        tokens = ['%s%s' % (prefix, t) for t in tokens]
    return tokens

In [26]:
#Separate all tweets of all immigrants based on being tweeted after or before the immigration 
#Label tweets and return labels as second values
def get_all_tweet_texts_of_all_immigrants(all_immigrants):
    
    all_tweet_texts = []
    labels = []
    
    for immigrant in all_immigrants:

        tweets_after_immigration = get_tweets_after_immigration(immigrant)
        tweets_before_immigration = get_tweets_before_immigration(immigrant)    
    
        for tweet in tweets_before_immigration:
            #Remove stop words:
            text = ' '.join([word for word in tweet.text.split() if word not in cachedStopWords])            
            all_tweet_texts.append(text)
            labels.append(0)
            
        for tweet in tweets_after_immigration:
            #Remove stop words:
            text = ' '.join([word for word in tweet.text.split() if word not in cachedStopWords])
            all_tweet_texts.append(text)
            labels.append(1)

    return all_tweet_texts, np.array(labels)

In [27]:
all_tweet_texts, labels = get_all_tweet_texts_of_all_immigrants(all_immigrants)

In [28]:
def do_vectorize(data, tokenizer_fn=tokenize, min_df=1, max_df=1., binary=True, ngram_range=(1,1)):
    vectorizer = CountVectorizer(input='content', min_df = 2, binary = False, ngram_range = (1,2))
    X = vectorizer.fit_transform(data)
    return X.tocsr(), vectorizer

In [29]:
X, vec = do_vectorize(all_tweet_texts)

In [30]:
def select_features(X, y, vec, number_of_features = 100, threshold_rate = 40):

    chi, pvals = chi2(X,y)
    feats = vec.get_feature_names()
    features = {}

    rate = threshold_rate
    for i in np.argsort(chi)[::-1]:
        
        #Ignore independet features:
        if chi[i] == 0.00:
            break
            
        #select features that have frequency larger than threshhold rate (set in rate value)
        my_count = Counter(y[np.where(X[:, i].T.toarray()[0]>=1)])
        if my_count[1] > my_count[0] and my_count[0] != 0 and (my_count[1] * 1.0)/my_count[0] > rate:
            feat_rate = (my_count[1] * 1.0)/my_count[0]
            features[feats[i]] = feat_rate
            
    keywords = [i for i in dict(sorted(features.items(), key=lambda x: x[1]))]
    return keywords[-number_of_features : ]

In [31]:
features = select_features(X,labels,vec, 50)

In [32]:
print features


[u'\u0631\u062d\u0645\u062a\u0643', u'\u0644\u064a', u'khaama', u'notihispano', u'hillaryclinton', u'\u0628\u062e\u064a\u0631', u'\u0646\u0641\u0633\u064a', u'reading tweets', u'\u0627\u0644\u0644\u0647\u0645 \u0625\u0646\u064a', u'recover', u'tiasafaris', u'insight', u'sweetlovemsg', u'almeida__rani', u'\u0642\u0644\u0628', u'\u0644\u064a\u0644\u0629', u'rt dreamelder', u'rt sweetlovemsg', u'dreamers', u'trauma', u'\u0639\u0628\u062f\u0643', u'real time', u'dreamelder', u'\u0627\u0644\u0631\u062d\u064a\u0645', u'\u0639\u0644\u0645', u'\u0642\u0644\u0628\u064a', u'\u0625\u0646\u0643 \u0623\u0646\u062a', u'\u0646\u0641\u0633', u'\u0648\u0645\u0646', u'euic', u'rt khaama', u'representing', u'recent', u'\u0625\u0644\u064a\u0647\u0627', u'gt https', u'asesoriasit dianasiachoquec', u'austin', u'thanks follow', u'tweet day', u'univision62', u'\u0642\u0648\u0644', u'orlando', u'\u062a\u062c\u0639\u0644', u'intthings', u'\u0625\u0646\u064a', u'eta', u'ahora_si']

In [29]:
#input: immigrants_filename: a file with immigrant Twitter IDs in each line
def get_immigrants_objects(immigrants_filename):
    immigrant_ids = []
    f = open(immigrants_filename, 'r')
    for line in f:
        immigrant_ids.append(line)
    f.close()
    
    print 'found ', len(immigrant_ids), ' immigrant twitter accounts'
    print 'building array immigrants objects'
    
    users_timelines = create_user_timelines_dic(immigrant_ids)
    immigrants = find_immigrants(users_timelines)
    
    print 'done!'
    
    return immigrants

In [30]:
immigrants = get_immigrants_objects('immigrant_ids11')


found  45  immigrant twitter accounts
building array immigrants objects
done!

In [82]:
def get_country_freq(immigrants):
    source_countries = {}
    destination_countries = {}
    src_dests = {}
    for immigrant in immigrants: 
        src = immigrant.source_country
        dest = immigrant.destination_country
        src_dest = src + ' -> ' + dest

        if src in source_countries:
            source_countries[src] += 1
        else: 
            source_countries[src] = 1
        
        if dest in destination_countries:
            destination_countries[dest] += 1
        else: 
            destination_countries[dest] = 1
            
        if src_dest in src_dests:
            src_dests[src_dest] += 1
        else:
            src_dests[src_dest] = 1
 
    source_countries = sorted(source_countries.items(), key=operator.itemgetter(1), reverse=True)
    destination_countries = sorted(destination_countries.items(), key=operator.itemgetter(1), reverse=True)
    src_dests = sorted(src_dests.items(), key=operator.itemgetter(1), reverse=True)

    print 'Top 5 Source Countries: '
    for (country,freq) in source_countries[:5]:
        print '  ', country, freq
    
    print 
    print 'Top 5 Destination Countries: '
    for (country,freq) in destination_countries[:5]:
        print '  ', country, freq
        
    print 
    print 'Top 5 source->destination'
    for (path, freq) in src_dests[:5]:
        print '  ', path, freq

In [83]:
get_country_freq(immigrants)


Top 5 Source Countries: 
   United States 9
   México 8
   भारत 3
   Brasil 3
   United Kingdom 3

Top 5 Destination Countries: 
   United States 29
   México 3
   Canada 2
   United Kingdom 2
   भारत 2

Top 5 source->destination
   México -> United States 7
   United States -> México 3
   भारत -> United States 3
    -> United States 2
   Türkiye -> United States 2

In [ ]: