This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>The Ruby Movie DB</title> | |
| <meta charset='utf-8'> | |
| <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no'> | |
| <meta name='format-detection' content='telephone=no'> | |
| <meta http-equiv='X-UA-Compatible' content='IE=edge'> | |
| <meta http-equiv='Content-Type' content='text/html; charset=utf-8'> | |
| <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function parse_2() { | |
| var data = {"data": [{"score": 2650, "user": {"name": "Adriano Sanna", "id": "10153481303254109"}}]}; | |
| var nomi_e_score = []; | |
| for (var i = 0; i < data.data.length; i += 1) { | |
| nomi_e_score.push({ | |
| nome: data.data[i].user.name, | |
| score: data.data[i].score | |
| }); | |
| } | |
| return nomi_e_score; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function parse() { | |
| var data = {"data": [{"score": 2650, "user": {"name": "Adriano Sanna", "id": "10153481303254109"}}]}; | |
| var nomiAmici = []; | |
| var scoreAmici = []; | |
| for (var i = 0; i < data.data.length; i += 1) { | |
| nomiAmici.push(data.data[i].score); | |
| scoreAmici.push(data.data[i].user.name); | |
| } | |
| console.log(nomiAmici); | |
| console.log(scoreAmici); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bson | |
| flask | |
| pymongo | |
| gunicorn | |
| flask-cors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Register blueprints | |
| app.register_blueprint(books, url_prefix='/books') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Blueprint definition | |
| books = Blueprint('books', __name__) | |
| @books.route('/<environment>/', methods=['GET']) | |
| @cross_origin(origins='*', headers=['Content-Type']) | |
| def get(environment): | |
| dao = get_dao(environment) | |
| out = json.dumps(dao.get('books'), sort_keys=True, indent=4, default=json_util.default) | |
| return Response(out, content_type='application/json; charset=utf-8') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| from flask import Flask | |
| from bson import json_util | |
| from flask.ext.cors import CORS | |
| from test_data_crud_services.rest.books import books | |
| from test_data_crud_services.resources.schema import schema | |
| # Initiate Flask framework | |
| app = Flask(__name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test_data_crud_services/ | |
| ├── test_data_crud_services | |
| │ ├── config | |
| │ │ └── settings.py | |
| │ ├── core | |
| │ │ └── dao.py | |
| │ └── rest | |
| │ └── books.py | |
| └── test_data_crud_services_test | |
| | ├── core |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| 'use strict'; | |
| var app = angular.module('NYTBestSellers'); | |
| app.directive('book', function () { | |
| return { | |
| restrict: 'E', | |
| templateUrl: 'src/html/directives/book.html', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <book></book> |