Originally posted by something else
View Post
need experts help like something else or software-freak
Collapse
X
-
Originally posted by something else View PostPHP Code:<?php
//Scripted by Lue Chin improved by something else and improved by softwarefreak on coding-talk.com forums :P
////////////Settings
$sitename = 'Something else :P';
$site_url = 'http://smsming.com/cat/April-Fools-Day-Sms.html';
$logo = 'image/logo.gif';
$userAgent = 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16' ;
$ip = '124.83.49.19';
$language = 'en-us,en;q=0.7,de-de;q=0.3';
$accept = 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5';
$timeout = 0; // set to zero for no timeout
////////////CURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $site_url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Language: '.$language,'Accept: '.$accept,'X-Forwarded-For: '.$ip));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$file = curl_exec($ch);
curl_close($ch);
//echo $file;
$file = preg_replace('/<!DOCTYPE html(.*)<\/head>/is', '', $file);
$file = preg_replace('/<a href="\/index.html">(.*)<\/html>/is', '', $file);
$dark = explode('<div class="dark">', $file);
$sms = explode('<div class="sms">', $file);
//print_r($dark);
$totalsections = floor(count($dark)/2);
if(isset($_GET['page'])) $i = (int) $_GET['page']; else $_GET['page'] = 1;
if($i=="" || $i = null || $i = 0) $i= 1;
$j = $i;
for (; $i < $j+2; $i++)
{
$header = strstr($dark[$i], '</div><div class="sms">', true);
$body = strstr($sms[$i], '<a href="sms:?', TRUE);
echo "<div class='some'>$header<br />$body<br />
<textarea>".trim(strip_tags($body))."</textarea></div>";
}
echo '<a href="?page=1">1</a>';
$page = $_GET['page'];
if($totalsections>1&&$page<=$totalsections)
{
echo '<a href="?page='+($page+1)+'">'+($page+1)+'</a>';
}
?>
PHP Code:
$sitename = 'Something else :P';
I need some facebook likes, can you please help me
http://facebook.com/softwarefreakin
I noticed social media is really powerful
Well DONE is better than well SAID
Comment
-
PHP Code:<?php
function imnoob($u=0){
if($u==0){
$url = "http://smsming.com/cat/April-Fools-Day-Sms.html";
}else{
$url = "http://smsming.com/cat/April-Fools-Day-Sms/$u.html";
}
$userAgent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1";
$ch = curl_init();
curl_setopt($ch,CURLOPT_USERAGENT,$userAgent);
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_AUTOREFERER,true);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_TIMEOUT,60000);
$html = curl_exec($ch);
$pieces = explode('<a href="sms:?body=', $html);
$count = count($pieces);
for ($i=1; $i < $count; $i++) {
$pieces2 = explode('"><font color="brown">', $pieces[$i]);
$text = str_replace("<br>",chr(13),$pieces2[0]);
$text = str_replace("-Smsming.com","- m4ster_v4",$text);
if($u==0){
echo "<div style=\"padding-top:3px;padding-bottom:3px;padding-left:5px;border:1px;border-style:solid;border-color:#e2c822;background-color:#fff9d7;margin-bottom:5px;color:#000\">";
echo "<textarea type='text' readonly>$text</textarea>";
echo "</div>";
}else{
echo "<div style=\"padding-top:3px;padding-bottom:3px;padding-left:5px;border:1px;border-style:solid;border-color:#e2c822;background-color:#fff9d7;margin-bottom:5px;color:#000\">";
echo "<textarea type='text' readonly>$text</textarea>";
echo "</div>";
}
}
}
imnoob(0);
$count = 20; //CHANGE TO PAGE VALUE
for ($i=10; $i < $count; $i++) {
imnoob($i);
}
?>sigpic
Visit my WEBSITE Project: http://www.aspirewap.net
Comment
-
Originally posted by something else View Postsoftwarefreak(gif||.png||.jpg) :DI need some facebook likes, can you please help me
http://facebook.com/softwarefreakin
I noticed social media is really powerful
Well DONE is better than well SAID
Comment
-
Originally posted by softwarefreak View Postunfair 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...
if(!$file){echo'error grabbing content'; exit;}
anyway ... \
PHP Code:<!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!
Comment
-
this script - IT'S DRIVING ME CRAZY !!
and i hate when people change their mind' and don't say what they wan't from the first time ... you know what i mean ..
i want that .. but that should be as that .. and have that .. creepy people ...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!
Comment
-
$file = curl_exec($ch);
if(!$file){echo'error grabbing content';
exit;}
"ERROR Grabbing content!"
I think he/she will never ever come back to your site :P
BTW,
PHP Code:
$file = curl_exec($ch);
if(empty($file))
{
echo'error grabbing content';
exit;
}
Originally posted by just_m3. View Postthis script - IT'S DRIVING ME CRAZY !!
and i hate when people change their mind' and don't say what they wan't from the first time ... you know what i mean ..
i want that .. but that should be as that .. and have that .. creepy people ...I need some facebook likes, can you please help me
http://facebook.com/softwarefreakin
I noticed social media is really powerful
Well DONE is better than well SAID
Comment
-
Originally posted by softwarefreak View Post@just_m3, OK,you'll show this to your visitors? :D
"ERROR Grabbing content!"
I think he/she will never ever come back to your site :P
BTW,
PHP Code:
$file = curl_exec($ch);
if(empty($file))
{
echo'error grabbing content';
exit;
}
It's not dat bad actually,I learnt new things from you guys
right bro' just keep him waiting on your page for like 40 seconds then throw him on a blank page :D .... jizz he is gonna' come back right away
You can put an error such as .. sorry time out during the server loads . please refresh the page !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!
Comment
-
@something, wats the significance of this?
PHP Code:curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Language: '.$language,'Accept: '.$accept,'X-Forwarded-For: '.$ip));
I need some facebook likes, can you please help me
http://facebook.com/softwarefreakin
I noticed social media is really powerful
Well DONE is better than well SAID
Comment
-
Originally posted by softwarefreak View Post@something, wats the significance of this?
PHP Code:curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Language: '.$language,'Accept: '.$accept,'X-Forwarded-For: '.$ip));
yup .. for the forwarded ip so you can trick the grabbed site , or pass users ip via that header ... but it's not working on all sites because not all of them use xforwared to get users/visitors ip , beware that header ! an put some protection on your site if you are using forwarded ip .. because "someone else " could run some sql query injection ....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!
Comment
-
wow, thanks,
I use this sometimes
PHP Code:<?php
$url = "http://www.google.com.hk";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, 122.72.10.208); // a valid proxy,I get it 4rm http://proxy-list.org/en/index.php
curl_setopt($ch, CURLOPT_PROXYPORT, 80);
$exec = curl_exec($ch);
curl_close($ch);
//echo curl_error($ch);
echo $exec;
?>I need some facebook likes, can you please help me
http://facebook.com/softwarefreakin
I noticed social media is really powerful
Well DONE is better than well SAID
Comment
Comment