• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[PHP & NSFW] preg_match of file_get_contents(url)

Skilled Illusionist
Joined
Jul 1, 2007
Messages
367
Reaction score
1
Yo!

Haven't been on here in a long, long time, but you guys have always been accommodating and helpful when it comes to Coder's Paradise :)

I'm having trouble today, and, as embarrassing as it is (it's a small joke project), I'm trying to grab the link from the HTML source of a porn site. (please don't ban me :*:)

Here's what I have so far (so stupid):
PHP:
$file = file_get_contents_utf8('http://www.xnxx.com');
//preg_match("'<p class=\"review\">([^<]*)</p>'si", $file, $matches);
preg_match("'<a href=(.*?)/class=\"miniature\">'si", $file, $matches);
list(, $value) = $matches;

echo $value;

Ignore the file_get_contents_utf8, it's a working function. My problem is the preg_match won't pick up on what I'm looking for (I think I've typed in the search wrong, or used the wrong divider "(.*?)".

The links I want are in these suckers:
Code:
<a href="http://video.xnxx.com/video1352353/0/valentine_bang" class="miniature">

Do you guys have any feedback? Thanks in advance and sorry for NSFW post. <3
 
Infraction Baɴɴed
Loyal Member
Joined
Apr 9, 2008
Messages
1,416
Reaction score
169
question is are you trying to download the video in the links?
 
Back
Top