Code Monkey home page Code Monkey logo

Comments (8)

mfa avatar mfa commented on September 3, 2024

archive.luftdaten.info is only a nginx server and not the same server/application as feinstaub-api.

from feinstaub-api.

ricki-z avatar ricki-z commented on September 3, 2024

The blocking header is set by github.com.
The header Content-Security-Policy restricts the resources you can include. It should be possible to load the data files if your page is hosted on a server not sending this header.
Or if you can configure this header in this server.

Rajko

Am 24. März 2016 22:04:35 MEZ, schrieb "André Jaenisch" [email protected]:

Steps to reproduce (for example, from github.com):

jQuery.get("http://archive.luftdaten.info/2015-10-01/2015-10-01_ppd42ns_sensor_27.csv").then(function(response)
{ console.log("response", response); });
Object { state: .Deferred/r.state(), always: .Deferred/r.always(),
then: .Deferred/r.then(), promise: .Deferred/r.promise(), pipe:
.Deferred/r.then(), done: Q.Callbacks/f.add(), fail:
Q.Callbacks/f.add(), progress: Q.Callbacks/f.add() }
Content Security Policy: The page's settings blocked the loading of a
resource at
http://archive.luftdaten.info/2015-10-01/2015-10-01_ppd42ns_sensor_27.csv
("connect-src https://github.com https://uploads.github.com
https://status.github.com https://api.github.com
https://www.google-analytics.com https://github-cloud.s3.amazonaws.com
https://api.braintreegateway.com
https://client-analytics.braintreegateway.com wss://live.github.com").

Albeit this is CSP, it would be handy to have a way to request the data
via XHR (aka "Ajax").
Therefore
CORS
must be enabled. This way I could write a client-side only JavaScript
application which pulls the data in. JSONP would be fine, too.

As far as I understood
CSP

you would need to declare a website which is allowed access to
http://archive.luftdaten.info/2015-10-01/2015-10-01_ppd42ns_sensor_27.csv.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#6

from feinstaub-api.

Ryuno-Ki avatar Ryuno-Ki commented on September 3, 2024

@mfa Is there a way to access those archive data through the feinstaub-API? (If possible, even anonymous)

from feinstaub-api.

asmaps avatar asmaps commented on September 3, 2024

@Ryuno-Ki nope, currently not as the data is generated on a dedicated server (archive.luftdaten.info) from a nightly db dump. The main API does not have to do anything with it (besides providing the dump)

from feinstaub-api.

Ryuno-Ki avatar Ryuno-Ki commented on September 3, 2024

@asmaps Can you point me to where the API provides the dump?

from feinstaub-api.

asmaps avatar asmaps commented on September 3, 2024

It's not public as its a raw Postgres dump containing hashed passwords, session keys etc. It's generated with a cronjob and copied with scp to @mfa 's server

from feinstaub-api.

asmaps avatar asmaps commented on September 3, 2024

but I think you should be able to access the data as json via the /data endpoint for the public sensors ( https://api.luftdaten.info/v1/data/ ). It's not those csv files then, but should be the same data afaik.

from feinstaub-api.

Ryuno-Ki avatar Ryuno-Ki commented on September 3, 2024

Looks good. Thanks!

from feinstaub-api.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.