Difference between revisions of "SpaceAPI"

From Hackerspace ACKspace
Jump to: navigation, search
m (added link)
(updated the project)
Line 1: Line 1:
 
{{Project
 
{{Project
|State=Active
+
|State=Completed
 
|Members=Vicarious, CoolePascal
 
|Members=Vicarious, CoolePascal
 
|Description=HackerSpace Status API
 
|Description=HackerSpace Status API
Line 61: Line 61:
 
</pre>
 
</pre>
  
* Uploaded it to [https://ackspace.nl/status/index.php https://ackspace.nl/status/index.php] but the URL can be changed if necessary..
+
* Uploaded it to [https://ackspace.nl/status.php https://ackspace.nl/status.php] but the URL can be changed if necessary..
 
* From the SpaceAPI website: "In order to be able to retrieve the object from within a javascript sandbox, the server of the JSON object should set the ‘Access-Control-Allow-Origin’ header with a value of ‘*’ ".
 
* From the SpaceAPI website: "In order to be able to retrieve the object from within a javascript sandbox, the server of the JSON object should set the ‘Access-Control-Allow-Origin’ header with a value of ‘*’ ".
 +
* Added the JSON object to the existing [[Space state]] PHP script. Thanks [[User:Coolepascal|CoolePascal]] for the help with the PHP stuff!
  
== To do list: ==
+
== To do list: (Optional) ==
 
* I created and uploaded really simple [https://ackspace.nl/icon/open.png open] & [https://ackspace.nl/icon/closed.png closed] icons so they won't give HTTP 404 errors, improved icons are welcome! -- [[User:Vicarious|Vicarious]] 12:37, 9 December 2011 (CET)
 
* I created and uploaded really simple [https://ackspace.nl/icon/open.png open] & [https://ackspace.nl/icon/closed.png closed] icons so they won't give HTTP 404 errors, improved icons are welcome! -- [[User:Vicarious|Vicarious]] 12:37, 9 December 2011 (CET)
* Add the JSON object to the existing [[Space state]] perl script or create a new script.
 
 
* From the SpaceAPI website: "Additionally, it might be beneficial to add a ‘Cache-Control’ header with a value of ‘no-cache’, to prevent browser caches from retaining old data."
 
* From the SpaceAPI website: "Additionally, it might be beneficial to add a ‘Cache-Control’ header with a value of ‘no-cache’, to prevent browser caches from retaining old data."

Revision as of 18:05, 12 December 2011

Project: SpaceAPI
Featured:
State Completed
Members Vicarious, CoolePascal
GitHub No GitHub project defined. Add your project here.
Description HackerSpace Status API
Picture
No project picture! Fill in form Picture or Upload a jpeg here

See hackerspaces.nl SpaceAPI website for details.

Done so far:

  • Prepared the JSON object:

If ACKspace is open:

{
  "api":"0.11",
  "space":"ACKspace",
  "logo":"https:\/\/ackspace.nl\/ACKspace.150px.png",
  "icon":{
    "open":"https:\/\/ackspace.nl\/icon\/open.png",
    "closed":"https:\/\/ackspace.nl\/icon\/closed.png"
  },
  "url":"https:\/\/ackspace.nl\/",
  "address":"Kloosterweg 1, 6411 VM Heerlen, The Netherlands",
  "contact":[
    {"phone":"+31457112345"},
    {"sip":"sip:31457112345@sip1.budgetphone.nl"},
    {"irc":"irc://freenode/#ACKspace"},
    {"twitter":"@ACKspace"},
    {"email":"contact@ackspace.nl"},
    {"ml":"info@lists.ackspace.nl"},
  "open":true,
  "status":"open for public",
  "lastchange":1320586506,
}


If ACKspace is closed:

{
  "api":"0.11",
  "space":"ACKspace",
  "logo":"https:\/\/ackspace.nl\/ACKspace.150px.png",
  "icon":{
    "open":"https:\/\/ackspace.nl\/icon\/open.png",
    "closed":"https:\/\/ackspace.nl\/icon\/closed.png"
  },
  "url":"https:\/\/ackspace.nl\/",
  "address":"Kloosterweg 1, 6411 VM Heerlen, The Netherlands",
  "contact":[
    {"phone":"+31457112345"},
    {"sip":"sip:31457112345@sip1.budgetphone.nl"},
    {"irc":"irc://freenode/#ACKspace"},
    {"twitter":"@ACKspace"},
    {"email":"contact@ackspace.nl"},
    {"ml":"info@lists.ackspace.nl"},
  "open":false,
  "status":"closed",
  "lastchange":1320586507,
}
  • Uploaded it to https://ackspace.nl/status.php but the URL can be changed if necessary..
  • From the SpaceAPI website: "In order to be able to retrieve the object from within a javascript sandbox, the server of the JSON object should set the ‘Access-Control-Allow-Origin’ header with a value of ‘*’ ".
  • Added the JSON object to the existing Space state PHP script. Thanks CoolePascal for the help with the PHP stuff!

To do list: (Optional)

  • I created and uploaded really simple open & closed icons so they won't give HTTP 404 errors, improved icons are welcome! -- Vicarious 12:37, 9 December 2011 (CET)
  • From the SpaceAPI website: "Additionally, it might be beneficial to add a ‘Cache-Control’ header with a value of ‘no-cache’, to prevent browser caches from retaining old data."