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

Results 1 to 8 of 8
  1.     
    #1
    Member

    Post filesonic.com API tutorial

    why i am creating this topic ?
    Because i can't find this nowhere ...please note that i am not Big php programmer ... just a newbie in this field But believe master of Php one day (Because my wife says to me "Always think good because it willl be happen in future")

    i starting php for fun...but i think it is now necessary me for automation tool beacuse i am just too lazy to click.

    caution : it is beginning

    For Masters of Php : Please share your knowledge and valuable comments about this .Thanks

    so come to point
    -------------------------------------------------------------------------

    file sonic API page :

    http://api.filesonic.com/l


    FSApi_User

    This API call allow you to get/set information related to the user. getInfo (login required)

    Get the current user informations such as:
    - id
    - email
    - nickname
    - is_premium (1 if premium, 0 if not premium)
    - premium_expiration (not returned if is_premium is not 1)

    @see FSApi_Auth::login

    @return Array

    @example http://api.filesonic.com/user?method...AIL&p=PASSWORD



    Real example :

    php code :

    $fs='http://api.filesonic.com/user?method=getInfo&u=xxxxxxx@gmail.com&p=xxxxxxxx ';
    $reply = file_get_contents($fs);

    echo $reply;


    output :
    {"FSApi_User":{"getInfo":{"response":{"users":{"us er":{"id":167xxxx,"email":"xxxxxxxxx@gmail.com","n ickname":"xxxxxxxx","is_premium":false}}},"status" :"success"
    __________________________________________________ __
    FSApi_Link

    This API call allow you to get/set some informations related to the links. getInfo

    Get links informations

    Assumed response fields:
    - id
    - status (AVAILABLE, NOT_AVAILABLE, PRIVATE)

    Response if status is AVAILABLE
    - filename
    - url
    - size (in bytes)
    - description (may be empty)
    - is_password_protected (1 if password protected)
    - is_premium_only (1 if premium only or 0)
    - updated_on (format yyyy-mm-dd hh:iis)

    @important Too many links sent via url may cause browser limitation problem.
    You should send large number of links via POST
    @important Please Read: Howto Get Links Ids

    @restriction The maximum number of ids is 100 per query.
    The maximum length of all the ids is limited to 900

    @param [ids] Can be an Array or a CSV

    @return Array

    @example http://api.filesonic.com/link?method...1234,1111,4444
    @example http://api.filesonic.com/link?method=getInfo&ids[]=1234&ids[]=1111&ids[]=444


    Real example :


    php code :
    $fs='http://api.filesonic.com/link?method=getInfo&ids=2255134814';
    $reply = file_get_contents($fs);
    echo $reply;


    out put :
    {"FSApi_Link":{"getInfo":{"response":{"links":[{"id":2255134814,"filename":"1847199143.rar","size ":6927661,"description":"","is_password_protected" :false,"is_premium_only":false,"updated_on":"2011-09-30 14:04:24","status":"AVAILABLE","url":"http:\/\/www.filesonic.com\/file\/2255134814"}]},"status":"success"}}}
    --------------------------------------
    MY target to learn

    FSApi_Upload

    FSApi_Download
    hihotfile Reviewed by hihotfile on . filesonic.com API tutorial why i am creating this topic ? Because i can't find this nowhere ...please note that i am not Big php programmer ... just a newbie in this field :facepalm: But believe master of Php one day =) (Because my wife says to me "Always think good because it willl be happen in future") i starting php for fun...but i think it is now necessary me for automation tool beacuse i am just too lazy to click. caution : X-( it is beginning For Masters of Php : <3 Please share your knowledge and Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    undiscoveredPWDS.com
    Found this post looking for a simple Filesonic API upload example (in php).
    Couldnt find one so thought id post what I knocked up in case it helps anyone else.


    PHP Code: 
        $username '******@gmail.com';
        
    $password '*******';
        
    $file =     '/your/file/path.jpg';
        
        
        
    $fs="http://api.filesonic.com/upload?method=getUploadUrl&format=json&u=$username&p=$password";
        
    $reply file_get_contents($fs);    
        
    preg_match('#"url":"(.*?)".+"status":"(.+?)"#',$reply,$matches);
        if (
    $matches[2] == 'success')
        {
            
    $request_url stripslashes($matches[1]);
            
    $post_params['files[]'] = '@'$file;
            
    $ch curl_init();
            
    curl_setopt($chCURLOPT_URL$request_url);
            
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
            
    curl_setopt($chCURLOPT_POSTtrue);
            
    curl_setopt($chCURLOPT_POSTFIELDS$post_params);
            
    $reply curl_exec($ch);
            
    curl_close($ch);
            
    preg_match('#"url":"(.*?)".+"status":"(.+?)"#',$reply,$matches);
            if (
    $matches[2] == 'success')
                echo 
    stripslashes($matches[1]);
            else print 
    'error';
        } else print 
    'error'

  4.     
    #3
    Banned
    Website's:
    mourya.com yahoomembers.info
    Keep posting. Really nice thread. I'm subscribing.

  5.     
    #4
    Member
    Quote Originally Posted by PwdGuy View Post
    Found this post looking for a simple Filesonic API upload example (in php).
    Couldnt find one so thought id post what I knocked up in case it helps anyone else.


    PHP Code: 
        $username '******@gmail.com';
        
    $password '*******';
        
    $file =     '/your/file/path.jpg';
        
        
        
    $fs="http://api.filesonic.com/upload?method=getUploadUrl&format=json&u=$username&p=$password";
        
    $reply file_get_contents($fs);    
        
    preg_match('#"url":"(.*?)".+"status":"(.+?)"#',$reply,$matches);
        if (
    $matches[2] == 'success')
        {
            
    $request_url stripslashes($matches[1]);
            
    $post_params['files[]'] = '@'$file;
            
    $ch curl_init();
            
    curl_setopt($chCURLOPT_URL$request_url);
            
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
            
    curl_setopt($chCURLOPT_POSTtrue);
            
    curl_setopt($chCURLOPT_POSTFIELDS$post_params);
            
    $reply curl_exec($ch);
            
    curl_close($ch);
            
    preg_match('#"url":"(.*?)".+"status":"(.+?)"#',$reply,$matches);
            if (
    $matches[2] == 'success')
                echo 
    stripslashes($matches[1]);
            else print 
    'error';
        } else print 
    'error'
    This doesn't work. Anyone got hotfix?

  6.     
    #5
    Member
    Website's:
    gwarez.cc hd-movies.cx drop-games.org
    yep fix ?



  7.     
    #6
    Member
    Website's:
    undiscoveredPWDS.com
    Quote Originally Posted by Arxiss View Post
    This doesn't work. Anyone got hotfix?
    The code works perfectly. If it?s not working for you it?s probably due to restrictions on your server regarding curl or a firewall if you?re running it locally. It successfully runs on my web-server once every hour. What exactly is your setup?

  8.     
    #7
    Member
    I am using localhost, firewall is off. I don't know what config options I should check.

    But here is where your script fails:
    After I use curl_getinfo($ch) just before the curl_close($ch)
    I get this response:
    http://codepad.org/kS5sH82x

    As you can see, 'http_code' => int 0 and content_type is empty. Looks like curl fails.

    Do you have any ideas pwdguy? Can you post your config.

    EDIT: Maybe we need cookie?

  9.     
    #8
    Member
    You can study rapidleech plugin to learn uploading and downloading from file hosts.
    The code is in php and it's free.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 23rd Dec 2011, 10:34 PM
  2. Replies: 5
    Last Post: 28th Apr 2011, 09:19 PM
  3. Fastest way to remote upload FileSonic to FileSonic?
    By derrenbrown in forum File Host Discussion
    Replies: 2
    Last Post: 25th Apr 2011, 04:24 AM
  4. Replies: 4
    Last Post: 18th Apr 2011, 01:16 PM
  5. [POLL] Filesonic 2 Filesonic Remote Should Back Or Not?
    By sSKKa in forum File Host Discussion
    Replies: 64
    Last Post: 9th Apr 2011, 07:59 PM

Tags for this Thread

BE SOCIAL