How to retrieve data directly from .json file present on GitHub? - json

I am developing a Dialogflow chatbot and I found an useful Q/A '.json' file on GitHub. Is it possible to retrieve data directly from GitHub to Dialogflow? if yes, how can I it ?

Maybe, you could try to make a GET request and trying to get a jsonp file.
But chances are, that GitHub doesn't allow CORS (Cross Origin Ressource Sharing).
You can only try it out yourself.

Fetch that file as a raw Github file which will have a similar link like this. https://raw.githubusercontent.com/google-research/bert/master/sample_text.txt

Related

how can i host a json file on artifactory, can artifcatory be used as a webserver

I want to host a json file on artifactory repo.
Currently if i go to the link for the file it directly downloads.
But i want it to be shown as a file like a webserver.
Is that possible in artifactory ?
Can it work as a webserver for hosting single files ?
In order to achieve your use case, you need to enable content browsing option in your Artifcatory repository. You can find the details here:
Please be aware this may not work for all the file types(for json it should) as it's based on the mime types configured for the Artifactory application.
You can view any file or artifact from the Artifactory UI (tree browsing) or with native list browsing.
See more information about file browsing here and here.

Where can i store a Json for Roku to Parse?

With the closure of MyJson.com, where can a developer upload a json file to be parsed? I have completed my file with Json Feed Manager and uploaded the file to GitHub, but the ability to read to use the URL as a raw does not work any longer. I'm thinking this was turned into a paid feature vs. free. Some of the other Roku developers have hinted the best suggestion is to acquire a paid webhost and make a directory for json to be uploaded into it and point the Direct Publisher to the source.
https://community.roku.com/t5/Roku-Direct-Publisher/bd-p/roku-direct-publisher
I have completed my file with Json Feed Manager and uploaded the file to GitHub, but the ability to read to use the URL as a raw does not work any longer.
I don't believe this is the case. You can still access raw content from GitHub through the domain https://raw.githubusercontent.com
Template:
https://raw.githubusercontent.com/<username>/<repository>/<branch>/<path-to-file>
Example:
https://raw.githubusercontent.com/pomber/covid19/master/package.json

Send Multiple JSON Files from Directory to a REST API with JMETER

I'm really struggling with getting Jmeter to work with sending multiple json files in Jmeter to a REST API. I have tried other questions on stack and tutorials online and none of them answer my specific requirement.
My requirement is that I will have various json messages saved to a file directory and I'm trying to use JMeter to loop through the folder, pick up the json's and pop it into a HTTP request one at a time i.e. one file = one request and view the result.
Does any one know how to do this?
The easiest solution would be:
Directory Listing Config plugin to read file names into a JMeter Variable
__FileToString() function to read the file content

Where the Swagger pretty HTML code?

There are only ugly HTML pages as download (HTML, HTML2 and dynamic all ugly), but the site, eg. edited https://app.swaggerhub.com/apis/{user}/{project}/{version}
(and many others!) offers pretty HTML interface... How to download this pretty HTML?
Complete and autonomous HTML code (file or zip of files).
I have a good and valid swagger.yaml or swagger.json file of my API, so another solution is to run a open sourse (plug and play!) tool with my API-description file.
The pretty:
The ugly:
The "pretty interface" on your screenshot is Swagger UI. It's free and open-source. There's a demo at http://petstore.swagger.io, where you can load your own YAML/JSON files from an URL and see how they would be rendered.
To use Swagger UI locally:
Go to https://github.com/swagger-api/swagger-ui and download the repository as ZIP:
Edit the dist\index.html file and change the line
url: "http://petstore.swagger.io/v2/swagger.json",
to the URL of your Swagger .json or .yaml file, e.g.
url: "http://api.mysite.com/swagger.json",
(Optional) Add/change other configuration parameters in the SwaggerUIBundle initialization code in dist\index.html.
Open the dist\index.html file in your browser to preview your API docs.
Note: If the spec does not load or "try it out" does not work, you probably need to enable CORS on the your server. See https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/cors.md and https://enable-cors.org.
Upload the files from the dist folder somewhere to your server - and now you have pretty API docs too!
Alternatively, SwaggerHub (which you mentioned) provides cloud hosting for Swagger specs among other things, and has Swagger UI integrated. You can import your Swagger .json/.yaml files there and have your API docs hosted on SwaggerHub. A free plan is available.
Thanks to #tleyden at swagger-ui/issues for good clues!
Use the index and assets folder of this project, https://github.com/okfn-brasil/swagger-ui-html

Format all model & service URLs to include .json in AngularJS

I'm having a problem where my web service expects all RESTful urls to include a .json extension on the URL. I've made it so in my AngularJS code so that all URLs have that extension. So my service urls look like this:
/resources/:id.json
But the problem is that when I include the .json extension then the POST create restful action ends up posting to a URL that looks like:
/resources/.json
This throws an error.
What I need to do is set the defaults inside my AngularJS app to set .json just before each URL is returned. Any ideas on how to do this?
I don't think so.
You could edit your copy of angular-resource.js to have this. Accept a suffix parameter in your resource or something.
Since this doesn't exist (yet) in AngularJS I had to fork a repo and add it myself.
Here's the repo with this feature added.
https://github.com/yearofmoo/angular.js