1. Post #81
    Gold Member
    toaster468's Avatar
    January 2010
    3,260 Posts
    Nope, you're just failing apparently. Doubly so for using IE6.

    Edited:



    Sadly you'll need to just look at the username_html field, usergroups aren't exposed in the HTML in any other way as far as I know.
    I tried using the api website from school.

  2. Post #82
    Gold Member
    gparent's Avatar
    January 2005
    3,949 Posts
    It doesn't stop someone attacking the real Facepunch server(s?) and static content is something you can just stick appropriate cache headers on
    But then you have to serve the static content a lot more (once per new client). With CloudFlare, the servers are geographically distributed so you have lower latency (which improves user experience), and you get to take load off the FP server onto the CloudFlare server for static content being served to new clients.

  3. Post #83
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    With CloudFlare, the servers are geographically distributed so you have lower latency
    shame facepunch.com gets routed to LA for me rather than Tokyo, Singapore or Hong Kong then

  4. Post #84
    That Dog
    Ehmmett's Avatar
    March 2009
    13,808 Posts
    What is the user agent for people who post from the api?
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1 (list)

  5. Post #85
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    What is the user agent for people who post from the api?
    It's a Firefox user agent, but this is changing soon.

  6. Post #86
    Gold Member
    gparent's Avatar
    January 2005
    3,949 Posts
    shame facepunch.com gets routed to LA for me rather than Tokyo, Singapore or Hong Kong then
    Well hey, they can't have servers everywhere. Plus the dynamic content needs to reach the FP servers anyway. But it helps!

  7. Post #87
    Person
    geel9's Avatar
    June 2008
    5,741 Posts
    It's a Firefox user agent, but this is changing soon.
    Maybe after you implement the API keys, have devs choose the user agent per app?
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 5 (list)

  8. Post #88
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Well hey, they can't have servers everywhere. Plus the dynamic content needs to reach the FP servers anyway. But it helps!
    they have servers in tokyo, singapore and hong kong

  9. Post #89
    Gold Member
    gparent's Avatar
    January 2005
    3,949 Posts
    they have servers in tokyo, singapore and hong kong
    Then email them? What can I say, I don't work for them. Issues like these can be caused by either the ISP or the content provider, and neither of them will find out unless someone complains.

  10. Post #90

    May 2011
    26 Posts
    Pretty nice work Hexxeh.

    Without sounding like a newfag or a total retard. We're allowed to use this for what ever? (None malicious) say I wanted to make an app or something? I did add you on steam.

    Pretty nice though. Grats.

    Brad,
    Reply With Quote Edit / Delete Reply Mac United Kingdom Show Events Dumb Dumb x 1 (list)

  11. Post #91
    Gold Member
    dije's Avatar
    December 2008
    4,760 Posts
    Test
    Reply With Quote Edit / Delete Reply Sweden Show Events Programming King Programming King x 3 (list)

  12. Post #92
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    It's a Firefox user agent, but this is changing soon.
    Are we still getting that generic FPAPI user agent?

  13. Post #93
    Gold Member
    Programmer's Avatar
    February 2012
    98 Posts
    It's a Firefox user agent, but this is changing soon.


    huh. ( look a this user agent. )

  14. Post #94
    Gold Member
    dije's Avatar
    December 2008
    4,760 Posts


    huh. ( look a this user agent. )
    That's on the API website

    Edited:

    (Sadly)

    Edited:

    Testing api

    Edited:

    Testing my Java Library. Ignore this post :)

    Edited:

    It works!
    Reply With Quote Edit / Delete Reply Windows 7 Sweden Show Events Informative Informative x 1 (list)

  15. Post #95
    Person
    geel9's Avatar
    June 2008
    5,741 Posts
    Alright, fine, I'll post them here.

    -getnewposts does not return a current page field, which is necessary because my app can't know what page the new posts are on.
    -Trying to access the google forum or the golds workshiop returns an error saying I don't have permission, despite having permission.

  16. Post #96
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    Fixed both, please verify.

    It also posts with a custom user-agent now, but I don't think the icons are setup FP side for it.

    Apologies for the huge delay on that, I know it's a simple tweak but I've been so bogged down with uni work past few weeks I just didn't get chance to even look at it.
    Reply With Quote Edit / Delete Reply Mac United Kingdom Show Events Friendly Friendly x 2Winner Winner x 1 (list)

  17. Post #97
    Person
    geel9's Avatar
    June 2008
    5,741 Posts
    It works, aside from the field being called "currpage"

  18. Post #98
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    It works, aside from the field being called "currpage"
    Um, that's intentional. Current.

  19. Post #99
    Person
    geel9's Avatar
    June 2008
    5,741 Posts
    Ah. I'm just used to using only one r, I guess it's a matter of opinion.

    Thanks!
    Reply With Quote Edit / Delete Reply Windows 8 United States Show Events Agree Agree x 1 (list)

  20. Post #100
    Pocoyo's Avatar
    June 2009
    384 Posts
    getthreads action should include the title of the forum.

  21. Post #101
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    Added.
    Reply With Quote Edit / Delete Reply Mac United Kingdom Show Events Programming King Programming King x 3Winner Winner x 1 (list)

  22. Post #102
    Pocoyo's Avatar
    June 2009
    384 Posts
    thank you

    also maybe getposts could tell which subforum the thread is in. would be nice.

    same for getthreads i guess.

    a little bug

    http://facepunch.com/threads/1170850
    the api would show that the OP's avatar is /fp/social/homepage.png, even though he doesnt have an avatar.

  23. Post #103
    Jaykin Bacon: Episode 3
    SteveUK's Avatar
    May 2005
    2,470 Posts
    Hexxeh, do you think you could add an API action for retrieving threads you are subscribed to?
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Agree Agree x 5 (list)

  24. Post #104
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    Yep, it's coming real soon, it was suggested earlier this week but I've been really busy and not had chance to write it.

    Might get chance later today to write it up.

  25. Post #105
    Ybbats's Avatar
    February 2012
    810 Posts
    Ah. I'm just used to using only one r, I guess it's a matter of opinion.

    Thanks!
    Not really, it's mostly abbreviated as 'cur' for programmers, every time I've seen.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 5Disagree Disagree x 1 (list)

  26. Post #106
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    I've added subscribed threads to the API, however, I don't have enough threads subscribed to see whether or not the subscribed threads page has multiple pages.

    If it does, can someone let me know the parameter name for the page number?

    Currently only the default folder is supported, adding folder support at the moment.

  27. Post #107
    That Dog
    Ehmmett's Avatar
    March 2009
    13,808 Posts
    How many incorrect logins until a shutout? and how long is a shutout?

    I keep fucking something up. :/

  28. Post #108
    Pocoyo's Avatar
    June 2009
    384 Posts
    thank you

    also maybe getposts could tell which subforum the thread is in. would be nice.

    same for getthreads i guess.

    a little bug

    http://facepunch.com/threads/1170850
    the api would show that the OP's avatar is /fp/social/homepage.png, even though he doesnt have an avatar.
    in case you missed this post hexxeh, sorry if you are aware but busy.

  29. Post #109
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    in case you missed this post hexxeh, sorry if you are aware but busy.
    Forgot about it, I'll get around to it soon.

    How many incorrect logins until a shutout? and how long is a shutout?

    I keep fucking something up. :/
    This is enforced by Facepunch, not the API server. I'm not sure what it's set at currently, maybe 15 minutes?
    Reply With Quote Edit / Delete Reply Mac United Kingdom Show Events Agree Agree x 1 (list)

  30. Post #110
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    5 tries then a 15 minute grace on the last incorrect login, if I recall correctly.

  31. Post #111
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    Fixed the incorrect avatar URL for users without avatars, you simply won't get an avatar key now if they don't have an avatar.

    Edited:

    getthreads and getposts calls will return their container name and ID now.

    Think that's all the stuff you asked for sorted Pocoyo?

  32. Post #112
    CoderHire
    _Undefined's Avatar
    November 2007
    1,466 Posts
    PM'd you Hexxeh but not sure if you got it. Would you be able to add jsonp support to the api?

    For example, adding a get parameter of "callback=test" would make the api reply with, for example:

    Code:
    test({
        "login": "Login OK"
    })
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Dumb Dumb x 1 (list)

  33. Post #113
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    Curious as to why you'd need this, when cross-origin requests are already permitted?
    Reply With Quote Edit / Delete Reply Mac United Kingdom Show Events Agree Agree x 1 (list)

  34. Post #114
    CoderHire
    _Undefined's Avatar
    November 2007
    1,466 Posts
    jQuery is very annoying about it. Doing "$.getJSON(url, function(data){});" gives an error of "Uncaught SyntaxError: Unexpected token :" because it's expecting a function wrapped around it.

    I've gotten around it by not using jQuery, so I don't _need_ it now, but it'd still be useful.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Dumb Dumb x 1 (list)

  35. Post #115
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    jQuery is very annoying about it. Doing "$.getJSON(url, function(data){});" gives an error of "Uncaught SyntaxError: Unexpected token :" because it's expecting a function wrapped around it.

    I've gotten around it by not using jQuery, so I don't _need_ it now, but it'd still be useful.
    It shouldn't do that if you don't include &callback= in your request.

  36. Post #116
    CoderHire
    _Undefined's Avatar
    November 2007
    1,466 Posts
    It shouldn't do that if you don't include &callback= in your request.
    You're absolutely correct. My apologies.

  37. Post #117
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    You're absolutely correct. My apologies.
    No worries. Look forward to seeing what you create with the API.

  38. Post #118
    quality poster
    Dennab
    August 2009
    12,242 Posts
    jQuery is very annoying about it. Doing "$.getJSON(url, function(data){});" gives an error of "Uncaught SyntaxError: Unexpected token :" because it's expecting a function wrapped around it.

    I've gotten around it by not using jQuery, so I don't _need_ it now, but it'd still be useful.
    use this:

    Code:
    $.get(url, function(data) {
    	// do work son			
    });
    getJSON wasn't working for me either

  39. Post #119
    quality poster
    Dennab
    August 2009
    12,242 Posts
    API down for an update or something?

  40. Post #120
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    Currently it's operating from a server hosted in an OVH datacentre. OVH's network just fell over completely, apparently all servers connected to their network have lost connectivity.

    I'm moving it soon to an SSD based VPS in Germany, with 2x the RAM and 10x the bandwidth, where this shit shouldn't affect us.
    Reply With Quote Edit / Delete Reply Mac United Kingdom Show Events Winner Winner x 3 (list)