User Tools

Site Tools


plugins:extend_api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
plugins:extend_api [2011/03/04 16:43]
ccagle8
plugins:extend_api [2014/02/07 09:58] (current)
datiswous [PHP Example Code]
Line 1: Line 1:
-====== Using the GetSimple API ======+====== Using the GetSimple ​Extend ​API ======
  
 With the creation of GetSimple Extend comes a new API that allows developers the ability to grab vital statistics from your Extend profile and integrate them into your site or plugin. For example, A plugin developer can now code their plugin to look at our API and automatically determine if there is an update available or not. With the creation of GetSimple Extend comes a new API that allows developers the ability to grab vital statistics from your Extend profile and integrate them into your site or plugin. For example, A plugin developer can now code their plugin to look at our API and automatically determine if there is an update available or not.
Line 5: Line 5:
 ===== API Syntax ===== ===== API Syntax =====
  
-''​http://​get-simple.info/​api/​extend/?​id=##''​+**Extend ID based call:** 
 +<​code>​http://​get-simple.info/​api/​extend/?​id=##​</​code>​ 
 +Replace ​''​##''​ with the ID of your plugin in our Extend repository. You can get your id by logging into Extend and viewing the particular file in question. This is the most 100% sure-fire way to identify your plugin because just as long as you do not delete your plugin from Extend, your ID will //never// change. [[http://​get-simple.info/​api/​extend/?​id=30|Live example]]
  
-Replace ## with the ID of your plugin ​in our repositoryYou can get your id by logging ​into Extend ​and viewing ​your files.+**Plugin Initial File based call:** (plugins only) 
 +<​code>​http://​get-simple.info/​api/​extend/?​file=#####​.php</​code>​ 
 +Replace ​''​#####​.php'' ​with the filename ​of your main plugin ​fileIn order to use this call, your plugin needs to be [[plugins:​update_notifications|packaged the correct way]] before uploaded ​into Extend. This will only work if your main-file is completely unique across all plugins within Extend. Try to name your main plugin file something completely unique. (This is the way that GS v3.1 checks to see if plugin updates are available.) [[http://​get-simple.info/​api/​extend/?​file=translate.php|Live example]]
  
-[[http://​get-simple.info/​api/​extend/?​id=30|Live example]] +===== API Result Set ===== 
- +The result set for either call above sends back a json encoded string that looks like this:
-The API sends back a json encoded string that looks like this:+
  
 <code json> <code json>
-{"​status":"​successful","​id":"​30","​name":"​Cardinal","​version":"​1.0","​downloads":"​4", "category":"​Theme","​path":"​http:​\/​\/​get-simple.info\/​extend\/​theme\/cardinal\/30\/", "​file":"​http:​\/​\/​get-simple.info\/​extend\/​download.php?​file=files\/2\/cardinal.zip&id=30", "owner":"​ccagle8","​tags":"​cardinal, red, two column"}+{"​status":"​successful","​id":"​112","​filename_id":"​translate.php","​name":"​Translate","​version":"​0.3","​category":"​Plugin","​tags":"​translation,​ languages, internationalization,​ i18n","​tested_with":"​2.03","​updated_date":"​March 25, 2011","​support_url":"​http:​\/​\/​get-simple.info\/​forum\/​topic\/​1610\/​translation-plugin\/","​author_url":"​http:​\/​\/​mvlcek.bplaced.net","​owner":"​mvlcek","​path":"​http:​\/​\/​get-simple.info\/​extend\/​plugin\/translate\/112\/","​file":"​http:​\/​\/​get-simple.info\/​extend\/​export\/2902\/112\/translate.zip","​downloads":"​80","​rating":""​}
 </​code>​ </​code>​
  
-Since this is json, you can turn the above into a PHP array with json_decode($response). The resulting array will look like this:+Since the result ​is in json format, you can turn the above into a PHP object ​array with ''​json_decode($response)''​. The resulting array will look like this:
  
-<​code>​+<​code ​php>
 stdClass Object stdClass Object
-+(  
-    [status] => successful +  [author_url] => http=>//​mvlcek.bplaced.net 
-    [id] => 30 +  [category] => Plugin 
-    [name] => Cardinal +  [downloads] => 80 
-    [version] => 1.0 +  [file] => http=>//​get-simple.info/​extend/​export/​2902/​112/​translate.zip 
-    [downloads] => 2 +  [filename_id] => translate.php 
-    [category] => Theme +  [id] => 112 
-    [path] => http://​get-simple.info/​extend/​theme/cardinal/30+  ​[name] => Translate 
-    [file] => http://​get-simple.info/​extend/download.php?​file=files/2/cardinal.zip&​id=30 +  [owner] => mvlcek 
-    [owner] => ccagle8+  ​[path] => http=>//​get-simple.info/​extend/​plugin/translate/112
-    [tags] => cardinalred, two column+  [rating] => 4.8 
 +  [status] => successful 
 +  [support_url] => http=>//​get-simple.info/​forum/topic/1610/​translation-plugin
 +  [tags] => translationlanguages, internationalization,​ i18n 
 +  [tested_with] => 2.03 
 +  [updated_date] => March 252011 
 +  [version] => 0.3
 )</​code>​ )</​code>​
  
-===== Full Example in PHP =====+===== PHP Example Code =====
  
 This will echo out the latest version number for the live example above. This will echo out the latest version number for the live example above.
  
-<​code>​+<​code ​php>
 $my_plugin_id = 30; // replace this with yours $my_plugin_id = 30; // replace this with yours
  
Line 51: Line 60:
 </​code>​ </​code>​
  
-===== Limitations =====+===== Extend API Limitations =====
  
-This API is only refreshed every 4 hours. This is to limit the server load for a service that does not need to be checked any more frequently than that. Please use responsibly.+This API is cached, and is allowed to be refreshed every 4 hours. ​ This is to limit the server load for a service that does not need to be checked any more frequently than that. Please use this API responsibly.
plugins/extend_api.1299257026.txt.gz · Last modified: 2013/04/19 14:57 (external edit)