Activity Stream
48,167 MEMBERS
6860 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19
  1.     
    #11
    Member
    Website's:
    satiq.net
    With that I scrape last upload:

    PHP Code: 
    $postdata="id=2705986&pw=password";
    $ch curl_init();
    curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
    curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
    curl_setopt($chCURLOPT_COOKIESESSIONTRUE);
    curl_setopt($chCURLOPT_HEADER0);
    curl_setopt($chCURLOPT_COOKIEFILE"cookiefile");
    curl_setopt($chCURLOPT_COOKIEJAR"cookiefile");
    curl_setopt($chCURLOPT_COOKIEsession_name() . '=' session_id());
    curl_setopt($chCURLOPT_FOLLOWLOCATION1);
      
    curl_setopt ($chCURLOPT_POSTFIELDS$postdata);
      
    curl_setopt ($chCURLOPT_POST1);
    curl_setopt($chCURLOPT_URL'http://uploaded.to/io/login');
    $result1 curl_exec($ch);
    curl_setopt($chCURLOPT_URL'http://uploaded.to/io/me/list/files');
    $result2 curl_exec($ch);
     
    #echo str_replace("\n","<br>",$result2);
    $arr=json_decode($result2,true);
    echo 
    'http://uploaded.to/file/'.$arr['list']['0']['id']; 
    So I upload 1 file with ftp and if it's all ok I take link.. Right?

  2.   Sponsored Links

  3.     
    #12
    Member
    Here is my code

    PHP Code: 
    <?php
    /*
     * By hover for KWWHunction. No rights reserved !
     * 
     */


    function ultocookie ($username,$password){
    $ch curl_init("http://uploaded.to/io/login");
    curl_setopt($chCURLOPT_COOKIEJAR"cookies");
    curl_setopt($chCURLOPT_COOKIEFILE"cookies");
    $ullogin = array(
        
    'id'=>$username
        
    'pw'=>$password 
        
    );
    curl_setopt($chCURLOPT_POST,1); 
    curl_setopt($chCURLOPT_POSTFIELDS$ullogin); 
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
    curl_setopt($chCURLOPT_FOLLOWLOCATION1);
    $result=curl_exec ($ch);
    curl_close($ch);
    }
    function 
    ultogetfilelink ($file){
    $ch curl_init("http://uploaded.to/io/me/list/files");
    curl_setopt($chCURLOPT_COOKIEJAR"cookies");
    curl_setopt($chCURLOPT_COOKIEFILE"cookies");
    $getfilelist = array(
        
    'page'=>'0'
        
    'limit'=>'100',
        
    'order'=>'date',
        
    'dir'=>'desc',
        
    'search'=>''
    );
    curl_setopt($chCURLOPT_POST,1); 
    curl_setopt($chCURLOPT_POSTFIELDS$getfilelist); 
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
    curl_setopt($chCURLOPT_FOLLOWLOCATION1);
    $result=curl_exec ($ch);
    curl_close($ch);
    $result json_decode ($result,true);
    foreach (
    $result['list'] as $key => $value)
    {
        if (
    $value['filename'] == $file)
            break;
        return 
    $value['id'];
    }
    }
    function 
    ulftp ($file,$username,$password)
    {
    $name substr ($filestrripos ($file"/"));
    $curlfscmd ="curl -T ".$file." ftp.ul.to --user ".$username.":".$password;    
    $succes false;
    while (
    $succes === false){ 
    system ($curlfscmd,$ftpstatus);
    if (
    $ftpstatus === 0$succes true;
        }
    //get download link (max 10 attemps, if this limit is reached we consider the upload as failed and re-upload it again
    $i 0;
    $succes false;
    while (
    $succes === false)
    {
    if ( 
    $i === 10
    break;
    //sleep 30 secs before trying to get download link
    sleep (30);
    ultocookie($username,$password);
    $fileid ultogetfilelink($name);
    unlink ("cookies");
    if (isset (
    $fileid) === true)
    {
    $succes true;
      
    $ulto 'http://ul.to/'.$fileid.$name;
    }
    else 
    $i++;
    }
    return 
    $ulto;
    }
    ?>
    How to use?

    PHP Code: 
    $myultolink ulftp ('file_path','username','password'); 

  4.     
    #13
    Member
    I got this error

    PHP Code: 
    PHP Notice:  Undefined variableulto in ul.to.php on line 82 
    If I check at script that is this line

    PHP Code: 
    return $ulto
    The script error when tried scrape it but the file uploaded to the server if I checked at my account.

  5.     
    #14
    Member
    Add this line:

    PHP Code: 
    var_dump ($result); 
    after this line:

    PHP Code: 
     $result json_decode ($result,true); 
    and tell me what's the output.

  6.     
    #15
    Member
    still same error message but before that print this is from var_dump

    PHP Code: 
        [17]=>
        array(
    11) {
          [
    "id"]=>
          
    string(8"*****"
          
    ["date"]=>
          
    string(5"1 day"
          
    ["filename"]=>
          
    string(9"audio.m4a"
          
    ["desc"]=>
          
    NULL
          
    ["size"]=>
          
    string(7"6,71 MB"
          
    ["admin"]=>
          
    string(12"******"
          
    ["file_extension"]=>
          
    string(4".m4a"
          
    ["dls"]=>
          
    string(1"0"
          
    ["lastdownload"]=>
          
    string(12"no entry yet"
          
    ["privacy"]=>
          
    string(0""
          
    ["ddl"]=>
          
    bool(false)
        }
      }
      [
    "listopts"]=>
      array(
    4) {
        [
    "page"]=>
        
    int(0)
        [
    "hasPrevious"]=>
        
    bool(false)
        [
    "hasNext"]=>
        
    bool(false)
        [
    "maxPage"]=>
        
    int(1)
      }

    if I check from http://uploaded.to/io/me/list/files the maxPage should be 18 but from var_dump only until 17
    PHP Code: 
    {"list":[{"id":"*****","date":"8 Minutes","filename":"ul.to.php","desc":null,"size":"2,19 KB","admin":"****","file_extension":".php","dls":"0","lastdownload":"no entry yet","privacy":"","ddl":false}],"listopts":{"page":0,"hasPrevious":false,"hasNext":true,"maxPage":18}} 


  7.     
    #16
    Member
    Did your uploaded file's name appear in the var_dump output?

  8.     
    #17
    Member
    no, can't find it
    after the script upload the file, the scrape seem difficult to find the file until it reach 10 times of 30s because it wait very long until the script finish

  9.     
    #18
    Member
    Does the file you're trying to upload has a name containing any chars other than alphanumeric ?

  10.     
    #19
    Member
    no, just simple alphanumeric

    any way, how about other that tried the script.....?
    Are you successful?
    Please testimony in here

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 66
    Last Post: 11th Jul 2012, 02:46 PM
  2. Replies: 1994
    Last Post: 5th Mar 2012, 02:14 PM
  3. Fileserve cURL changes
    By _brazzO in forum Web Development Area
    Replies: 44
    Last Post: 25th Oct 2011, 07:56 AM
  4. Curl IPB help
    By xwarlordx in forum Web Development Area
    Replies: 3
    Last Post: 23rd Aug 2011, 06:33 AM
  5. cURL Pro Coders.
    By kohkindachi in forum Completed Transactions
    Replies: 2
    Last Post: 5th Dec 2010, 12:30 AM

Tags for this Thread

BE SOCIAL