Browse Source

Merge branch 'master' of http://git.choozmo.com:3000/choozmo/bhouse_api

deployer 3 years ago
parent
commit
af53c57a04
3 changed files with 5 additions and 3 deletions
  1. 3 1
      models/store_locations/routes.py
  2. 1 1
      models/store_locations/templates.py
  3. 1 1
      run.py

+ 3 - 1
models/store_locations/routes.py

@@ -27,6 +27,8 @@ class StoreLocations(Resource):
                 result['title'] = line.split('title: ')[-1].replace('"', '').replace('\n', '')
             elif 'type: ' in line:
                 result['type'] = line.split('type: ')[-1].replace('"', '').replace('\n', '')
+            elif 'url: ' in line:
+                result['url'] = line.split('url: ')[-1].replace('"', '').replace('\n', '')
             elif '<amp-img' in line:
                 is_amp_img = True
             elif 'h2 class="mb-4"' in line:
@@ -83,7 +85,7 @@ class StoreLocations(Resource):
                 title=store_data.get('title'),
                 date=get_now_time(),
                 type=store_data.get('type'),
-                district=self._get_district_name(store_data.get('title')),
+                url=store_data.get('url'),
                 amp_imgs=self._get_amp_img_md(store_data.get('imgs'), store_data.get('title')),
                 store=store_data.get('store'),
                 hour=store_data.get('hour'),

+ 1 - 1
models/store_locations/templates.py

@@ -4,7 +4,7 @@ date: {date}
 lastmod: {date}
 draft: false
 type: "{type}"
-url: "/{type}/bhouse_store_in_{district}_city"
+url: "{url}"
 image: ""
 tags:
 ---

+ 1 - 1
run.py

@@ -9,4 +9,4 @@ if __name__ == '__main__':
     logging.basicConfig(
         level=logging.INFO,
         format='%(asctime)s %(levelname)s %(message)s')
-    app.run(debug=True, port=5000)
+    app.run(host='0.0.0.0', debug=True, port=5000)