GetSimple Support Forum
Extend API - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Developer Discussions (http://get-simple.info/forums/forumdisplay.php?fid=8)
+--- Thread: Extend API (/showthread.php?tid=1092)



Extend API - JWH_Matthew - 2010-11-02

I was attempting the other day to add a check to one of my plugins to see if there was a new version available on the GS extend.

When I attempted this, I was unable to get it to work. I got an error (don't remember exactly what it was though) after some research I came to the conclusion that my host does not support outside domain requests. (is this even possible?)

If this is possible, is it even worth adding something like that to a plugin if it won't work on some hosts?

Also this is more of a question for chris, but is it possible to extend the API to gather specific user data such as email, username, and ECT.. Not sure exactly how you would do this but I think it would be nice.


Extend API - Zegnåt - 2010-11-03

Administrators can disable file_get_contents() outside of the server, that’s very possible. It depends on the fopen wrapper setting. Don’t ask me what the security concerns were though. I can’t recall.

If you want to use it inside your plugin you will probably need to do something like this:
Code:
if ((bool)ini_get('allow_url_fopen')) {
    // use fopen
} elseif (in_array('curl',get_loaded_extensions())) {
    // use cURL
} else {
    // server has no way to get external file
}



Extend API - ccagle8 - 2010-11-03

i hope this isnt the case, but of course - i cant test this outside of my own server. I dont think it is blocked though... but then again, this underscores why I need to get a host dedicated to GS. (but i cant pay for it, so i need some sort of donation to make it happen...)


Extend API - Zegnåt - 2010-11-03

It shouldn’t be caused by anything on this end of the API, Chris. Of course I’m saying ‘shouldn’t’ because I can’t be 100% sure unless Matt can post his error.

This reminds me, can we get JSONP on the API aswell? For those who want to use Javascript? I can implement it if you send me the current API source.


Extend API - ccagle8 - 2010-11-03

no problem... i just sent it to you via email.


Extend API - JWH_Matthew - 2010-11-03

I will post the source and my error when I get home..