API Question

Discussion in 'PHP' started by Kalyse, May 31, 2009.

  1. #1
    I am a good PHP coder so I know how to do a lot of things, however this one has stumped me.
    I would like to develop an API on my current website which will give users access to anything they want, providing the users agree.

    Its kind of like a CMS, unfortunately I can't link for you.

    Anyway, whats the best way to allow private developers the ability to code their own PHP applications and have them linked on the site.

    Ie. If a developer wants to design a calandar or appointment.. they can use the API to get all the relevant information and then work with it to display the pages.

    However - How should I include their PHP scripts? Is there any actual safe way of doing it?
    I was thinking of.. a user hosts their own PHP scripts, my site then just does a curl or simple get. Grabs the output and loads it on the page. Then if someone enters anything then.. ie clicks anything then it posts to their site... they use that information to do whatever they want? Is this feasible?


    I may look into Facebook to see how that does it for their applications.. since the concept is SOMEWHAT analagous.
     
    Kalyse, May 31, 2009 IP
  2. Sudoku-Master

    Sudoku-Master Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you can use the snoopy webclient class to grap foreign content and to post later userinteractivity to the foreign site... but if you use snoopy take that snoopyclass that is in wordpress integrated, the snoopyclass from the original project website have a few bugs... so it send allways the portnumber and then some webserver redirect to the url without portnumber, and snoopy sends a new request with portnumber an get again the redirect... and so on...
     
    Sudoku-Master, May 31, 2009 IP
  3. johnkramlich

    johnkramlich Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Checkout the Oreilly book, "Designing RESTful web services" It discusses how you can write your own API to respond to clients.

    Hosting the PHP code on your server could be a major security risk. You may be able to allow users to create and upload something like a Smarty Template instead.
     
    johnkramlich, May 31, 2009 IP
  4. Kalyse

    Kalyse Peon

    Messages:
    1,221
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I will look into that book. Thanks John.
     
    Kalyse, Jun 2, 2009 IP