softwarefreak wrote: unfair LOL BTW, setting a timeout while making a grabber is not a gud idea,A blank page is retured w/ a curl error it exceeds the time :S it's better the script reaches max execution time & dies to a fatal error,this is wat I've noticed,may be I'm wrong...🤷
$file = curl_exec($ch);
if(!$file){echo'error grabbing content'; exit;}
anyway ... \
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Here is my link grabber demo</title>
<style type="text/css">
body{
margin: 3px auto;
font-family : Verdana, arial;
font-weight : normal;
font-size : small;
color : #333333;
background-color : #ffffff;
}
.sms-title {
padding-bottom : 2px;
padding-top : 2px;
background : #FFF;
padding-left:4px;
border: 1px solid #CCCCCC;
}
.sms-body{padding-left:5px;margin-left:5px;
}
.sms-body-cont {
padding-bottom : 2px;
padding-top : 2px;
background : #FFF;
padding-left:4px;
border: 1px solid #CCCCCC;
}
</style></head>
<body>
<?php
###############################
require_once'grab_lib.php'; #
###############################
function fetch_sms_content($opp){
foreach($opp as $value){
$moddmysms = '<!--- From here -->'.$value.'<!-- To here -->';
$moddmysms = preg_replace('/<!--- From here --><\!DOCTYPE(.*?)<!-- To here -->/is','',$moddmysms);
preg_match_all( "#<!--- From here -->(?P<extracted>.+?)<!-- To here -->#sim",$moddmysms, $show ) ;
$moddmysms = preg_replace('/<\/div><hr>(.*?)<\/html>/is','',$show['extracted'][0]);
$moddmysms = preg_replace('/<a href="sms:\?body=(.*?)"><font color="brown">Forword Sms<\/font>(.*?)<\/a>/is','<a href="sms:?body=$1">Share by sms</a><br/><a href="http://m.facebook.com/home.php?p=$1">Share on Facebook</a>',$moddmysms);
$moddmysms=str_replace("Smsming.com",$_SERVER['HTTP_HOST'],$moddmysms);
preg_match_all( "#<div class=\"sms-body\"><br>(?P<textareacontent>.+?)<a href=\"http:\/\/m#sim",$moddmysms, $my ) ;
$textarea=str_replace("<br>","\n",$my['textareacontent'][0]);
$textarea=str_replace("\n\n\n\n","\n",$textarea);
$retthis="".$moddmysms."<textarea name=\"copy\" cols=\"20\" rows=\"6\">".$textarea."</textarea><br><br>\n\n\n";
// doin' this because first result is empty
$retthis = str_replace('<textarea name="copy" cols="20" rows="6"></textarea><br><br>','',$retthis);
echo $retthis; }}
$grab = new grabber();
$moddmydata = $grab->page('http://smsming.com/cat/April-Fools-Day-Sms.html','fget');
$moddmydata = preg_replace('/<div class="dark">(.*?)<\/div><div class="sms">/i','<div class="sms-body-cont"><div class="sms-title">$1</div><div class="sms-body"><br>',$moddmydata);
$opp=explode('<div class="sms-body-cont">',$moddmydata);
fetch_sms_content($opp);
?>
</body>
</html>
This is ten percent luck, twenty percent skill Fifteen percent concentrated power of will Five percent pleasure, fifty percent pain 😂And a hundred percent reason to remember the name!
