Jump to content

Using snoopy.php library for passworded pages


HaLo2FrEeEk

Recommended Posts

For those of you that don't know, snoopy is a library that uses CURL to retrieve the source HTML for a webpage, the syntax is quite simple:

 

<?php
include('snoopy.php');
$snoopy = new Snoopy;
if($snoopy->fetch("URL"))
$text = ($snoopy->results);
?>

 

Thats about it, what I need to do, however, is get information from a page that requires that you log in with a .net passport before being able to view it, the page is:

 

http://www.bungie.net/Stats/ClanMembers.aspx?clan=infectionist

 

When you go to that page without logging in with a .net passport, you get a warning saying that you must be logged in, I have a passport that I COULD use, but I don't know how to use php to sogn in first, then use snoopy to get the code, then log out (I don't want anyone using the open session to fiddle, no fiddling!)  That page, when logged in, has code with values that I need and could get using regular expressions and preg_match_all, is this possible to do?

 

Thanks phpfreaks community.

I found an example using cURL by googling:

 

<?php
$URL="www.mysite.com/test.php";
$ch = curl_init();   
curl_setopt($ch, CURLOPT_URL,"https://$URL"); 
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "Data1=blah&Data2=blah");curl_exec ($ch);    
curl_close ($ch);
?> 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.