Movies Data rest Api nodejs - node.js

I want to fetch the Hollywood movies data. I have referred many APIs like IMDB, omdb, etc but all these APIs are taking a query string as a required parameter.
But i want some dummy data of movies without passing query string as a parameter with all details of movies like title, poster_image etc.
So please tell me something so that I can move further on this.

This is not a direct answer, however, have you tried googling "imdb dataset"
Here is what i have found, you need to register on their site and download CSV. Which you can later import to your DB.
IMDB Dataset - Kaggle

Related

How to convert user natural query into SQL query?

I am trying to build a chatbot in Rasa/Dialogflow, the problem i ham facing is to convert English to SQL query so that what user write in English can be converted into SQL fetch data from MYSQL database and display result to use.
Can someone suggest me how to do it?
Ideally this is only possible through solutions like SEQ2SQL(Link here for reference).
But I implemented it in a workaround fashion:-
I got the json using tracker.latest_message .
After which I processed the json to make our own structured json like:
[{'column_name':'a',
'operator': '=',
'value':'100'},
{'column_name':'b',
'operator': '>',
'value':'100'}]
Above structure was used to form the where clause of the query.
Same way I made a custom json for Select Part as well :-
[{sum:column1},{count:column2}]
5.Then I looped through the json I had created and made our queries.
Note:- This json Structure will not be able to cover all possible scenarios but worked decently for me.

How I can build a custom/dynamic uploading form in Django 2.1 so that the user can upload the data within the required elements

I am building an app in Django 2.1 which allows users to upload posts. I have achieved this using Django forms and sent the data back to DB (this is simple as it has post title and the post itself). Now I want to enhance this with the dynamic generation of elements while user uploads the data i.e. how can I implement the following requirement :
How can we allow users to add unknown number of images while uploading a post OR for a technical post user wants to add code snippets (dynamic number of snippets anywhere in the post). The post should be saved in the DB and then will be rendered.
How would the DB schema be defined in this scenario, because the number of elements are undefined initially.
Take a simple example to understand the requirement: Start writing a post on blogger and there would be n number of UI elements available to add in the post at the runtime.
I have got a reference while googling:
https://www.caktusgroup.com/blog/2018/05/07/creating-dynamic-forms-django/
I'm a newbie and want to know how I can technically achieve this. I would really appreciate any help.
Thanks
How would the DB schema be defined in this scenario, because the number of elements are undefined initially.
This is the purpose of relations in a Relational database.
When an object Core contains/is related to multiple objects Extension, we call that relation a One To Many relationship (as One Core possesses/has Many Extensions).
In SQL, and also in Django, those OneToMany are represented by Foreign Keys.
So in your case, you'll do it with something like this:
from django.db import models
class Post(models.Model):
title = models.CharField(max_length=xxx)
content = models.TextField()
class Image(models.Model):
file = models.ImageField(...)
post = models.ForeignKey('Post', on_delete=models.CASCADE)
class Snippet(models.Model):
content = models.TextField()
post = models.ForeignKey('Post', on_delete=models.CASCADE)
How can we allow users to add unknown number of images while uploading a post OR for a technical post user wants to add code snippets (dynamic number of snippets anywhere in the post).
For your frontend, you can use the Django Formsets which can be used in your case (as you have multiple input corresponding to the same Model).
With some little javascript, you can use the Django empty_form to dynamically display a new form when your end user fills the one already displayed, for example.

Cloudant - apply a view/mapReduce to a geospatial query

HI I'm new to cloudant (and couch and asking questions on stackoverflow so I hope I manage to be vaguely clear about what I'm asking ) and I'm trying to do probably the second most basic geo task but am hitting a dead end.
I've got a database of docs which are geojson objects, I've created an index so I can query for intersections etc but it seems the only options I have in the url is the format=legacy (gives me the ids) and the format=geojson and the include_docs parameter - what I'd like to do is give back a particular view of the result set - I'm not interested in the geometry of the object (which is a big lump of data and it's likely that a number of other properties may be in the document that I'd rather filter out)
is there a correct way to do this in a single api call or do I need to fetch the doc ids (legacy format) and then issue a second query to bring back my chosen 'view' for each document id given in the result of format=legacy response
Thanks

GSA: index the e-commerce sites and display the results in sort by price?

We want to index few public e-commerce sites. When our customers search any one of the product the results, should display sort by pricing from all indexed e-commerce sites.
From My Understanding: The public e-commerce sites have different meta tag for pricing i cannot even consolidate into one meta tag.
Is there possible to Feed via XML, but don't have much idea inside how to achieve? we don't have db access to parse only required data
Via Entity recognition how i can able to index the price as a meta tag ?
Could u please advice us, whether it is achievable or not? If yes, which one is the best solution and refer document for this.
Ignoring the sorting issue and just concentrating on normalising the price metadata problem. You need a way to read the price from whatever metadata field it's in and create a new metadata field with a common name and the same value.
There are a few ways to do this but the simplest are probably:
Generate a Meta-and-url feed for each document and add in the normalised metadata
Crawl via a proxy that can add a X-GSA-External-Metadata header in containing the normalised metadata

Looking up types from Freebase

I am trying to find a list of relevant types to a certain string from Freebase, lets say for example i enter Jordan, then i will have a list with types country, person, athlete .. etc.
I have found several ways for the query, for example:
First Query
trying to get the JSON fails, using:
$.getJSON('http://api.freebase.com/api/service/search?query=jordan',function (data) {
console.log(data);
});
There is another query that gives me better result, as i only get the types here but i also cannot get the JSON file from it.
Will appreciate any help.
Your problem has probably less to do with freebase and more to do the fact that you can't do cross domain http requests. You are requesting data from api.freebase.com but you are probably hosting this page in another domain.
You can use the JSONP mechanism to circumvent that restriction, here is some documentation:
http://api.jquery.com/jQuery.getJSON/
Read the section JSONP.
Another couple of points:
Are you trying to search for all entities that somehow match the word "jordan" or are you looking for exactly all the entities that are named "jordan" ? Your best bet is to use the /search API instead of /mqlread which is for structured database queries.
You are also using the legacy API that is deprecated. Here is some docs on the new API:
http://wiki.freebase.com/wiki/API
Here's how your request will look (note that you 'll need an API key for production):
https://www.googleapis.com/freebase/v1/search?query=jordan&mql_output=[{%22name%22%20:%20null,%22type%22:[]}]

Resources