Has anyone used Sourgeforge's "snoopy" to log into websites before ??

If I enter a incorrect ID / Password, I *instantly* get the HTML
output from Yahoo advising of my error..

However, if I put my correct ID / Password in, it seems to "hang" for
a while - showing that something is being downloaded  - But it never
stops, & doesnt display any new screen....

Ive checked the below script, (slightly adjusted) & I cant find any
"indefinate" loop in it...

Has anyone tried this ?

G

===============================================

http://sourceforge.net/projects/snoopy/


<?php

include "Snoopy.class.php";
$client = new Snoopy();
$client->agent = SOME_UA_STRING;

$client->fetchform('https://login.yahoo.com/config/login_verify2?.done=http://groups.yahoo.com%2fmygroups&.src=ygrp&.intl=us');
$doc1 = $client->results;

echo "$doc1<HR>\n";


preg_match('/<form.*action="([^"]*)"/', $doc1, $res);
print_r($res);
print($res[1][0]."\n");
$submit_url = $res[1];
preg_match_all('/<input[^>]*>/',$doc1, $form1);


echo "$form1[0]\n";

$vars = array();
foreach($form1[0] as $input) {
preg_match('/name="([^"]*)"/', $input, $res);
$name = $res[1];
preg_match('/value="([^"]*)"/', $input, $res);
$value = $res[1];
if(!isset($value)) {
preg_match('/value=([^ >]*)/', $input, $res);
$value = $res[1];
}
$vars[$name] = $value;
$value="";
}


$vars['login'] = 'USERNAME';
$vars['passwd'] = 'PASSWORD';
$vars['.persistent'] = 'y';

$client->submit('https://login.yahoo.com/config/login?', $vars);


echo "GERE<BR>\n";

foreach($client as $input =>$as) {
echo "'$input' '$as'<BR>\n";
}

?>


-- 
G
NZ community groups - [EMAIL PROTECTED]
Freecycle Auckland :-
http://groups.yahoo.com/group/AucklandFreecycle/

Reply via email to