Results 1 to 8 of 8
Hybrid View
-
30th Sep 2011, 07:33 PM #1OPMember
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 fieldBut 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_Downloadhihotfile 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
-
28th Dec 2011, 12:55 AM #2MemberWebsite's:
undiscoveredPWDS.comFound 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($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_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';
-
9th Jan 2012, 05:56 PM #3
-
12th Jan 2012, 03:42 PM #4MemberWebsite's:
undiscoveredPWDS.com
-
14th Jan 2012, 08:53 AM #5Member
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?
-
14th Jan 2012, 12:23 PM #6Member
You can study rapidleech plugin to learn uploading and downloading from file hosts.
The code is in php and it's free.
-
28th Dec 2011, 03:49 AM #7BannedWebsite's:
mourya.com yahoomembers.infoKeep posting. Really nice thread. I'm subscribing.
-
10th Jan 2012, 09:46 AM #8MemberWebsite's:
gwarez.cc hd-movies.cx drop-games.orgyep fix ?
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Mini-Tutorial] How to check the length of your Filesonic sales
By Chugi in forum File Host DiscussionReplies: 7Last Post: 23rd Dec 2011, 10:34 PM -
Filesonic Pay Per Sale> So May I Provide Just Filesonic Links And Avoid Other Hosts?
By elpirata in forum Webmasters, Money MakingReplies: 5Last Post: 28th Apr 2011, 09:19 PM -
Fastest way to remote upload FileSonic to FileSonic?
By derrenbrown in forum File Host DiscussionReplies: 2Last Post: 25th Apr 2011, 04:24 AM -
filesonic off from filesonic function remote upload to filesonic
By uvb76 in forum File Host DiscussionReplies: 4Last Post: 18th Apr 2011, 01:16 PM -
[POLL] Filesonic 2 Filesonic Remote Should Back Or Not?
By sSKKa in forum File Host DiscussionReplies: 64Last Post: 9th Apr 2011, 07:59 PM
themaPoster - post to forums and...
Version 5.38 released. Open older version (or...