Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 7 12345 ... LastLast
Results 1 to 10 of 65

Thread: TehUpload API

  1. #1
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default TehUpload API

    A few users have been pressing me to make this, so I started this morning throwing something together.

    I haven't really made a documentation on it yet.. but if it starts being used, I'll make one. This should suffice for now.

    ---------------------------
    If you have any questions, please e-mail me at: [email protected]
    ---------------------------

    For right now I only have five methods:

    • check.credentials
    • get.Images
    • album.getInfo
    • upload.Image
    • user.Info

    To use these methods you must provide the user's username and password.

    Each method returns an XML feed with information (starting with <tehupload> ending with </tehupload>)

    ---------------------------------------
    check.credentials
    ---------------------------------------
    Parameters:
    username - TehUpload username
    password - TehUpload password

    Returns:
    status - error, success
    message - message relating to status
    Here is an example URL, with an example response:

    Code:
    http://www.tehupload.com/api/check.credentials/username=username&password=password
    Code:
    <tehupload>
      <status>error</status>
      <message>credentials are incorrect</message>
    </tehupload>
    A successful response will return:

    Code:
    <tehupload>
      <status>success</status>
      <message>credentials are correct</message>
    </tehupload>
    PHP Example:

    PHP Code:
    <?php
    $username 
    "Bob";
    $password "Jimbo";

    $file = @file_get_contents"http://www.tehupload.com/api/check.credentials/username={$username}&password={$password});

    $xml = new SimpleXMLElement$file );

    if(
    $xml->status == "error") {
        echo 
    "Wrong Credentials";
    } else {
        echo 
    "Good Credentials";
    }
    ?>
    ---------------------------------------
    get.Images
    ---------------------------------------
    Parameters:
    username - TehUpload username
    password - TehUpload password
    count - how many images are returned (default - 20)

    Returns:
    status - error, success
    message - message relating to status
    count - how many images are returned
    username - TehUpload username
    userid - TehUpload userID
    images
    info
    filename - Image Filename
    filetype - Image mime type
    filesize - File size, in bytes
    timestamp - Timestamp uploaded
    album
    display - is private album? 1 = no, 0 = yes
    albumID - ID of the album image is in (album.getInfo)
    links
    full - link to full sized image

    thumbs
    small - link to small thumb
    medium - link to medium thumb
    large - link to large thumb
    Here is an example URL, with an example response:

    Code:
    http://www.tehupload.com/api/get.Images/username=username&password=password&count=1
    Code:
    <tehupload>
      <status>success</status>
      <message>credentials are correct</message>
      <content>
        <count>1</count>
        <username>barrymingle</username>
        <userid>95</userid>
        <images>
          <images>
            <info>
              <filename>9622bfe3471e8d1IMG_3250__Medium_.JPG</filename>
              <filetype>image/jpeg</filetype>
              <filesize>110120</filesize>
              <timestamp>1224944856</timestamp>
            </info>
            <album>
              <display>1</display>
              <albumID>339</albumID>
            </album>
            <links>
              <full>http://www.tehupload.com/uploads/9622bfe3471e8d1IMG_3250__Medium_.JPG</full>
              <thumbs>
                <small>http://www.tehupload.com/thumbs/9622bfe3471e8d1IMG_3250__Medium_.JPG</small>
                <medium>http://www.tehupload.com/thumbs/m/9622bfe3471e8d1IMG_3250__Medium_.JPG</medium>
                <large>http://www.tehupload.com/thumbs/l/9622bfe3471e8d1IMG_3250__Medium_.JPG</large>
              </thumbs>
            </links>
          </images>
        </images>
      </content>
    </tehupload>
    PHP Example:

    PHP Code:
    <?php
    $username 
    "Bob";
    $password "Jimbo";

    $file = @file_get_contents"http://www.tehupload.com/api/get.Images/username={$username}&password={$password}&count=1" );

    $xml = new SimpleXMLElement$file );

    $filename $xml->content->images->image[0]->filename;
    ?>
    ---------------------------------------
    album.getInfo
    ---------------------------------------
    Parameters:
    username - TehUpload username
    password - TehUpload password
    albumID - ID of the album you wish to get information about
    count - number of items you want returned

    Returns:
    status - error, success
    message - message relating to status
    album
    owner - owner userID
    "owner-username" - owner username
    title - album title
    "default-image" - default image filename
    private - is album private? 0 = no, 1 = yes
    images
    info
    filename - image filename
    filetype - mime filetype
    filesize - filesize in bytes
    timestamp - unix timestamp when uploaded
    album
    display - should it be shown on main page? private = 0
    albumID - album that image is in
    links
    full - link to full sized image
    thumbs
    small - link to small thumb
    medium - link to medium thumb
    large - link to large thumb
    Here is an example URL, with an example response:

    Code:
    http://www.tehupload.com/api/album.getInfo/username=username&password=pass&albumID=165
    Code:
    <tehupload>
      <status>success</status>
      <message>credentials are correct</message>
      <content>
        <album>
          <owner>12</owner>
          <owner-username>Source</owner-username>
          <title>App</title>
          <default-image></default-image>
          <created-timestamp>1219104048</created-timestamp>
          <private>0</private>
        </album>
        <images>
          <images>
            <info>
              <filename>app-625430429160603934.png</filename>
              <filetype>image/png</filetype>
              <filesize>33693</filesize>
              <timestamp>1219185077</timestamp>
            </info>
            <album>
              <display>1</display>
              <albumID>165</albumID>
            </album>
            <links>
              <full>http://www.tehupload.com/uploads/app-625430429160603934.png</full>
              <thumbs>
                <small>http://www.tehupload.com/thumbs/app-625430429160603934.png</small>
                <medium>http://www.tehupload.com/thumbs/m/app-625430429160603934.png</medium>
                <large>http://www.tehupload.com/thumbs/l/app-625430429160603934.png</large>
              </thumbs>
            </links>
          </images>
        </images>
      </content>
    </tehupload>
    PHP Example:

    PHP Code:
    <?php
    $username 
    "Bob";
    $password "Jimbo";

    $file = @file_get_contents"http://www.tehupload.com/api/album.getInfo/username={$username}&password={$password}&albumID=15&count=1" );

    $xml = new SimpleXMLElement$file );

    $albumTitle $xml->content->album->title;
    ?>
    ---------------------------------------
    upload.Image
    ---------------------------------------
    Parameters:
    username - TehUpload username - OPTIONAL
    password - TehUpload password - OPTIONAL
    album - ID of the album you wish to upload to - OPTIONAL
    imageData - actual file data of image you wish to upload

    Returns:
    status - error, success
    message - message relating to status

    information
    filename - filename of image (appended with api-)
    id - ID of image
    filetype - mime filetype
    filesize - filesize in bytes

    album - if user, pass, album specified; returns albumID of file

    user - if user, pass, album specified; returns userID of file

    "uploaded-timestamp" - unix timestamp when uploaded (can be used to sort relative time)
    links
    thumbs
    small - link to small thumbnail
    medium - link to medium thumbnail
    large - link to large thumbnail
    fullSize - link to fullSize image
    share - link to share page (http://www.tehupload.com/share/id)

    "album-share" (if usernam & password & album specified, returns share link to album)
    Here is an example URL, with an example response:

    Code:
    http://www.tehupload.com/api/upload.Image/username=username&password=pass&album=165
    Code:
    <tehupload>
      <content>
        <information>
          <filename>api-958768cb2cdf79e900528cb2cdf79e.png</filename>
          <id>17246</id>
          <filesize>4538</filesize>
          <uploaded-timestamp>1227390768</uploaded-timestamp>
        </information>
        <links>
          <thumbs>
            <small>http://www.tehupload.com/thumbs/s/api-958768cb2cdf79e900528cb2cdf79e.png</small>
            <medium>http://www.tehupload.com/thumbs/m/api-958768cb2cdf79e900528cb2cdf79e.png</medium>
            <large>http://www.tehupload.com/thumbs/l/api-958768cb2cdf79e900528cb2cdf79e.png</large>
          </thumbs>
          <fullSize>http://www.tehupload.com/uploads/api-958768cb2cdf79e900528cb2cdf79e.png</fullSize>
          <share>http://www.tehupload.com/share/17246</share>
        </links>
      </content>
    </tehupload>
    PHP Example:

    PHP Code:
    <?php
    if($_GET ["action"] == "upload") {
        
        
    $image file_get_contents$_FILES ["image"] ["tmp_name"] );
        
        
    $image urlencode$image );
        
    $curl curl_init"http://www.tehupload.com/api/upload.Image/" );
        
        
    $postvars ["imageData"] = $image;
        
        
    curl_setopt$curlCURLOPT_POST);
        
    curl_setopt$curlCURLOPT_POSTFIELDS$postvars );
        
    curl_setopt$curlCURLOPT_FOLLOWLOCATION);
        
    curl_setopt$curlCURLOPT_HEADER);
        
    curl_setopt$curlCURLOPT_RETURNTRANSFER);
        
        
    $data curl_exec$curl ); // XML data returned..
        
    $xml = new SimpleXMLElement$data ); // data is now in XML object..
    }
    ?>

    <form enctype="multipart/form-data" action="?action=upload" method="POST">
        <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="image" type="file" />
        <br/>
        <input type="submit" value="Upload File" />
    </form>
    Logged in example:

    PHP Code:
    <?php
    if($_GET ["action"] == "upload") {
        
        
    $image file_get_contents$_FILES ["image"] ["tmp_name"] );
        
        
    $image urlencode$image );
        
    $curl curl_init"http://www.tehupload.com/api/upload.Image/username=user&password=pass&album=1644" );
        
        
    $postvars ["imageData"] = $image;
        
        
    curl_setopt$curlCURLOPT_POST);
        
    curl_setopt$curlCURLOPT_POSTFIELDS$postvars );
        
    curl_setopt$curlCURLOPT_FOLLOWLOCATION);
        
    curl_setopt$curlCURLOPT_HEADER);
        
    curl_setopt$curlCURLOPT_RETURNTRANSFER);
        
        
    $data curl_exec$curl ); // XML data returned..
        
    $xml = new SimpleXMLElement$data ); // data is now in XML object..
    }
    ?>

    <form enctype="multipart/form-data" action="?action=upload" method="POST">
        <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="image" type="file" />
        <br/>
        <input type="submit" value="Upload File" />
    </form>
    ---------------------------------------
    user.Info
    ---------------------------------------
    Parameters:
    username - TehUpload username
    password - TehUpload password

    Returns:
    status - error, success
    message - message relating to status

    info
    username - TehUpload username
    email - TehUpload e-mail address
    "registered-timestamp" - timestamp user registered on
    fullName - user's full name (optional)
    activated - is user activated? 1 = yes, 0 = no
    totalUploads - total number of uploads to TehUpload
    "lastLogin-timestamp" - timestamp of last login
    optional
    msn
    yahoo
    skype
    aim
    avatar - user avatar filename
    biography
    Here is an example URL, with an example response:

    Code:
    http://www.tehupload.com/api/user.Info/username=username&password=password
    Code:
    <tehupload>
      <status>success</status>
      <message>credentials are correct</message>
      <content>
        <info>
          <username>BarryMingle</username>
          <email>[email protected]</email>
          <registered-timestamp>1217697357</registered-timestamp>
          <fullName>Barry Mingle</fullName>
          <activated>1</activated>
          <totalUploads>268</totalUploads>
          <lastLogin-timestamp>1226762615</lastLogin-timestamp>
          <optional>
            <msn></msn>
            <yahoo></yahoo>
            <skype></skype>
            <aim></aim>
            <avatar>5001a501d35f34224500bb3be8858fIMG_1647k.jpg</avatar>
            <biography></biography>
          </optional>
        </info>
      </content>
    </tehupload>
    PHP Example:

    PHP Code:
    <?php
    $username 
    "Bob";
    $password "Jimbo";

    $file = @file_get_contents"http://www.tehupload.com/api/user.Info/username={$username}&password={$password});

    $xml = new SimpleXMLElement$file );

    $email $xml->content->info->email;
    ?>
    ---------------------------
    Should be easy enough to integrate it into your application.

    If you have any ideas for data that should be returned, or ideas for new methods to be incorporated, please let me know.

    Thanks!
    ---------------------------
    Last edited by Dentafrice; 22-11-2008 at 10:15 PM.

  2. #2
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    youmeo shud use this for users to add their photos

  3. #3
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Just updated the post with a new method:

    user.Info

    adding a new field to user.Info

    totalUploads

  4. #4
    Join Date
    Sep 2008
    Location
    UK
    Posts
    3,670
    Tokens
    0

    Latest Awards:

    Default

    Looks good And Jack they already upload to yahoo I think
    Back for a while.

  5. #5
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    I think they use Amazon S3.. or did.

  6. #6
    Join Date
    Sep 2008
    Location
    UK
    Posts
    3,670
    Tokens
    0

    Latest Awards:

    Default

    Ahh yeah, sorry
    Back for a while.

  7. #7
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    No problem ;P haha.

  8. #8
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    I'm working on some updates to it now, going to include a few more user-related feed features based on privacy.

  9. #9
    Join Date
    Jan 2008
    Posts
    3,711
    Tokens
    100

    Latest Awards:

    Default

    I don't know anything about this, but it looks good =)

  10. #10
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Quote Originally Posted by Meti View Post
    I don't know anything about this, but it looks good =)
    Not being mean, but why waste post count and post?

Page 1 of 7 12345 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •