need experts help like something else or software-freak

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • softwarefreak
    replied
    Originally posted by something else View Post
    PHP 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>';
     }
    ?>
    unfair LOL
    PHP Code:
    
    $sitename = 'Something else :P'; 
    
    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...

    Leave a comment:


  • Lue_chin
    replied
    Originally posted by something else View Post
    [PHP]
    not working bro its older php version my server

    Leave a comment:


  • something else
    replied
    PHP Code:
    <?php 
    
    //Scripted by Lue Chin improved by something else and improved by softwarefreak on coding-talk.com forums :P  
    ////////////Settings   
    $sitename = 'Sitename';   
    $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>';
     }
    ?>
    Last edited by something else; 04.03.12, 15:46.

    Leave a comment:


  • Lue_chin
    replied
    Originally posted by m4ster_v4 View Post
    Can you tell me more what you want? 2 sms per page ?
    http://www.aspirewap.net/demo.php <-- or like this
    no bother i paste a sms 3 time on a page means for ex: if example if sms " hello how are you "
    so output is hello hoe are you <a href="hello how are you">sms</a><a href=share?=hello how are you.html">share this one </a> or <textarea> hello how are you</text area> so that i share my page on facebook

    Leave a comment:


  • m4ster_v4
    replied
    Can you tell me more what you want? 2 sms per page ?
    http://www.aspirewap.net/demo.php <-- or like this

    Leave a comment:


  • softwarefreak
    replied
    Originally posted by Lue_chin View Post
    first of all i thanks to all who reply specialy soft freak please chk its not working http://fbcomments.tk/status/sms.php not working
    oops, you PHP version is lesser dan 5.3.0, the 3rd param for strstr() is not supported in lower versions,wait let me change

    Leave a comment:


  • just_m3.
    replied
    Originally posted by Lue_chin View Post
    first of all i thanks to all who reply specialy soft freak please chk its not working http://fbcomments.tk/status/sms.php not working
    Don't know about you but
    http://down.unick.info/ it works ...

    Leave a comment:


  • Lue_chin
    replied
    Originally posted by softwarefreak View Post
    My small edit of something's script :D
    first of all i thanks to all who reply specialy soft freak please chk its not working http://fbcomments.tk/status/sms.php not working

    Leave a comment:


  • softwarefreak
    replied
    My small edit of something's script :D
    PHP Code:
    <?php
    
    //Scripted by Lue Chin improved by something else 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);
    for ($i=1; $i < count($dark); $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>";
        
    }
     
    ?>

    Leave a comment:


  • just_m3.
    replied
    Originally posted by Lue_chin View Post
    Dear master you are not under stand i want to add a count code in the grabber because i paste a sms 2 time in grabber please make this like this link http://fbcomments.tk/status


    You gonna need this http://coding-talk.com/f16/small-gra...-on-oop-16633/


    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=str_replace("Smsming.com",$_SERVER['HTTP_HOST'],$moddmysms);
    
    preg_match_all( "#<div class=\"sms-body\"><br>(?P<textareacontent>.+?)<a href=\"sms:#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>


    Got it buddy hit tnx button if this is what you've bein' looking for ...

    hell ya i rock !


    Preview here

    Click image for larger version

Name:	preview.png
Views:	1
Size:	33.3 KB
ID:	110119
    Last edited by just_m3.; 04.03.12, 02:54.

    Leave a comment:


  • softwarefreak
    replied
    I'd have helped if you opened the thread like "need experts help like software-freak or something else":P :LOL joking....

    BTW,I'm really not getting...be specific,so dat we can help you

    Added after 3 minutes:

    Originally posted by Lue_chin View Post
    Dear master you are not under stand i want to add a count code in the grabber because i paste a sms 2 time in grabber please make this like this link http://fbcomments.tk/status
    you want 2 messages per page,ryt?
    Last edited by softwarefreak; 04.03.12, 01:35.

    Leave a comment:


  • Lue_chin
    replied
    Originally posted by something else View Post
    "..." these are different symbol to yours copy and paste from source :P

    added after null seconds...

    this might help:
    Dear master you are not under stand i want to add a count code in the grabber because i paste a sms 2 time in grabber please make this like this link http://fbcomments.tk/status

    Leave a comment:


  • something else
    replied
    needs preg replace

    "..." these are different symbol to yours copy and paste from source :P

    added after null seconds...

    this might help:
    PHP Code:
    <?php  
    //Scripted by Lue Chin improved by something else 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 = 5; // 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)); 
    ob_start();  
    curl_exec($ch);  
    curl_close($ch);  
    $file = ob_get_contents();  
    ob_end_clean();  
    
    
    ////////////function pick Start,stop,source 
    function pick($start,$stop,$from){  
    $from=explode($start,$from);  
    $from=explode($stop,$from[1]);  
    $from=$from[0];  
    return $from;  
    }  
    
    
    $linksource = pick('<div class="pendu">','...</a> <br>',$file);  //make sure you change dots to ones in source
    ////////////Last Min String Replacements  
    $page = str_replace('href="/cat/','href="?cat=',$linksource);  
    $page = str_replace('SMS (smsming.com)',$sitename,$page);  
    
    echo $logo+'<br/>'+$page; 
    
    /* 
    ////////////errrr what you trying to do here? 
    $chunk = explode('<div class="sms">', $page);   
    //print_r($chunk);   
    $count = count($chunk);   
    for ($i=1; $i < $count; $i++)    
    {   
         $match_name = preg_match('/sms:?body=(.*)">/i', $chunk[$i], $link);  
         echo "link=:$link[1]<br>";  
         echo "<hr>";  
    }   
    ////////////maybe you should use: 
    //////////// $page = preg_replace('/sms:?body=(.*?)">/is','sms:?body=$1'"><br/><textarea>$1</textarea>',$page); 
    //////////// or something similar  
    */ 
    ?>
    Last edited by something else; 04.03.12, 01:36. Reason: making 2 posts into 1

    Leave a comment:


  • m4ster_v4
    replied
    Originally posted by mahipat View Post
    i think he want to add text box like http://fbcomments.tk/status/
    Owh okay.. uppdate? see it again.. i'm just a newbie. :D

    Leave a comment:


  • mahipat
    replied
    Originally posted by m4ster_v4 View Post
    I'm not an expert but it is what do you mean?
    http://www.aspirewap.net/demo.php
    i think he want to add text box like http://fbcomments.tk/status/

    Leave a comment:

Working...
X