Difference between revisions of "SpaceAPI"

From Hackerspace ACKspace
Jump to: navigation, search
(updated the project)
(SpaceAPI 0.12 -> 0.13)
Line 1: Line 1:
 
{{Project
 
{{Project
 
|State=Completed
 
|State=Completed
|Members=Vicarious, CoolePascal
+
|Members=Vicarious, CoolePascal, Prodigity
 
|Description=HackerSpace Status API
 
|Description=HackerSpace Status API
 
}}
 
}}
Line 8: Line 8:
 
== Done so far: ==
 
== Done so far: ==
  
* Prepared the JSON object:
+
* Updated JSON object to become SpaceAPI 0.13 compliant (see status.php)
 +
**Content type and Cache-Control headers are now sent
 +
**Now uses location object
 +
**Now uses state object
 +
**Space state now has a third state; null. (In case of uncertain state)
  
If ACKspace is open:
 
 
<pre>
 
<pre>
 
{
 
{
   "api":"0.11",
+
   "api":"0.13",
 
   "space":"ACKspace",
 
   "space":"ACKspace",
   "logo":"https:\/\/ackspace.nl\/ACKspace.150px.png",
+
   "logo":"https://ackspace.nl/ACKspace.150px.png",
   "icon":{
+
   "url":"https://ackspace.nl/",
    "open":"https:\/\/ackspace.nl\/icon\/open.png",
+
  "location":{
     "closed":"https:\/\/ackspace.nl\/icon\/closed.png"
+
     "address":"Kloosterweg 1, 6412 CN Heerlen, The Netherlands",
 +
    "lat":50.892665,
 +
    "lon":5.971104
 
   },
 
   },
   "url":"https:\/\/ackspace.nl\/",
+
   "issue_report_channels":[
   "address":"Kloosterweg 1, 6411 VM Heerlen, The Netherlands",
+
    "email"
  "contact":[
+
  ],
    {"phone":"+31457112345"},
+
   "feeds":{
     {"sip":"sip:31457112345@sip1.budgetphone.nl"},
+
    "calendar":{
     {"irc":"irc://freenode/#ACKspace"},
+
      "type": "text/calendar",
     {"twitter":"@ACKspace"},
+
      "url": "http://www.google.com/calendar/ical/f3j6egtm35u2v027rog3sob7gk%40group.calendar.google.com/public/basic.ics"
     {"email":"contact@ackspace.nl"},
+
    }
     {"ml":"info@lists.ackspace.nl"},
+
  },
  "open":true,
+
  "contact":{
  "status":"open for public",
+
     "email":"contact@ackspace.nl",
  "lastchange":1320586506,
+
     "irc":"irc://freenode/#ACKspace",
 +
     "keymaster":[
 +
      "31457112345, extension 1333"
 +
    ],
 +
     "ml":"info@lists.ackspace.nl",
 +
     "phone":"31457112345",
 +
    "sip":"31457112345@sip1.budgetphone.nl",
 +
    "twitter":"@ACKspace"
 +
  },"state":{
 +
"open":true,
 +
"message":"open for public",
 +
"lastchange":1415742805,
 +
"icon":{
 +
"open":"https://ackspace.nl/icon/open.png",
 +
"closed":"https://ackspace.nl/icon/closed.png"
 +
}
 
}
 
}
</pre>
 
 
 
If ACKspace is closed:
 
<pre>
 
{
 
  "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,
 
 
}
 
}
 
</pre>
 
</pre>
Line 67: Line 62:
 
== To do list: (Optional) ==
 
== 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)
* 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."
+
* <del>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."</del> Done.

Revision as of 23:56, 11 November 2014

Project: SpaceAPI
Featured:
State Completed
Members Vicarious, CoolePascal, Prodigity
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:

  • Updated JSON object to become SpaceAPI 0.13 compliant (see status.php)
    • Content type and Cache-Control headers are now sent
    • Now uses location object
    • Now uses state object
    • Space state now has a third state; null. (In case of uncertain state)
{
  "api":"0.13",
  "space":"ACKspace",
  "logo":"https://ackspace.nl/ACKspace.150px.png",
  "url":"https://ackspace.nl/",
  "location":{
    "address":"Kloosterweg 1, 6412 CN Heerlen, The Netherlands",
    "lat":50.892665,
    "lon":5.971104
  },
  "issue_report_channels":[
    "email"
  ],
  "feeds":{
    "calendar":{
      "type": "text/calendar",
      "url": "http://www.google.com/calendar/ical/f3j6egtm35u2v027rog3sob7gk%40group.calendar.google.com/public/basic.ics"
    }
  },
  "contact":{
    "email":"contact@ackspace.nl",
    "irc":"irc://freenode/#ACKspace",
    "keymaster":[
      "31457112345, extension 1333"
    ],
    "ml":"info@lists.ackspace.nl",
    "phone":"31457112345",
    "sip":"31457112345@sip1.budgetphone.nl",
    "twitter":"@ACKspace"
  },"state":{
	"open":true,
	"message":"open for public",
	"lastchange":1415742805,
	"icon":{
		"open":"https://ackspace.nl/icon/open.png",
		"closed":"https://ackspace.nl/icon/closed.png"
	}
}
}
  • 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." Done.