1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
| git show 1e84a036b2f33c59e2390730699a488c65643d28 commit 1e84a036b2f33c59e2390730699a488c65643d28 Author: dev-carlos.valderrama <dev-carlos.valderrama@tiempoarriba.htb> Date: Sun Apr 30 20:51:10 2023 -0500
feat: create api to editorial info
* It (will) contains internal info about the editorial, this enable faster access to information.
new file mode 100644
@@ -0,0 +1,74 @@ +# API (in development). +# * To retrieve info about editorial + +import json +from flask import Flask, jsonify + +# ------------------------------- +# App configuration +# ------------------------------- +app = Flask(__name__) + +# ------------------------------- +# Global Variables +# ------------------------------- +api_route = "/api/latest/metadata" +api_editorial_name = "Editorial Tiempo Arriba" +api_editorial_email = "info@tiempoarriba.htb" + +# ------------------------------- +# API routes +# ------------------------------- +# -- : home +@app.route('/api', methods=['GET']) +def index(): + data_editorial = { + 'version': [{ + '1': { + 'editorial': 'Editorial El Tiempo Por Arriba', + 'contact_email_1': 'soporte@tiempoarriba.oc', + 'contact_email_2': 'info@tiempoarriba.oc', + 'api_route': '/api/v1/metadata/' + }}, + { + '1.1': { + 'editorial': 'Ed Tiempo Arriba', + 'contact_email_1': 'soporte@tiempoarriba.oc', + 'contact_email_2': 'info@tiempoarriba.oc', + 'api_route': '/api/v1.1/metadata/' + }}, + { + '1.2': { + 'editorial': api_editorial_name, + 'contact_email_1': 'soporte@tiempoarriba.oc', + 'contact_email_2': 'info@tiempoarriba.oc', + 'api_route': f'/api/v1.2/metadata/' + }}, + { + '2': { + 'editorial': api_editorial_name, + 'contact_email': 'info@tiempoarriba.moc.oc', + 'api_route': f'/api/v2/metadata/' + }}, + { + '2.3': { + 'editorial': api_editorial_name, + 'contact_email': api_editorial_email, + 'api_route': f'{api_route}/' + } + }] + } + return jsonify(data_editorial) + +# -- : (development) mail message to new authors +@app.route(api_route + '/authors/message', methods=['GET']) +def api_mail_new_authors(): + return jsonify({ + 'template_mail_message': "Welcome to the team! We are thrilled to have you on board and can't wait to see the incredible content you'll bring to the table.\n\nYour login credentials for our internal forum and authors site are:\nUsername: git show 1e84a036b2f33c59e2390730699a488c65643d28 commit 1e84a036b2f33c59e2390730699a488c65643d28 Author: dev-carlos.valderrama <dev-carlos.valderrama@tiempoarriba.htb> Date: Sun Apr 30 20:51:10 2023 -0500
feat: create api to editorial info
* It (will) contains internal info about the editorial, this enable faster access to information.
new file mode 100644
@@ -0,0 +1,74 @@ +# API (in development). +# * To retrieve info about editorial + +import json +from flask import Flask, jsonify + +# ------------------------------- +# App configuration +# ------------------------------- +app = Flask(__name__) + +# ------------------------------- +# Global Variables +# ------------------------------- +api_route = "/api/latest/metadata" +api_editorial_name = "Editorial Tiempo Arriba" +api_editorial_email = "info@tiempoarriba.htb" + +# ------------------------------- +# API routes +# ------------------------------- +# -- : home +@app.route('/api', methods=['GET']) +def index(): + data_editorial = { + 'version': [{ + '1': { + 'editorial': 'Editorial El Tiempo Por Arriba', + 'contact_email_1': 'soporte@tiempoarriba.oc', + 'contact_email_2': 'info@tiempoarriba.oc', + 'api_route': '/api/v1/metadata/' + }}, + { + '1.1': { + 'editorial': 'Ed Tiempo Arriba', + 'contact_email_1': 'soporte@tiempoarriba.oc', + 'contact_email_2': 'info@tiempoarriba.oc', + 'api_route': '/api/v1.1/metadata/' + }}, + { + '1.2': { + 'editorial': api_editorial_name, + 'contact_email_1': 'soporte@tiempoarriba.oc', + 'contact_email_2': 'info@tiempoarriba.oc', + 'api_route': f'/api/v1.2/metadata/' + }}, + { + '2': { + 'editorial': api_editorial_name, + 'contact_email': 'info@tiempoarriba.moc.oc', + 'api_route': f'/api/v2/metadata/' + }}, + { + '2.3': { + 'editorial': api_editorial_name, + 'contact_email': api_editorial_email, + 'api_route': f'{api_route}/' + } + }] + } + return jsonify(data_editorial) + +# -- : (development) mail message to new authors +@app.route(api_route + '/authors/message', methods=['GET']) +def api_mail_new_authors(): + return jsonify({ + 'template_mail_message': "Welcome to the team! We are thrilled to have you on board and can't wait to see the incredible content you'll bring to the table.\n\nYour login credentials for our internal forum and authors site are:\nUsername: prod\nPassword: 080217_Producti0n_2023!@\nPlease be sure to change your password as soon as possible for security purposes.\n\nDon't hesitate to reach out if you have any questions or ideas - we're always here to support you.\n\nBest regards, " + api_editorial_name + " Team." + }) # TODO: replace dev credentials when checks pass + +# ------------------------------- +# Start program +# ------------------------------- +if __name__ == '__main__': + app.run(host='127.0.0.1', port=5001, debug=True)\nPlease be sure to change your password as soon as possible for security purposes.\n\nDon't hesitate to reach out if you have any questions or ideas - we're always here to support you.\n\nBest regards, " + api_editorial_name + " Team." + }) # TODO: replace dev credentials when checks pass + +# ------------------------------- +# Start program +# ------------------------------- +if __name__ == '__main__': + app.run(host='127.0.0.1', port=5001, debug=True)
|