Index: trunk/extensions/MetavidWiki/maintenance/scrape_and_insert.inc.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | if ( !$this->streams[$stream_name]->doesStreamExist() ) { |
48 | 48 | die( 'error: stream ' . $stream_name . ' does not exist' ); |
49 | 49 | } |
50 | | - print "Proccessing Stream: $stream_name \n"; |
| 50 | + print "processing Stream: $stream_name \n"; |
51 | 51 | } |
52 | 52 | } |
53 | 53 | } |
— | — | @@ -350,7 +350,7 @@ |
351 | 351 | $bill_key = trim( $debate_matches[1] ); |
352 | 352 | print "found debate: tag " . $bill_key . "\n"; |
353 | 353 | // build gov-track-congress-session friendly debate url: |
354 | | - if ( $this->get_and_proccess_billid( $bill_key, $stream->date_start_time ) != null ) { |
| 354 | + if ( $this->get_and_process_billid( $bill_key, $stream->date_start_time ) != null ) { |
355 | 355 | $bill_categories[$bill_key] = $bill_key; |
356 | 356 | } |
357 | 357 | } |
— | — | @@ -404,7 +404,7 @@ |
405 | 405 | // conform white space and case: |
406 | 406 | $bill_name = str_replace( array( 'S. ', 'Con. ', 'Res. ' ), array( 'S.', 'CON.', 'RES. ' ), $bill_name ); |
407 | 407 | // make sure its not a false possitave and load bill data from govTrack: |
408 | | - if ( $this->get_and_proccess_billid( $bill_name, $stream->date_start_time ) ) { |
| 408 | + if ( $this->get_and_process_billid( $bill_name, $stream->date_start_time ) ) { |
409 | 409 | $bill_categories[$bill_name] = $bill_name; |
410 | 410 | } |
411 | 411 | } |
— | — | @@ -454,7 +454,7 @@ |
455 | 455 | print "failed to update restrictions :(\n"; |
456 | 456 | } |
457 | 457 | |
458 | | - // proccess each bill to the annotation body; |
| 458 | + // process each bill to the annotation body; |
459 | 459 | $bcat = ''; |
460 | 460 | $bill_lead_in = "\n\nBill "; |
461 | 461 | // print_r($bill_categories); |
— | — | @@ -575,7 +575,7 @@ |
576 | 576 | print "GOT openCon id: $openCongBillId from $bill_key\n"; |
577 | 577 | print "GOT mapLight id: $mapLightBillId from $bill_key\n"; |
578 | 578 | if ( $govTrackBillId ) { |
579 | | - $this->proccessBill( $govTrackBillId, $bill_key, $openCongBillId, $mapLightBillId ); |
| 579 | + $this->processBill( $govTrackBillId, $bill_key, $openCongBillId, $mapLightBillId ); |
580 | 580 | $this->govTrackBillId = $govTrackBillId; |
581 | 581 | return $this->govTrackBillId; |
582 | 582 | } else { |
— | — | @@ -606,7 +606,7 @@ |
607 | 607 | return false; |
608 | 608 | } |
609 | 609 | } |
610 | | - function proccessBill( $govTrackBillId, $bill_key, $openCongBillId = false, $mapLightBillId = false, $forceUpdate = false ) { |
| 610 | + function processBill( $govTrackBillId, $bill_key, $openCongBillId = false, $mapLightBillId = false, $forceUpdate = false ) { |
611 | 611 | // get the bill title & its sponsor / co-sponsors: |
612 | 612 | $rawGovTrackPage = $this->doRequest( $this->govTrack_bill_url . $govTrackBillId ); |
613 | 613 | |
— | — | @@ -786,7 +786,7 @@ |
787 | 787 | print " found bill key:$session_num $bill_key \n"; |
788 | 788 | // set a flag as to not get caught in infintate loop: |
789 | 789 | $this->bill_name_maplight_lookup = false; |
790 | | - $this->get_and_proccess_billid( $bill_key, '', $session_num ); |
| 790 | + $this->get_and_process_billid( $bill_key, '', $session_num ); |
791 | 791 | print " found bill title: " . $this->cur_bill_short_title . "\n"; |
792 | 792 | // should now have the bill name update the cache and return |
793 | 793 | $this->mapLight_bill_cache[$mapBillId] = $this->cur_bill_short_title; |
Index: trunk/extensions/MetavidWiki/maintenance/metavid2mvWiki.inc.php |
— | — | @@ -297,7 +297,7 @@ |
298 | 298 | } |
299 | 299 | // do insert/copy all media images |
300 | 300 | if ( !isset( $options['skipimage'] ) ) { |
301 | | - do_proccess_images( $stream, $force ); |
| 301 | + do_process_images( $stream, $force ); |
302 | 302 | print "done with images\n"; |
303 | 303 | } |
304 | 304 | if ( !isset( $options['skipfiles'] ) ) { |
— | — | @@ -305,8 +305,8 @@ |
306 | 306 | do_stream_file_check( $stream ); |
307 | 307 | } |
308 | 308 | if ( !isset( $options['skiptext'] ) ) { |
309 | | - // proccess all stream text: |
310 | | - do_proccess_text( $stream, $force ); |
| 309 | + // process all stream text: |
| 310 | + do_process_text( $stream, $force ); |
311 | 311 | } |
312 | 312 | if ( !isset( $options['skipSpeechMeta'] ) ) { |
313 | 313 | // do annoative track for continus speches |
— | — | @@ -389,7 +389,7 @@ |
390 | 390 | } |
391 | 391 | } |
392 | 392 | } |
393 | | -function do_proccess_text( $stream, $force ) { |
| 393 | +function do_process_text( $stream, $force ) { |
394 | 394 | $dbr = wfGetDB( DB_SLAVE ); |
395 | 395 | if ( $force ) { |
396 | 396 | global $botUserName; |
— | — | @@ -481,7 +481,7 @@ |
482 | 482 | /* |
483 | 483 | * for each image add it to the image directory |
484 | 484 | */ |
485 | | -function do_proccess_images( $stream, $force = false ) { |
| 485 | +function do_process_images( $stream, $force = false ) { |
486 | 486 | global $mvLocalImgLoc, $MVStreams, $wgDBname; |
487 | 487 | $dbr =& wfGetDB( DB_SLAVE ); |
488 | 488 | $dbw =& wfGetDB( DB_MASTER ); |
— | — | @@ -755,23 +755,17 @@ |
756 | 756 | |
757 | 757 | //get all people from the congress people category |
758 | 758 | $result = $dbr->select( 'categorylinks', 'cl_sortkey', array ( |
759 | | - 'cl_to' => 'Person', |
760 | | - /*'`cl_sortkey` LIKE \'%' . mysql_escape_string( $val |
761 | | - ) . '%\' COLLATE latin1_general_ci' ), __METHOD__, array (*/ |
762 | | - 'LIMIT' => $result_limit |
763 | | - ) ); |
| 759 | + 'cl_to' => 'Person' |
| 760 | + ) |
| 761 | + ); |
| 762 | + |
| 763 | + if ( $dbr->numRows( $result ) == 0 ) |
| 764 | + die( 'could not find people: ' . "\n" ); |
764 | 765 | $out = ''; |
765 | 766 | while ( $row = $dbr->fetchObject( $result ) ) { |
766 | 767 | $person_name = $row->cl_sortkey; |
767 | 768 | $person_ary[$person_name] = true; |
768 | 769 | } |
769 | | - |
770 | | - if ( $dbr->numRows( $res ) == 0 ) |
771 | | - die( 'could not find people: ' . "\n" ); |
772 | | - $person_ary = array (); |
773 | | - while ( $person = $dbr->fetchObject( $res ) ) { |
774 | | - $person_ary[] = $person; |
775 | | - } |
776 | 770 | foreach ( $person_ary as $person ) { |
777 | 771 | $person_title = Title :: newFromUrl( $person->name_clean ); |
778 | 772 | // semantic data via template: |
— | — | @@ -819,7 +813,7 @@ |
820 | 814 | } |
821 | 815 | } else if ( $dbKey == 'contribution_date_range' ) { |
822 | 816 | if ( !$mapk ) { |
823 | | - print 'out of order attr proccess missing mapk' . "\n"; |
| 817 | + print 'out of order attr process missing mapk' . "\n"; |
824 | 818 | } else { |
825 | 819 | $raw_results = $mvScrape->doRequest( 'http://www.maplight.org/map/us/legislator/' . $mapk ); |
826 | 820 | preg_match( '/Showing\scontributions<\/dt><dd>([^<]*)</', $raw_results, $matches ); |
— | — | @@ -891,7 +885,7 @@ |
892 | 886 | $page_body .= "Funding Interest $hr_inx=" . html_entity_decode( $matches[2][$k] ) . "|\n"; |
893 | 887 | $page_body .= "Funding Amount $hr_inx=\$" . $matches[3][$k] . "|\n"; |
894 | 888 | if ( $doInterestLookup ) { |
895 | | - // make sure the intrest has been proccessed: |
| 889 | + // make sure the intrest has been processed: |
896 | 890 | do_proc_interest( $matches[1][$k], html_entity_decode( $matches[2][$k] ) ); |
897 | 891 | } |
898 | 892 | // do_proc_interest('G1100','Chambers of commerce'); |
— | — | @@ -1034,7 +1028,7 @@ |
1035 | 1029 | print "removed title: " . $pTitle->getText() . "\n"; |
1036 | 1030 | } |
1037 | 1031 | } |
1038 | | -function mv_proccess_attr( $table, $stream_id ) { |
| 1032 | +function mv_process_attr( $table, $stream_id ) { |
1039 | 1033 | global $start_time, $end_time; |
1040 | 1034 | $dbr = wfGetDB( DB_SLAVE ); |
1041 | 1035 | $sql = "SELECT * FROM `metavid`.`$table` WHERE `stream_fk`=$stream_id"; |