ColdFusion - Avatar.cfm

Results 1 to 14 of 14
  1. #1
    <insert title here> Shorty is offline
    MemberRank
    Feb 2007 Join Date
    United KingdomLocation
    1,861Posts

    ColdFusion - Avatar.cfm

    Hey RZ,

    Recently I noticed all Habboon referal requests for Habbo Avatars were being forbidden by Habbo Servers, so I decided to create a script to get around it.

    Firstly I thought saving the image and reading it was a good idea..

    Code:
    <cfif IsDefined("url.figure")>
    <cfset thisAvatarSize = "">
    <cfset thisAvatarSizeName = "">
    <cfif IsDefined("url.size")>
     <cfset thisAvatarSize = "s">
     <cfset thisAvatarSizeName = "-small">
    </cfif>
    <!-- Gather Path -->
    <cfset thisPath = ExpandPath("*.*")>
    <cfset thisAvatar = GetDirectoryFromPath(thisPath) & url.figure & #thisAvatarSizeName# & ".gif">
    <cfif NOT FileExists(thisAvatar)>
     <cfhttp method="get" url="http://www.habbo.com/habbo-imaging/a...thisAvatarSize#" useragent="#CGI.http_user_agent#" getasbinary="yes" result="objGET">
      <cfhttpparam type="HEADER" name="referer" value="http://habbo.com/Home/HeyGuys-ItsShorty"/>
     </cfhttp>
     <cfif FindNoCase( "200", objGET.StatusCode )> 
      <cffile action="write" file="#ExpandPath( './#url.figure##thisAvatarSizeName#.gif' )#" output="#objGET.FileContent#" />
     </cfif>
    </cfif>
    <cffile action="READBINARY" file="#thisAvatar#" variable="AvatarImage">
    <cfcontent variable="#AvatarImage#" >
    </cfif>
    But then after three days we ended up with 55k images, so I thought reading them directly from Habbo.com was the best idea.

    Code:
    <cfif IsDefined("url.figure")>
    <cfset thisAvatarSize = "">
    <cfset thisAvatarDirection = "2">
    <cfset thisAvatarHeadDirection = "2">
    <cfset thisAvatarAction = "">
    <cfset thisAvatarGesture = "">
    <cfif IsDefined("url.size")>
     <cfset thisAvatarSize = "s">
    </cfif>
    <cfif IsDefined("url.direction")>
     <cfset thisAvatarDirection = url.direction>
    </cfif>
    <cfif IsDefined("url.head_direction")>
     <cfset thisAvatarHeadDirection = url.head_direction>
    </cfif>
    <cfif IsDefined("url.action")>
     <cfset thisAvatarAction = url.action>
    </cfif>
    <cfif IsDefined("url.gesture")>
     <cfset thisAvatarGesture = url.gesture>
    </cfif>
    <cfhttp method="get" url="http://www.habbo.com/habbo-imaging/a...sAvatarGesture#" useragent="#CGI.http_user_agent#" timeout="5" getasbinary="yes" result="objGET">
     <cfhttpparam type="HEADER" name="referer" value="http://habbo.com/Home/HeyGuys-ItsShorty"/>
    </cfhttp>
    <cfcontent variable="#objGet.FileContent#">
    </cfif>
    Use as you wish..


  2. #2
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: ColdFusion - Avatar.cfm

    55k?!?! Unless you were caching them improperly it should have been fine.

    Good Job, mate.

  3. #3
    <insert title here> Shorty is offline
    MemberRank
    Feb 2007 Join Date
    United KingdomLocation
    1,861Posts

    Re: ColdFusion - Avatar.cfm

    Quote Originally Posted by Makarov View Post
    55k?!?! Unless you were caching them improperly it should have been fine.

    Good Job, mate.
    We have a lot of avatars around the site, which get visited a lot.

  4. #4
    The one and only! Hejula is offline
    MemberRank
    Nov 2008 Join Date
    4,128Posts

    Re: ColdFusion - Avatar.cfm

    Quote Originally Posted by Shorty View Post
    We have a lot of avatars around the site, which get visited a lot.
    However if you cache say both the small and normal figures for the user when they visit the site (after its checked the avatar isn't cached) it should be faster, no? You could also stick the script behind a CDN to make it even faster :P

  5. #5
    <insert title here> Shorty is offline
    MemberRank
    Feb 2007 Join Date
    United KingdomLocation
    1,861Posts

    Re: ColdFusion - Avatar.cfm

    Quote Originally Posted by Hejula View Post
    However if you cache say both the small and normal figures for the user when they visit the site (after its checked the avatar isn't cached) it should be faster, no? You could also stick the script behind a CDN to make it even faster :P
    No point caching anyway, directly from Habbo.com was what I wanted to-do in the first place, I just got side-tracked.

  6. #6
    Live Ocottish Sverlord Joopie is offline
    LegendRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,773Posts

    Re: ColdFusion - Avatar.cfm

    Quote Originally Posted by Shorty View Post
    Hey RZ,

    Recently I noticed all Habboon referal requests for Habbo Avatars were being forbidden by Habbo Servers, so I decided to create a script to get around it.
    Uhm, I can still get direct access the image?

    http://www.habbo.com/habbo-imaging/a...5-80.sh-290-92

  7. #7
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: ColdFusion - Avatar.cfm

    Quote Originally Posted by joopie View Post
    Uhm, I can still get direct access the image?

    http://www.habbo.com/habbo-imaging/a...5-80.sh-290-92
    They must have changed it because it would redirect to the maint. page, which is why I tackled caching first.

  8. #8
    <insert title here> Shorty is offline
    MemberRank
    Feb 2007 Join Date
    United KingdomLocation
    1,861Posts
    Quote Originally Posted by joopie View Post
    Uhm, I can still get direct access the image?

    http://www.habbo.com/habbo-imaging/a...5-80.sh-290-92
    Sulake have started to block some hotels, as I said somewhere Habboon was giving off forbidden errors from Sulakes web severs from Habboon referrals.
    Posted via Mobile Device

  9. #9
    Enthusiast typtyp27 is offline
    MemberRank
    May 2007 Join Date
    HollandLocation
    29Posts

    Re: ColdFusion - Avatar.cfm

    Where do you need to put in this code?

  10. #10
    Account Upgraded | Title Enabled! Wupz0r is offline
    MemberRank
    Oct 2011 Join Date
    RaGEZONELocation
    229Posts

    Re: ColdFusion - Avatar.cfm

    Quote Originally Posted by typtyp27 View Post
    Where do you need to put in this code?
    Code:
    C:/xampp/htdocs

  11. #11
    "(still lacks brains)" NoBrain is offline
    MemberRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts

    Re: ColdFusion - Avatar.cfm

    Quote Originally Posted by Wupz0r View Post
    Code:
    C:/xampp/htdocs
    That's really going to help him...

  12. #12
    Account Upgraded | Title Enabled! Wupz0r is offline
    MemberRank
    Oct 2011 Join Date
    RaGEZONELocation
    229Posts

    Re: ColdFusion - Avatar.cfm

    Quote Originally Posted by Jupos View Post
    That's really going to help him...
    Aw, dude. You have to ask the Thread Creator.

    Where to put it, he have to answer.

  13. #13
    Account Upgraded | Title Enabled! Muscab is offline
    MemberRank
    Oct 2009 Join Date
    264Posts

    Re: ColdFusion - Avatar.cfm

    Quote Originally Posted by Wupz0r View Post
    Aw, dude. You have to ask the Thread Creator.

    Where to put it, he have to answer.
    Just your virtual directory, either wwwroot or htdocs

  14. #14
    Alpha Member Danny is offline
    MemberRank
    Oct 2011 Join Date
    My PCLocation
    2,158Posts

    Re: ColdFusion - Avatar.cfm

    Nice job Shorty. Also good luck on PhoenixCF 2.0

    ---------- Post added at 09:32 PM ---------- Previous post was at 09:28 PM ----------

    Quote Originally Posted by typtyp27 View Post
    Where do you need to put in this code?
    The codes go in characters.cfm



Advertisement