Skip to content

Instantly share code, notes, and snippets.

@ippa
Created March 14, 2015 17:38
Show Gist options
  • Save ippa/1ce197955a76e2a1a641 to your computer and use it in GitHub Desktop.
Save ippa/1ce197955a76e2a1a641 to your computer and use it in GitHub Desktop.
access platsbanken api from nodejs/iojs
/*
* on cmdline 'npm install superagent'
*/
var superagent = require("superagent");
var url = "http://api.arbetsformedlingen.se/platsannons/soklista/kommuner?lanid=10"
superagent.get(url)
.set("Accept", "application/json")
.set("Accept-Language", "sv-SE,sv")
.end( function(err, res) {
if(res.ok) {
console.log(res.text);
}
else {
console.log("Err: " + err);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment