Posted September 07, 2016
Hmm, I see, I have not considered the option that you have them that way in the database, that changes things. I cannot ask of you to enable this kind of conversion, maybe if some other person asks for it in the future. Yes, I would only need it for "title" for now but I'll implement my own conversion I think it'll be fine.
Now I ran into another issue. :)
When trying to create a web application (this is a private helper application, nothing public or that will compete with MaGOG itself) that would query the MaGOG data using the JSON output as a web API I get errors because by default browsers do not allow Javascript programs to read the documents returned from a HTTP request that they make to sites other than the site that the javascript loaded from. This is a security policy implemented by browsers in order to avoid untrusted Javascript from third-party sites issue HTTP requests using your cookies to say Gmail if youd happen to be logged in to Gmail in the same session.
There are 2 possible solutions that could be done on the MaGOG side:
- when performing requests with JSON output, put the following header in the reply[1]:
Access-Control-Allow-Origin: *
- or, support JSON-P[2]
If you do enable CORS or JSONP, note that then anyone could build a web application that uses your search engine to return results. So essentially someone may be able to build a MaGOG clone (tho I guess that's also possibly now by getting a full database dump). If you aren't concerned with this, I'd very much love to have one of those implemented so that I could build my little web app around MaGOG, thanks! :)
[1] https://en.wikipedia.org/wiki/Cross-origin_resource_sharing
[2] https://en.wikipedia.org/wiki/JSONP
Now I ran into another issue. :)
When trying to create a web application (this is a private helper application, nothing public or that will compete with MaGOG itself) that would query the MaGOG data using the JSON output as a web API I get errors because by default browsers do not allow Javascript programs to read the documents returned from a HTTP request that they make to sites other than the site that the javascript loaded from. This is a security policy implemented by browsers in order to avoid untrusted Javascript from third-party sites issue HTTP requests using your cookies to say Gmail if youd happen to be logged in to Gmail in the same session.
There are 2 possible solutions that could be done on the MaGOG side:
- when performing requests with JSON output, put the following header in the reply[1]:
Access-Control-Allow-Origin: *
- or, support JSON-P[2]
If you do enable CORS or JSONP, note that then anyone could build a web application that uses your search engine to return results. So essentially someone may be able to build a MaGOG clone (tho I guess that's also possibly now by getting a full database dump). If you aren't concerned with this, I'd very much love to have one of those implemented so that I could build my little web app around MaGOG, thanks! :)
[1] https://en.wikipedia.org/wiki/Cross-origin_resource_sharing
[2] https://en.wikipedia.org/wiki/JSONP