Skip to content

Instantly share code, notes, and snippets.

@mertyildiran
Created July 9, 2021 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mertyildiran/864a60d0dd949a588d01581361f9b35b to your computer and use it in GitHub Desktop.
Save mertyildiran/864a60d0dd949a588d01581361f9b35b to your computer and use it in GitHub Desktop.
Catflix new `discover_movie.json.j2`
{
"page": 1,
"results": [{% for n in range(range(100) | random) %}
{
"adult": {{ fake.boolean(chance_of_getting_true=25) | lower }},
"backdrop_path": "/500/281/cat?random={{ fake.random_int(min=0, max=1000, step=1) }}",
"genre_ids": {{ ([request.queryString.with_genres | int] + fake.random_choices(elements=[12, 28, 53, 135, 956, 2786, 10752])) | unique | list | tojson }},
"id": {{ fake.random_int(min=10000, max=50000, step=1) }},
"original_language": "{{ fake.language_code() }}",
"original_title": "{{ fake.text(max_nb_chars=20)[:-1] | title }}",
"overview": "{{ fake.sentence(nb_words=10) }}",
"popularity": {{ random.float('0.0', '10000.0', 3) }},
"poster_path": "/661/981/cat?random={{ fake.random_int(min=0, max=1000, step=1) }}",
"release_date": "{{ date.date('%Y-%m-%d') }}",
"title": "{{ fake.text(max_nb_chars=20)[:-1] | title }}",
"video": {{ fake.boolean(chance_of_getting_true=5) | lower }},
"vote_average": {{ random.float('0.0', '10.0', 1) }},
"vote_count": {{ fake.random_int(min=0, max=1000, step=1) }},
"runtime": {{ fake.random_int(min=20, max=180, step=1) }}
}{% if not loop.last %},{% endif %}
{% endfor %}],
"total_pages": {{ fake.random_int(min=500, max=2000, step=500) }},
"total_results": {{ fake.random_int(min=10000, max=100000, step=500) }}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment